GET /v1/agents/{agent_id}/versions
Returns the version history of the specified Agent, sorted by version number in descending order (newest first).
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Agent unique identifier |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 20 | Items per page. Must be positive; values above 100 are capped at 100 |
after_id | string | No | - | Positive integer version cursor; returns older versions after this cursor in descending version order. Do not combine with before_id |
before_id | string | No | - | Positive integer version cursor; returns newer versions before this cursor in descending version order. Do not combine with after_id |
Example request
Example response
HTTP 200 OKResponse fields
| Field | Type | Description |
|---|---|---|
data | array of Agent version snapshot | Version snapshots on the current page |
first_id | string | Version identifier of the first record on this page |
last_id | string | Version identifier of the last record on this page |
has_more | boolean | Whether more versions remain |
Version history
- Creating an Agent stores version 1.
- Every successful
PUTon an Agent stores the next version. - Each version stores the full Agent snapshot at that point in time.
- Useful for auditing changes or reference during rollback.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | limit is not a positive integer |
| 400 | invalid_request_error | Both before_id and after_id were provided |
| 400 | invalid_request_error | before_id or after_id is not a positive integer version |
| 401 | authentication_error | PAT invalid or expired |
| 403 | permission_error | Not authorized for this Agent |
| 404 | not_found_error | Agent with the given ID does not exist |
Notes
- For this endpoint,
first_idandlast_idare the version numbers as strings (such as"1","2"). - Versions are sorted in descending order by default (latest first).
- Archiving an Agent does not create a new version snapshot.
- Combine with the OCC mechanism on
PUTto track configuration changes.
Related
Agent setup
Create a reusable, versioned agent configuration.