Create a workspace
Creates one of your workspaces: the server mints its id and, unless you supplied one, its slug from the title (-2, -3, … on a clash with one of yours, so a create without a slug never fails on it). Idempotency-Key is required: a retry under the same key with the same body replays the 201 (Idempotent-Replay: true), and creates nothing twice.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Headers
Required on a write that mints an id: a URL-safe string of 1 to 64 characters from [A-Za-z0-9._~-] (a UUID fits), scoped to you, a fresh one per attempt and the same one on a retry. A retry with the same body replays the stored answer (Idempotent-Replay: true); the key on another body is 409 IDEMPOTENCY_KEY_REUSED. Missing is 400 MISSING_IDEMPOTENCY_KEY, malformed 400 INVALID_IDEMPOTENCY_KEY.
Your own id for the request: 8 to 128 of [A-Za-z0-9._-]. It becomes the request’s id and is echoed on the response. A value off that grammar is replaced with a fresh id, never refused.
Request
The layout: a JSON object of at most 256 KiB serialised, yours to shape. Anything but an object is 400; more than 256 KiB is 413 PAYLOAD_TOO_LARGE.
Who may read the row: PRIVATE, its owner alone; ORG, the owner’s organisation too, read-only, once organisation admission serves colleagues’ rows. ORG needs a token that names an organisation: without one it is 400. Append-only: tolerate values you don’t know; a write of one this release does not know is 400.
A slug of your own, 1 to 100 characters of [a-z0-9-]; one another of your workspaces holds is 409 SLUG_TAKEN. Absent, the server mints one from the title, -2, -3, … on a clash, so a create without one never fails on it.
Response
Created, or replayed for a retried key. Location is the workspace’s URL and the ETag its first version.
The slug, 1 to 100 characters of [a-z0-9-], unique among the owner’s workspaces: minted from the title on create unless you supplied one, and never changed after, so a page URL outlives a rename.
The layout: a JSON object whose shape belongs to the code that renders it (keep your own schemaVersion inside it). The API checks that it is an object of at most 256 KiB serialised and never reads inside it; it is served as you last wrote it: the same tree, members in their order, numbers exact.
Who may read the row: PRIVATE, its owner alone; ORG, the owner’s organisation too, read-only, once organisation admission serves colleagues’ rows. ORG needs a token that names an organisation: without one it is 400. Append-only: tolerate values you don’t know; a write of one this release does not know is 400.
Whether you own the row. false for a colleague’s ORG workspace, which you can read but not write. The owner’s identity is not on the row.
The row’s version, the ETag’s value: send it as If-Match on a write. A decimal string from one sequence shared by every row.
When the workspace was created, in epoch nanoseconds; microsecond-exact, so it ends in 000.
When the workspace was last written, in epoch nanoseconds; microsecond-exact, so it ends in 000.