AimableDocs
DocsAPI Reference
GET/v1/spaces/{space_id}/skills/executions/by-chat-tool-call/{tool_call_id}

Get Execution By Chat Tool Call Route

Look up the execution a chat tool_call dispatched, BEFORE it finishes. The chat dispatcher sets ``chat_tool_call_id`` on the skill_execution row at creation time; this endpoint lets the UI resolve the execution id from the tool_call_id (returned by the assistant-ui stream) while the skill is still running, so the chat card can subscribe to the SSE event stream live instead of waiting for the tool-result payload. Returns 404 if the chat tool call doesn't (yet) have an execution — the caller is expected to poll briefly until one appears.

Path Parameters

NameTypeRequiredDescription
space_idstring (uuid)Required
tool_call_idstringRequired

Headers

NameTypeRequiredDescription
X-API-KeystringOptional

Request

curl -X GET '/api-proxy/v1/spaces/{space_id}/skills/executions/by-chat-tool-call/{tool_call_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN>'

Response

200(generated)
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
    "space_id": "550e8400-e29b-41d4-a716-446655440000",
    "principal_id": "550e8400-e29b-41d4-a716-446655440000",
    "skill_slug": "string",
    "skill_version": {},
    "source": "standalone",
    "state": "queued",
    "parent_execution_id": {},
    "created_at": "2024-01-01T00:00:00Z",
    "started_at": {},
    "finished_at": {},
    "failure_reason": {},
    "resource_usage": {
      "input_tokens": 0,
      "output_tokens": 0,
      "cost_usd": "string",
      "wallclock_ms": {},
      "iteration_count": 0
    },
    "inputs": {},
    "outputs": {},
    "error": {},
    "artifacts": [
      {
        "artifact_id": "550e8400-e29b-41d4-a716-446655440000",
        "relpath_in_workspace": {},
        "document_type": {},
        "download_url": "string",
        "size_bytes": {}
      }
    ],
    "sub_executions": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "tenant_id": "550e8400-e29b-41d4-a716-446655440000",
        "space_id": "550e8400-e29b-41d4-a716-446655440000",
        "principal_id": "550e8400-e29b-41d4-a716-446655440000",
        "skill_slug": "string",
        "skill_version": {},
        "source": "standalone",
        "state": "queued",
        "parent_execution_id": {},
        "created_at": "2024-01-01T00:00:00Z",
        "started_at": {},
        "finished_at": {},
        "failure_reason": {},
        "resource_usage": {
          "input_tokens": 0,
          "output_tokens": 0,
          "cost_usd": "string",
          "wallclock_ms": {},
          "iteration_count": 0
        }
      }
    ],
    "chat_thread_id": {},
    "chat_message_id": {},
    "chat_tool_call_id": {},
    "workspace_archive_id": {},
    "langfuse_trace_id": {},
    "idempotency_key": {}
  }
}

Error Responses