Skip to main content
POST
/
agents
Create an agent and admit its first run
curl --request POST \
  --url https://origami.chat/api/v2/agents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "<string>",
  "name": "<string>",
  "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "focusTableIds": []
}
'
{
  "agent": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "createdAt": "2023-11-07T05:31:56Z"
  },
  "run": {
    "id": "<string>",
    "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "prompt": "<string>",
    "steps": {
      "completed": 1,
      "max": 2
    },
    "startedAt": "2023-11-07T05:31:56Z",
    "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "request": {
      "prompt": "<string>",
      "focusTableIds": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ]
    },
    "response": {
      "text": "<string>",
      "actions": [
        {
          "tableId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "tableName": "<string>",
          "columnId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "columnName": "<string>",
          "count": 123,
          "leadCount": 123,
          "deletedAt": "2023-11-07T05:31:56Z"
        }
      ],
      "tables": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>",
          "leadCount": 123,
          "columns": [
            {
              "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
              "name": "<string>",
              "type": "<string>",
              "slug": "<string>",
              "autoTrigger": true,
              "credits": {
                "lifetimeUsed": 123
              },
              "cells": {
                "running": 1,
                "errored": 1
              },
              "stats": {
                "avgCreditsPerRun": 123,
                "callRate": 0.5,
                "totalRuns": 123
              },
              "qualification": {
                "pass": 123,
                "fail": 123,
                "unsure": 123,
                "total": 123
              }
            }
          ],
          "credits": {
            "lifetimeUsed": 123
          },
          "cells": {
            "running": 1,
            "errored": 1
          },
          "url": "<string>",
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z",
          "stats": {
            "creditsPerLead": 123,
            "creditsPerQualifiedLead": 123,
            "findMoreEstimatedCredits": 123,
            "qualification": {
              "rate": 0.5,
              "fetchRate": 0.5,
              "qualifiedLeads": 123,
              "effectiveLeadsPerQualified": 123,
              "estimatedQualifiedLeads": 123
            },
            "funnel": {
              "totalSourcedLeads": 123,
              "postStaticLeads": 123,
              "dedupedLeads": 123,
              "dedupRate": 0.5,
              "excludedLeads": 123,
              "excludedRate": 0.5
            },
            "running": {
              "runningLeads": 123,
              "oldestActiveRunStartedAt": "2023-11-07T05:31:56Z"
            },
            "leadSources": [
              {
                "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
                "name": "<string>",
                "avgCreditsPerLead": 123,
                "totalCredits": 123,
                "totalLeads": 123
              }
            ],
            "hasUnknownTotalWithMore": true
          }
        }
      ],
      "transcriptTruncated": true,
      "transcript": [
        {
          "content": "<string>",
          "toolCalls": [
            {
              "id": "<string>",
              "name": "<string>",
              "input": "<unknown>"
            }
          ],
          "toolCallId": "<string>",
          "name": "<string>",
          "result": "<string>",
          "truncated": true
        }
      ]
    },
    "todo": {
      "pendingQuestions": [
        {
          "question": "<string>",
          "suggestedAnswers": [
            "<string>"
          ],
          "freeformOption": "Or something else"
        }
      ],
      "nextActions": [
        {
          "label": "<string>",
          "tableSlug": "<string>"
        }
      ]
    },
    "completedAt": "2023-11-07T05:31:56Z"
  },
  "workspace": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "createdByApi": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required
Required string length: 1 - 10000
name
string

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

Maximum string length: 80
workspaceId
string<uuid> | null
focusTableIds
string<uuid>[]

Table ids to focus the agent on. When the caller also supplies workspaceId, every id must belong to that workspace. When workspaceId is omitted, the workspace is inferred from the first id.

Maximum array length: 50
model
enum<string>

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.

Available options:
origami-lite,
origami-max

Response

Run admitted; agent work is in the background.

agent
object
required
run
object
required
workspace
object
required