Skip to main content
GET
/
tasks
/
{task_id}
JavaScript
import Client from 'agentlin';

const client = new Client({
  apiKey: 'My API Key',
});

const task = await client.tasks.retrieve('task_677efb5139a88190b512bc3fef8e535d');

console.log(task.id);
{
  "jsonrpc": "<string>",
  "id": "<string>",
  "result": {
    "object": "task",
    "id": "<string>",
    "session_id": "<string>",
    "user_id": "<string>",
    "status": "created",
    "created_at": 123,
    "output": [
      {
        "type": "reasoning",
        "id": "<string>",
        "summary": [
          {
            "type": "text",
            "text": "<string>",
            "id": 123,
            "tags": [
              "<string>"
            ],
            "annotations": [
              {
                "type": "file_citation",
                "file_id": "<string>",
                "index": 123,
                "filename": "<string>"
              }
            ],
            "logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ],
                "top_logprobs": [
                  {
                    "token": "<string>",
                    "logprob": 123,
                    "bytes": [
                      123
                    ]
                  }
                ]
              }
            ]
          }
        ],
        "content": [
          {
            "type": "text",
            "text": "<string>",
            "id": 123,
            "tags": [
              "<string>"
            ],
            "annotations": [
              {
                "type": "file_citation",
                "file_id": "<string>",
                "index": 123,
                "filename": "<string>"
              }
            ],
            "logprobs": [
              {
                "token": "<string>",
                "logprob": 123,
                "bytes": [
                  123
                ],
                "top_logprobs": [
                  {
                    "token": "<string>",
                    "logprob": 123,
                    "bytes": [
                      123
                    ]
                  }
                ]
              }
            ]
          }
        ],
        "status": "in_progress"
      }
    ],
    "usage": {},
    "error": {
      "code": 123,
      "message": "<string>",
      "data": {}
    },
    "input_required": {
      "type": "tool_call",
      "call_id": "<string>",
      "name": "<string>",
      "arguments": "<string>",
      "id": "<string>",
      "status": "in_progress",
      "language": "json"
    },
    "metadata": {},
    "previous_task_id": "<string>",
    "rollouts": [
      {}
    ]
  },
  "error": {
    "code": 123,
    "message": "<string>",
    "data": {}
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

task_id
string
required

The ID of the task to retrieve.

Example:

"task_677efb5139a88190b512bc3fef8e535d"

Response

200 - application/json

OK

Base JSON-RPC 2.0 message.

jsonrpc
string
required

JSON-RPC protocol version, always '2.0'.

Allowed value: "2.0"
id

请求/响应 ID,由客户端生成或服务器透传;可为字符串、整数或 null。

result
object

JSON-RPC result:任务对象。

error
object

JSON-RPC 错误对象(如失败时)。