Skip to main content
Append an item to a thread session object.

POST /revisions/:id/data/command (Command: post_session_thread_item)

Request Body

Response

Returns the persisted item with server-stamped id, created_at, user_id, source, and the original/derived fields. A post to an alias that holds nothing creates the thread. The command raises thread.item_posted on the session’s stream, with the thread’s alias in its object block and the item’s id, user_id and optional parent_id, type, role and client in its item block. The item’s own source is the event’s, stamped by the platform (the item’s source). A first post to an empty alias raises object.written for the new thread before thread.item_posted. A client sent with the request is stored: the item in a listing, in Get Session Thread Item and in the event’s item block all carry the same value as source.client. The item is never split, so the event’s item block has no parts. See Types.

Errors

  • invalid_thread_envelope — the alias holds an object that is not a thread. An alias that holds nothing creates the thread.
  • thread_item_too_large — the serialized item exceeds workflow.thread_item_bytes, 262,144 bytes (256 KiB). The body carries limit. This command never splits an item into parts; a message a run posts (data.thread, logic.copy or post_message) is split instead.
  • invalid_request_body — a content block has an unknown type, or a file block omits one of alias, name, content_type, or size; both are rejected by request-schema validation before the command runs.
  • invalid_thread_item_content — a file block carries no file object at all, or its alias is outside the session-object alias grammar, or a block is outside the seven or malformed (Data Types).
  • too_many_files — the item contains more file content blocks than workflow.thread_item_files allows, 10. The body carries limit.
  • file_not_found — a file block references an alias that does not exist as a file object in the session.

Example

See also