---
orphan: true
---

# Query the details of the agent task template

Query the complete configuration of an agent task template.

```text
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-task-templates/{template_id}
```

## Before you call

Prepare personal access token, workspace ID, and template ID.

The example below uses:

- `$AI_STUDIO_API_KEY`: Actual personal access token.
- `$WORKSPACE_ID`: Target workspace ID.
- `$TEMPLATE_ID`: Template ID obtained from the template list.

## Request example

```bash
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-task-templates/$TEMPLATE_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

## Path parameters

| Parameters | Type | Is it required | Description |
| --- | --- | --- | --- |
| `workspace_id` | string | Yes | The target workspace ID. |
| `template_id` | string | Yes | The template ID to be queried. |

## Successful response

Returns `200` and template configuration on success.

```json
{
  "code": 0,
  "data": {"id": "template_01", "agent_id": "agent_01", "name": "摘要任务", "message_template": {}}
}
```

The response fields are as follows.

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | `0` on success. |
| `data.id` | string | Template ID. |
| `data.agent_id` | string | Associated agent ID. |
| `data.name` | string | Template name. |
| `data.message_template` | object | Task message template. |

## Error response

```json
{"code": 5, "message": "agent task template not found"}
```

### Common HTTP errors

```{list-table}
:header-rows: 1

* - HTTP status code
  - error code
  - Common causes
  - Recommended actions
* - `404`
  - `5`
  - The template does not exist or is not readable by the current identity.
  - Check template ID and workspace.
```

## Follow-up operations

When you need to modify the configuration, use `data.id` [Update agent task template](update-task-template.md).
