Agents

Create an agent and admit its first run

Changed on

Creates a new agent (a chat session), inserts a synthetic user message carrying the prompt, claims the per-org concurrent slot, and spawns the agent work in the background. Responds 202 Accepted with the initial run object (status: "running"). Poll GET /agents/{id}/runs/{runId} until status !== "running".

Workspaces are deprecated: no workspace is auto-created any more. The returned workspace object describes the agent's session container (its id is a chat-session id every workspaceId parameter accepts). Passing a chat-session id as workspaceId creates the agent "in" that container - it copies the container's table/campaign links and inherits its uploaded documents; a legacy workspace id keeps the old semantics.

post/agents

Request

  • Base URL
    https://origami.chat/api/v2
  • URL
    https://origami.chat/api/v2/agents
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring

Transport-level replay protection: any v2 POST may send it (1-255 printable ASCII characters; UUIDs recommended). The first response for a key is recorded and replayed verbatim for retries with the same key + method/path/body for 24 hours; replayed responses carry the Idempotency-Replay: true response header. Reusing a key with a different request, or retrying while the original is still in flight, returns 409 IDEMPOTENCY_ERROR. 5xx responses are never recorded (the retry re-executes).

Request body

namestring

Optional human-readable label. Auto-generated from prompt if absent.

promptstring required
workspaceIdstring uuid nullable

Deprecated container anchor. A legacy workspace id keeps the old semantics; a chat-session id creates the agent "in" that session container (links + uploaded documents are inherited); null/omitted creates a fresh workspace-less agent.

focusTableIdsstring[]

Table ids to focus the agent on. With a legacy workspace workspaceId, every id must belong to that workspace; with a session container or no workspaceId, any org-owned table qualifies (it is linked to the agent's session).

model'origami-lite' | 'origami-max'

Public model id. Plan-aware default: highest model unlocked on the caller's plan (origami-lite for starter, origami-max for pro+). Resolved server-side to an internal chat-agent model; the response's request.model echoes the public id (origami-lite or origami-max), never an internal name. Legacy aliases origami-fast and origami-mid are still accepted and normalized to origami-lite.

Response

Run admitted; agent work is in the background.

Example response

{
  "run": {
    "todo": {
      "pendingQuestions": [
        {
          "freeformOption": "Or something else"
        }
      ]
    }
  }
}

Changes

    • breaking

      the response property ///////// became nullable for the status

    • warning

      added the new ACCOUNT_BLOCKED enum value to the response property for the response status

    • warning

      added the new BUDGET_EXCEEDED enum value to the response property for the response status

    • info

      request property deprecated

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      response property agent/workspaceId deprecated

    • info

      response property run/allOf[subschema #2]/response/allOf[RunResponse]/tables/items/workspaceId deprecated

    • info

      response property run/allOf[subschema #2]/workspaceId deprecated