Skip to main content
POST
/
tasks
/
{task_id}
/
resume
JavaScript
import Client from 'agentlin_client';

const client = new Client({
  apiKey: process.env['AGENTLIN_API_KEY'], // This is the default and can be omitted
});

const taskObject = await client.tasks.resume('task_id');

console.log(taskObject.id);
{
  "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": [
    {}
  ]
}

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 resume

Response

Successful Response

The task object returned in JSON-RPC result.

object
enum<string>
required

固定为 task。

Available options:
task
id
string
required

任务 ID。

session_id
string
required

会话 ID。

user_id
string
required

用户 ID。

status
enum<string>
required

任务状态。

Available options:
created,
queued,
working,
input-required,
paused,
completed,
canceled,
expired,
failed
created_at
integer
required

任务创建时间(Unix 秒)。

output
OutputItem · object[]
required

模型/代理生成的输出条目集合(多类型)。

An output item produced by the agent/model.

usage
object

token 用量统计信息。

error
object

错误信息(失败时)。

input_required
object

若任务等待外部输入,则给出需要执行的工具调用(如等待用户参数)。

metadata
object

扩展元数据。

previous_task_id
string

前置任务 ID(用于续写/衔接)。

rollouts
object[]

任务推演/回溯事件集合(可选)。