Campaigns

Create a campaign on a table (agentic)

Changed on

Agentic campaign creation. Body { instructions, autoLeadRefillEnabled? }: no column or channel; campaigns can be multi-channel and the agent infers the rest from the instructions and the table. Auto Lead Refill defaults ON (a campaign that never refills runs dry); pass autoLeadRefillEnabled: false to create without daily sourcing — same field as PATCH /campaigns/{campaignId}. Delegates to the chat agent via the v2 run path and responds 202 Accepted with { agent, run, table } (poll GET /agents/{agentId}/runs/{runId} for progress/result). The agent creates the campaign and drafts its sequences (it does not send); once the run completes, the drafted campaign shows up under GET /tables/{tableId}/campaigns. The pre-restructure POST /tables/{tableId}/sequences spelling is the legacy alias.

post/tables/{tableId}/campaigns

Request

  • Base URL
    https://origami.chat/api/v2
  • URL
    https://origami.chat/api/v2/tables/{tableId}/campaigns
  • 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

instructionsstring required

Free-form description of the campaign to draft.

autoLeadRefillEnabledboolean

Auto Lead Refill at birth. Defaults ON when omitted. Pass false to create the campaign without daily sourcing. Applied to the created campaign as the run settles; read settings.autoLeadRefillEnabled on the campaign to confirm the value before launching.

autoTopUpEnabledboolean

Pre-rename spelling of autoLeadRefillEnabled. Still accepted; autoLeadRefillEnabled wins when both are sent.

Response

Run admitted; the agent drafts the campaign in the background.

Example response

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

Changes

    • breaking

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

    • info

      added the new optional request property

    • info

      added the new optional request property

    • 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