Write Receipts
Idempotency keys, replays, and what became of a write X didn't confirm in time.
Early access. Tell us what you're building and we'll set you up. Contact us
Idempotency-Key#
Posts, replies and Articles require an Idempotency-Key header; follows,
reposts (and their undo), pins and profile edits accept one. Send one with a
profile edit that changes pictures or the handle: it can run past the
request's 140 seconds, and the receipt has its answer. A key is 1–200 characters of
A-Z a-z 0-9 . _ : -, scoped to your workspace:
- Same key, same request, after success: the stored answer is replayed with
Idempotent-Replayed: true. - Same key while the first request runs, or after an unsure outcome:
409 errors/in_progress. - Same key after a definite failure: the request runs again.
- Same key, another request:
422 errors/idempotency_key_reused.
What Became Of A Write#
GET /writes/{key} (a key with accounts.read or accounts.write; any other
answers 403 insufficient_permissions):
{ "object": "WriteStatus", "key": "launch-post-1", "state": "done", "status": 201,
"response": { "object": "PostCreated", "provider": "X", "post_id": "1850000000000000001" } }state is done (sent: response is the stored answer), failed (nothing
was sent: response is the problem), pending (still running, or not sure;
response is null), or none (no write with that key).
The browser's answer is kept for 48 hours, also after the request stopped
waiting (posts wait 140 seconds). For a pending write, GET /writes/{key} asks
for it: a final answer is stored and returned, an unsure one stays pending.
A write the browser never received becomes failed
(422 errors/never_started) 10 minutes after it started.
Releasing One#
POST /writes/{key}/not-sent (accounts.write): after you checked on X that a
pending write isn't there, it becomes failed, its key can be sent again, and
it stops counting toward the pace. A write Lempile has as sent stays sent
(409); one under 5 minutes old or still running answers 409 too.
Likes, deletes and Articles have no receipt (follow an Article with
GET /articles/{key}).
Was this page helpful?