List environment templates in the current workspace with cursor pagination.
Endpoint
GET /agents/environments/templates
Returns 200 and a list envelope.
Query parameters
| Field | Required | Type | Description |
|---|---|---|---|
limit | No | integer | Number of items per page, default 20; 1..100 is recommended |
order | No | string | Sort direction, asc or desc, defaults to desc |
after | No | string | The last_id from the previous page; the cursor item is excluded |
before | No | string | The first_id from the previous page, for reverse pagination; cannot be used with after |
after and before returns 400. An invalid cursor or a missing template returns 404.
Request example
Response example
Response fields
| Field | Type | Description |
|---|---|---|
object | string | List object type, fixed as list |
data | array | Environment templates on this page; [] when empty |
first_id | string / null | First item ID on this page; null for an empty page |
last_id | string / null | Last item ID on this page; null for an empty page; use it as after |
has_more | boolean | Whether the current scan direction has another page |
data[] contains id, object, name, created_at, updated_at, packages, network, desktop, capability_directories, skills, plugins, and files. Field meanings are the same as in Retrieve an environment template.
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
400 | invalid_request_error / invalid_request_error | Fix limit, order, after, or before as described in the query parameters |
401 | authentication_error / invalid_api_key | Send a valid Authorization: Bearer $DASHSCOPE_API_KEY header |
404 | not_found_error / not_found_error | Use a valid cursor in the current collection |
500 | server_error / server_error | Retry later. If it keeps failing, submit a ticket with x-request-id |