Items

Preview trashing items

Returns what POST /items/trash would move to the trash for the same ids: each item and every item you can read that a cascading edge such as parent-of reaches, or comment or attachment whose hosts would all be in the trash. Nothing changes.

POST
/items/trash-preview

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Header parameters

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 you would trash, at most 20.

Items1 <= items <= 20

Response body

Returns the items and what their trash would take.

application/json
  1. response

What trashing items would move to the trash. Items you can't read are taken too and aren't listed or counted.

items*array<>

Each item you named, once, in the order you named them.

count*integer

How many items you can read that trashing the named items would move to the trash, each counted once, the named items included.

digest*string

A SHA-256 hash, in hex, of every item count counts with its version, listed or not. It changes if any of them changes, joins or leaves. Pass it to POST /items/trash with the same ids to trash only what it covers.

curl -X POST 'http://localhost:8600/items/trash-preview' \  -H 'Content-Type: application/json' \  -d '{  "ids": [    "string"  ]}'
{  "items": [    {      "id": "string",      "type": "string",      "version": 1,      "takes": [        {          "id": "string",          "type": "string",          "version": 1        }      ],      "count": 0,      "truncated": true    }  ],  "count": 0,  "digest": "string"}