Search Documentation

Search for a documentation page...

Elliot Runs API

Hand Elliot, the store's AI operator, a job over the Store API, follow the run and answer the approvals it waits on.

Elliot is the store's AI operator in the admin. A run hands him a job from outside: he works it the way he does in the dashboard chat (reads and changes the store, edits the storefront, writes copy) as the team member the connection acts for, with that member's permissions. Use a run for work that needs judgement or several steps. For one lookup or one change, call that operation directly.

Who can start a run

Only a team member can hand Elliot a job: connect over OAuth. A store API key gets 403, because a narrowly scoped key could otherwise do through Elliot what its own scopes refuse. Every member may start runs, as every member may talk to Elliot in the dashboard. The OAuth connection needs the ai:write scope.

A run spends the store's AI credits like any Elliot conversation, and is refused with 402 when they are spent. Reading a run and answering it spend nothing themselves; the work an answer resumes does. Get AI credits shows what is left.

Approvals stay on

A step that needs the team's approval (deletes, refunds, customer sends, publishing and the like) pauses the run as needs_input until someone answers it, through Answer a run or in the dashboard. There is no mode that skips approvals.

Start a run

POST /api/v1/elliot/runs
FieldTypeRequiredDescription
messagestringYesWhat to ask Elliot, as a person on the team would write it. Up to 20,000 characters
threadIdstringNoContinue this conversation, from an earlier run. Omit to start a new one
approvalMode"supervised" | "read_only"Nosupervised (default): every step that needs approval pauses the run. read_only: Elliot only looks things up, and anything that would change the store is refused
waitSecondsintegerNoHold the answer for up to 50 seconds until the run needs input or ends. Defaults to 0
idempotencyKeystringNoSend the same key again when a request may not have arrived. A repeat returns the run the first request started instead of sending the message twice
curl -X POST \
-H "Authorization: Bearer <oauth-access-token>" \
-H "Content-Type: application/json" \
-d '{"message":"Write SEO descriptions for the five newest products","waitSeconds":50,"idempotencyKey":"seo-2026-12-03"}' \
https://your-store.yns.store/api/v1/elliot/runs

Response (202)

{
"id": "019642c4-699d-729a-b606-0000000000d1.s.…",
"threadId": "019642c4-699d-729a-b606-0000000000d1",
"approvalMode": "supervised",
"status": "needs_input",
"pendingInputs": [
{
"id": "call_8f2",
"kind": "approval",
"title": "Update 5 products",
"prompt": "Elliot wants to save new descriptions for 5 products.",
"options": [
{ "id": "approve", "label": "Approve", "description": null },
{ "id": "deny", "label": "Deny", "description": null }
],
"allowsText": false,
"action": { "name": "…", "input": { … } },
"answerable": true
}
],
"reply": null,
"files": [],
"error": null,
"waitTimedOut": false
}
FieldDescription
idThe run. Use it to read and answer the run
threadIdThe conversation. Send it with the next run to continue. The conversation also shows in the team's Elliot panel
statusrunning, needs_input (an approval or a question waits, see pendingInputs), completed or failed (error says why)
pendingInputsWhat the run waits on: { id, kind, title, prompt, options, allowsText, action, answerable }. kind is approval, question, sign-in or budget. For an approval, action is the exact operation and input Elliot wants to run
replyElliot's answer as markdown, once he has written one
filesDownload links, { url, filename }, to files Elliot shared in this run
waitTimedOuttrue when the wait ran out while the run kept going. It is not a failure: read the run again instead of starting it over

Errors

StatusDescription
402The store has no AI credits left
403The caller is not a team member: a store API key, or Elliot himself
404Thread not found
409The thread has ended. Start a new one

Get a run

GET /api/v1/elliot/runs/:run?waitSeconds=50

Where the run stands: still working, waiting on an approval or a question, or done with its reply. waitSeconds (up to 50) holds the answer until the run needs input or ends. The response has the same shape as Start a run. A run of another store answers 404.

Answer a run

POST /api/v1/elliot/runs/:run/approvals

Approves or denies the actions the run waits on, or answers its questions, then lets the run go on.

FieldTypeRequiredDescription
answersobject[]Yes1–20 answers, each naming a pending input's id
answers[].decision"approve" | "deny"For an approvalLet the action run, or stop it
answers[].optionIdstringFor a questionThe id of the chosen option
answers[].textstringFor a question that takes textThe answer
waitSecondsintegerNoHold the answer for up to 50 seconds until the run needs input again or ends
idempotencyKeystringNoAs for starting a run
{ "answers": [{ "id": "call_8f2", "decision": "approve" }], "waitSeconds": 50 }

An approval lets Elliot run exactly the action shown in pendingInputs[].action, which can delete data, move money or reach customers. Show the person you work for what will happen, and answer with their decision. A sign-in can only be finished in the YNS dashboard.

Errors

StatusDescription
403The answer was refused, or the caller is not a team member
404Run not found
409The run is not waiting for these inputs, or its thread has ended
  • MCP Server – the full server offers runs as startElliotRun, getElliotRun and answerElliotApprovals; the directory versions leave them out
  • Scripts – many calls in one request, without Elliot