Data

Write records and documents

POST
/data/write

Write records and Markdown documents of one Space in one transaction: every entry applies or none does. A record entry names its target by id or by type plus unique key and carries one of create, update, upsert, archive, restore; link, unlink, set_links and unset may accompany create, update and upsert. A document entry names its target by id or path and carries patch (steps on the current text), put (whole text) or create. if holds what must be true: the revision or hash last read, and for records a where filter evaluated under the row lock ('take it if free'). Whether the revision or hash is needed depends on the write_mode of the Space or record type: strict always, merge only for archive, restore, set_links, put, section replacement and replace-all. The first entry that fails aborts the call and is named in details.path; conflict and condition_failed return the current state in details.current. dry_run rehearses the call and leaves nothing behind.

Authorization

bearerApiKey
AuthorizationBearer <token>

Create a scoped API key in the Adlass settings.

In: header

Header Parameters

X-Request-Id?string

Optional correlation identifier.

Lengthlength <= 128
Idempotency-Key?string

A unique key for this intended write; the body field idempotency_key is accepted instead. One of the two is required. Reuse it only for an identical retry.

Length1 <= length <= 200

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/data/write" \  -H "Idempotency-Key: 123e4567-e89b-42d3-a456-426614174000" \  -H "Content-Type: application/json" \  -d '{    "space_id": "123e4567-e89b-42d3-a456-426614174000",    "ops": [      {}    ]  }'
{  "results": [    {      "status": "created",      "id": "example"    }  ],  "dry_run": false}