Skip to content

Answer a call of one of the store's own tools

POST
/v1/pixel/turns/{turnId}/tool-results
curl --request POST \
--url https://api.pixonaut.app/v1/pixel/turns/example/tool-results \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "callId": "toolu_01A2b3C4d5E6f7G8h9I0j1K2", "output": { "permalink": "https://shop.acme.example/product/summer-mug", "productId": 4182 } }'

Operation ID: pixelTurns.toolResults.create

Posts what a tool the store declared answered, by the callId of its tool_call event, and carries the turn on as a new stream of the same events. While another call of the same pause is still unanswered, the stream ends paused at once. A call is answerable for five minutes; after that, or once answered, it is refused call_not_pending. A body past the api’s 1 MB ceiling is refused payload_too_large and leaves the call open, to be answered with an error.

turnId
required
string
>= 1 characters <= 64 characters
Media typeapplication/json
Any of:
object
callId
required

The tool_call event’s callId.

string
>= 1 characters
output
required

What the tool answered, any JSON value. Pixel reads a bounded part of a long one.

Examples

Exampleexample

Example

{
"callId": "toolu_01A2b3C4d5E6f7G8h9I0j1K2",
"output": {
"permalink": "https://shop.acme.example/product/summer-mug",
"productId": 4182
}
}

The turn’s events, one per PixelTurnEvent, until it ends or pauses again

Media typetext/event-stream
string
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: invalid_body

Media typeapplication/json
object
error
required
string

Examples

Exampleinvalid_body

invalid_body

{
"error": "invalid_body"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized, member_link_required, member_link_revoked

Media typeapplication/json
object
error
required
string

Examples

member_link_required

{
"error": "member_link_required"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: insufficient_credits. The tenant’s credits cannot cover this action, its spending cap has no room left for it, it is on the Free plan and Free workspaces together have reached the platform’s daily ceiling on credit spending (it resets at midnight UTC), a storefront’s customer asked and the tenant’s daily storefront ceiling has no room left, or the account that created the tenant has not confirmed its email address yet, so none of it was done. reason says which: balance, spending_cap, free_plan_ceiling, storefront_ceiling or email_unverified. requiredCredits, availableCredits and reason are left out for a publishable key.

Media typeapplication/json
object
availableCredits

Always sent with insufficient_credits.

number
error
required
string
reason

Always sent with insufficient_credits.

string
requiredCredits

Always sent with insufficient_credits.

number

Examples

insufficient_credits

{
"error": "insufficient_credits"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: origin_forbidden, forbidden, feature_disabled, workspace_suspended

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: call_not_pending

Media typeapplication/json
object
error
required
string

Examples

Examplecall_not_pending

call_not_pending

{
"error": "call_not_pending"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: payload_too_large

Media typeapplication/json
object
bytes
number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

Examplepayload_too_large

payload_too_large

{
"error": "payload_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: rate_limited

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors