Get an invocation's result
GET/v1/ai/invoke/:invocation_identifier
This route allows you to get a specific invocation result.
To learn more about AI agents, check out the documentation.
Request
Parameters (JSON)
{
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"name": "invocation_identifier",
"required": true,
"description": "A unique identifier for the invocation."
}
]
}Request body schema (JSON)
{
"title": "Body"
}Responses
- 200
- 500
Default Response
Default Response
Responses (JSON)
{
"responses": {
"200": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"result": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"In Progress",
"Completed",
"Failed"
]
},
"message": {
"type": "string"
},
"error": {
"type": "string"
},
"invocationIdentifier": {
"type": "string"
},
"selectedAgent": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"user"
]
},
"messageId": {
"type": "string",
"description": "Stable identifier for this message. Use as message_id when submitting feedback."
},
"invocationId": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"role",
"messageId",
"content"
],
"additionalProperties": false,
"title": "User message"
},
{
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"assistant"
]
},
"messageId": {
"type": "string",
"description": "Stable identifier for this message. Use as message_id when submitting feedback."
},
"invocationId": {
"type": "string"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"text"
],
"description": "Content block type."
},
"text": {
"type": "string",
"description": "The text content of this block."
}
},
"required": [
"type",
"text"
],
"additionalProperties": false,
"title": "Text content"
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"reasoning"
],
"description": "Content block type."
},
"text": {
"type": "string",
"description": "The reasoning text content of this block."
},
"durationMs": {
"description": "How long the model spent reasoning for this block, in milliseconds.",
"type": "number"
}
},
"required": [
"type",
"text"
],
"additionalProperties": false,
"title": "Reasoning content"
}
]
}
}
]
},
"toolCalls": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {}
},
"approvalStatus": {
"type": "string",
"enum": [
"pending",
"approved",
"approved_with_edit",
"rejected"
]
},
"originalArguments": {
"type": "object",
"additionalProperties": {}
},
"requiresApproval": {
"type": "boolean"
},
"requiresUserInteraction": {
"description": "Whether this tool call requires the user to interact with it directly (beyond approval) before it can complete.",
"type": "boolean"
}
},
"required": [
"id",
"name",
"arguments"
],
"additionalProperties": false
}
},
"feedbackRating": {
"description": "User feedback rating stored on this assistant message, if any.",
"type": "string",
"enum": [
"positive",
"negative"
]
},
"feedbackComment": {
"description": "Optional free-text feedback comment on this assistant message.",
"type": "string"
},
"agentName": {
"description": "Name of the agent that produced this assistant message, when applicable.",
"type": "string"
}
},
"required": [
"role",
"messageId"
],
"additionalProperties": false,
"title": "Assistant message"
},
{
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"tool"
]
},
"messageId": {
"type": "string"
},
"invocationId": {
"type": "string"
},
"toolCallId": {
"type": "string"
},
"content": {
"type": "string"
},
"isError": {
"description": "Whether the tool call resulted in an error.",
"type": "boolean"
}
},
"required": [
"role",
"messageId",
"toolCallId",
"content"
],
"additionalProperties": false,
"title": "Tool message"
}
]
}
},
"pendingToolCalls": {
"type": "array",
"items": {
"type": "object",
"properties": {
"toolCallId": {
"type": "string"
},
"name": {
"type": "string"
},
"arguments": {
"type": "object",
"additionalProperties": {}
},
"requiresApproval": {
"type": "boolean"
}
},
"required": [
"toolCallId",
"name",
"arguments",
"requiresApproval"
],
"additionalProperties": false
}
},
"contextUsagePercent": {
"type": "number"
},
"conversationId": {
"type": "string"
},
"previousInvocationId": {
"nullable": true,
"type": "string"
}
},
"required": [
"status"
],
"additionalProperties": false
}
},
"required": [
"ok",
"result"
],
"additionalProperties": false
}
}
}
},
"500": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
},
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"details": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
}
}
}