Submit Client Tool Results (Callback)
const url = 'https://dashboard.quantcdn.io/api/v3/organizations/example/ai/chat/callback';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"callbackId":"Ab9hZXi/YXJuOmF3czpsYW1iZGE...","toolResults":[{"toolUseId":"toolu_bdrk_012KTC8NCG...","result":{"temperature":"24C","conditions":"Sunny"}}]}'};
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://dashboard.quantcdn.io/api/v3/organizations/example/ai/chat/callback \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "callbackId": "Ab9hZXi/YXJuOmF3czpsYW1iZGE...", "toolResults": [ { "toolUseId": "toolu_bdrk_012KTC8NCG...", "result": { "temperature": "24C", "conditions": "Sunny" } } ] }'Submit tool execution results to resume a suspended durable execution.
*
* When to use: When polling the execution status returns waiting_callback, use this endpoint
* to submit the results of client-executed tools. The execution will then resume.
*
* Flow:
* 1. Start async chat with client-executed tools (autoExecute: [] or tools not in autoExecute list)
* 2. Poll status until waiting_callback
* 3. Execute tools locally using pendingTools from status response
* 4. Submit results here with the callbackId
* 5. Poll status until complete
*
* Important: Each callbackId can only be used once. After submission, poll the execution
* status to see the updated state.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
The callbackId from the waiting_callback status response
Example
Ab9hZXi/YXJuOmF3czpsYW1iZGE...Results of client-executed tools
object
The toolUseId from pendingTools
Example
toolu_bdrk_012KTC8NCG...The result of executing the tool
object
Example
{ "temperature": "24C", "conditions": "Sunny"}Responses
Section titled “Responses”Callback submitted successfully, execution will resume
object
Echo of the callbackId for confirmation
Example
{ "success": true, "message": "Callback submitted successfully"}Invalid request (missing callbackId or toolResults)
Access denied
Callback not found or already processed
Failed to submit callback
