Items

Trash items

Moves the items, and every item a cascading edge such as parent-of reaches from them, to the trash in one step, all of them or none of them. You can restore them until the retention window ends. Marfa then purges them.

POST
/items/trash

Authorization

bearerAuth
headerAuthorizationBearer <token>

Authenticate with an API key (marfa_k1_…) or an OAuth access token (marfa_at_…).

Header parameters

Idempotency-Key?string

A unique key that makes the request safe to retry. If you send the same request with the same key again, Marfa returns the first response and doesn't write again. A key belongs to the credential that sends it.

Lengthlength <= 255
X-Marfa-Instance-Id?string

The ID of the instance you expect, as GET / returns it. If another instance answers at this address, Marfa returns 409 instance_changed and doesn't write. Leave it out to send the request to whichever instance answers.

Match^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$

Request body

application/json
  1. body
ids*array<string>

The IDs of the items to trash, at most 20.

Items1 <= items <= 20
digest?string

The digest from POST /items/trash-preview for the same ids. If what the trash would take has changed since, nothing is trashed. Leave it out to trash what the items take now.

Match^[0-9a-f]{64}$

Response body

Returns { "ok": true }. An item that a cascading edge took into the trash has trashed_by_cascade, and trashed_with names the named item that took it if you can read its type.

application/json
  1. response

Confirms that the request succeeded.

ok*true

Always true.

Value intrue
curl -X POST 'http://localhost:8600/items/trash' \  -H 'Content-Type: application/json' \  -d '{  "ids": [    "string"  ]}'
{  "ok": true}