Answer a call of one of the store's own tools
const url = 'https://api.pixonaut.app/v1/pixel/turns/example/tool-results';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"callId":"toolu_01A2b3C4d5E6f7G8h9I0j1K2","output":{"permalink":"https://shop.acme.example/product/summer-mug","productId":4182}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The tool_call event’s callId.
What the tool answered, any JSON value. Pixel reads a bounded part of a long one.
object
The tool_call event’s callId.
object
Examples
Example
{ "callId": "toolu_01A2b3C4d5E6f7G8h9I0j1K2", "output": { "permalink": "https://shop.acme.example/product/summer-mug", "productId": 4182 }}Responses
Section titled “Responses”The turn’s events, one per PixelTurnEvent, until it ends or pauses again
Headers
Section titled “Headers”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
object
Examples
invalid_body
{ "error": "invalid_body"}Headers
Section titled “Headers”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
object
Examples
member_link_required
{ "error": "member_link_required"}member_link_revoked
{ "error": "member_link_revoked"}unauthorized
{ "error": "unauthorized"}Headers
Section titled “Headers”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.
object
Always sent with insufficient_credits.
Always sent with insufficient_credits.
Always sent with insufficient_credits.
Examples
insufficient_credits
{ "error": "insufficient_credits"}insufficient_credits (requiredCredits, availableCredits, reason)
{ "availableCredits": 0, "error": "insufficient_credits", "reason": "email_unverified", "requiredCredits": 0}Headers
Section titled “Headers”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
object
The feature the tenant does not have. Always sent with feature_disabled.
Examples
feature_disabled
{ "error": "feature_disabled", "feature": "api"}forbidden
{ "error": "forbidden"}origin_forbidden
{ "error": "origin_forbidden"}workspace_suspended
{ "error": "workspace_suspended"}Headers
Section titled “Headers”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
object
Examples
call_not_pending
{ "error": "call_not_pending"}Headers
Section titled “Headers”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
object
Always sent with payload_too_large.
Examples
payload_too_large
{ "error": "payload_too_large", "maxBytes": 0}Headers
Section titled “Headers”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
object
Examples
rate_limited
{ "error": "rate_limited"}Headers
Section titled “Headers”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
Examples
db_error
{ "error": "db_error"}Headers
Section titled “Headers”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].