POST /v1/sandbox/create
Create a sandbox for a chat — Starts your chat's isolated code sandbox. You must own the chat, and campaignId must be that chat's campaign.
ivy_ API key (Authorization: Bearer ivy_… or X-Ivy-Api-Key), a Clerk session JWT (Authorization: Bearer …) or the Clerk __session cookie (browser sessions). See Authentication.Starts your chat's isolated code sandbox. You must own the chat, and campaignId must be that chat's campaign. A cold start returns status: "provisioning" with HTTP 200; poll getSandboxStatus until it is active. If another create for the same chat is already in flight, the call returns HTTP 202 with deduped: true, or HTTP 200 with status: "ready" and deduped: true when that sandbox is already up.
Send the key as Authorization: Bearer ivy_xxx; this route reads the Authorization header, so X-Ivy-Api-Key alone is not enough.
Request
Request body
Session ID for this sandbox
Chat to create the sandbox for. You must own it.
The chat's campaign. A different campaign is rejected.
Responses
200 OK
{status: "ready", deduped: true} when a concurrent create already finishedResponse shape:
provisioning or creating while starting, active or ready once usable
Launch phase of the sandbox
Estimated seconds until ready; present while provisioning
Present only on a deduplicated response
True when another create for this chat was already in flight
Present on a deduplicated ready response
Present on a deduplicated ready response
202 Accepted
Response shape:
provisioning or creating while starting, active or ready once usable
Launch phase of the sandbox
Estimated seconds until ready; present while provisioning
Present only on a deduplicated response
True when another create for this chat was already in flight
Present on a deduplicated ready response
Present on a deduplicated ready response
400 Bad Request
sessionId, chatId or campaignId, or campaignId is not the chat's campaignResponse shape: object
401 Unauthorized
Response shape: object
403 Forbidden
Response shape: object
429 Too Many Requests
Response shape: object
500 Internal Server Error
Response shape: object
503 Service Unavailable
Response shape: object
Was this page helpful?