Bulk

Many writes of mixed types in one request. Each item succeeds or fails on its own (unless atomic); links between items in the batch resolve. The body takes items, atomic and create_only, and each item type and element. Any other key, and any query parameter, is a 422 naming it, and so is one of these names sent twice; nothing is written. A name sent twice inside an item's element is no 422: it keeps its last value.

post/api/v2/bulk

Request

  • Base URL
    https://www.onlyworlds.com
  • Auth
    API key in header API-Key and API key in header API-Pin

Headers

Idempotency-Key, string

Replays of the same key with the same body return the first successful response (with Idempotent-Replay: true) for 24h; the same key with a different body is a 409 idempotency_error. While the first request with a key is still running, the same key is a 409 idempotency_in_flight: retry after Retry-After.

X-OW-Agent, string

Send it (any non-empty value) when an AI makes this write: the change is recorded with changed_via declared (a delete's tombstone with deleted_via). An AI seat's key is recorded as seat and MCP as mcp without it. The value is never stored.

X-OW-Client, string

The client's own name for itself (atlas, lantern, sdk): lower case letters, digits and hyphens, 1 to 32 characters, after a trim. It is stored on the element as changed_client (a delete's tombstone as deleted_client), beside the door; it changes no door and no permission. A value outside the rule is ignored (stored as null), never refused.

Request body

object required
items, object[] required

Up to 1000 writes of any types. An item with an id creates or replaces that element; without one, it creates. Items may link to each other in the same batch.

atomic, boolean

true: if any item fails, nothing is written. The response still lists each item as it would have gone.

create_only, boolean

true: an item with an id only creates, never replaces. An item whose id is already held is refused and nothing is written for it; when the id is its only fault, the refusal is the one POST /{type} gives that key for that id (409 id_conflict, or what POST tells a key that may not know the id exists). Any value but true, false or null is a 422 for the whole request.

Response

Always 200 once the batch is read: per-item statuses in items, and errors is true when any item failed. A contributor or guest's item that replaces an element someone else created fails 403 not_author. An item that creates may carry hidden: true as POST does; from a key that may not hide (only the owner's and co-builders' may) it fails 403 hidden_not_allowed. An item from a key below co-builder whose x_review_proposed or x_review_checked holds a by that is not its own membership id exactly as GET /me gives it, in a mark that is not exactly the one the element holds, fails 403 review_by_another. On a world whose owner takes an AI seat's writes as proposals, a seat's item that replaces an existing element answers 202 with proposal in its slot (the element unchanged; under atomic a failed batch keeps no proposal either), and a new element lands with x_review_proposed set.

BulkResult required
errors, boolean required

True when any item failed.

items, object[] required

One result per request item, in the same order.

Changes

    • info

      added the optional property error/limit to the response with the status

    • info

      added the optional property error/limit to the response with the status

    • info

      added the optional property error/limit to the response with the status

    4 more changes in this revision