Query the list of agent task templates

Query the agent task templates in the workspace and filter by associated agent, status or name.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-task-templates

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. Prepare a personal access token and workspace ID that can access the target workspace.

Request parameters

Shell
curl "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-task-templates?limit=20&offset=0" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameter

Type

Required

Description

workspace_id

string

Yes

Target workspace ID.

Query parameters

Parameter

Type

Required

Description

agent_id

string

No

Associated agent ID.

status

string

No

Template status.

query

string

No

Filter by template name or description.

limit

integer

No

Return the quantity.

offset

integer

No

Return to starting position.

Successful response

JSON
{
  "code": 0,
  "data": {
    "items": [
      {
        "id": "template_01",
        "workspace_id": "workspace_example",
        "agent_id": "agent_01",
        "name": "摘要任务",
        "message_template": {
          "role": "user",
          "template": "请总结输入内容"
        },
        "idempotency_policy": {
          "mode": "workflow_case"
        },
        "status": "draft",
        "version": 1,
        "created_at": "2026-10-14T00:00:00Z",
        "updated_at": "2026-10-14T00:00:00Z"
      }
    ],
    "total": 1,
    "limit": 20,
    "offset": 0
  }
}

Field

Type

Description

code

integer

0 when the request is processed successfully.

data

object

response data.

data.items

array of object

The record returned this time.

data.items[].id

string

Object ID.

data.items[].workspace_id

string

The workspace ID to which it belongs.

data.items[].agent_id

string

The associated agent ID.

data.items[].name

string

Name.

data.items[].description

string

Description. Can be omitted if not set.

data.items[].message_template

object

Message template.

data.items[].input_schema

object

JSON Schema of the input parameters. Can be omitted if not set.

data.items[].default_context_refs

array of object

Default context resource reference. Can be omitted if not set.

data.items[].default_context_refs[].id

string

Object ID.

data.items[].runtime_policy_ref

string

Run policy reference. Can be omitted if not set.

data.items[].idempotency_policy

object

Idempotent strategy.

data.items[].idempotency_policy.mode

string

Strategy or scope pattern. Values: none, workflow_case, custom.

data.items[].idempotency_policy.key_template

string

Custom idempotent key template. Can be omitted if not set.

data.items[].idempotency_policy.window_seconds

integer

Idempotent window, in seconds. Can be omitted if not set.

data.items[].output_contract

object

Output convention. Can be omitted if not set.

data.items[].status

string

Current status. Values: draft, active, disabled, archived.

data.items[].version

integer

Current version number.

data.items[].labels

object

Tag key-value pairs. Can be omitted if not set.

data.items[].annotations

object

Extended annotations. Can be omitted if not set.

data.items[].created_by

string

Creator ID. Can be omitted if not set.

data.items[].updated_by

string

Last updated by identifier. Can be omitted if not set.

data.items[].created_at

string

Creation time, in RFC 3339 format.

data.items[].updated_at

string

Last updated in RFC 3339 format.

data.total

integer

The total number of records that meet the criteria.

data.limit

integer

The upper limit of the number of records used in this query.

data.offset

integer

The offset used in this query.

data.items[].message_template.role

string

Message role.

data.items[].message_template.template

string

Message template text. Can be omitted when using parts.

data.items[].message_template.parts

array or null

Structured messages are composed of items, and the content is retained by the template.

data.items[].message_template.variables

object or null

Template variables.

data.items[].default_context_refs[].type

string

Context resource type.

data.items[].default_context_refs[].uri

string

Resource address. Can be omitted when using id.

data.items[].default_context_refs[].version

string

Resource version. Omitted if not set.

data.items[].default_context_refs[].config

object or null

Resource allocation. Omitted if not set.

Error response

JSON
{
  "code": 2,
  "message": "invalid agent task template filter"
}

Common HTTP errors

HTTP status code

error code

Description

400

2

Common reasons: The filter or paging parameters are invalid. Recommended Action: Check the query parameters.

401

6

Common Cause: Valid identity credentials are missing. Recommended Action: Check the API Key.

Last updated on