DeleteAgentVersion
Deletes an agent version.
Operation description
Deletes a saved fixed version of a specified managed or custom agent. Versions that are still referenced by service endpoints cannot be deleted, and the system-maintained latest version cannot be deleted.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
agentcore:DeleteAgentVersion |
delete |
*Agent
|
None | None |
Request syntax
DELETE /workspaces/{workspaceId}/agents/{agentId}/versions/{agentVersion} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| workspaceId |
string |
Yes |
The ID of the AgentCore workspace where the agent resides. |
ws-0123456789abcdef01234 |
| agentId |
string |
Yes |
The ID of the managed or custom agent. |
agent-0123456789abcdef0123456789abcdef |
| agentVersion |
string |
Yes |
The system-generated version number, such as v1. This is the agentVersion returned by CreateAgentVersion or ListAgentVersions, not the versionName. |
v1 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| clientToken |
string |
No |
The client-generated idempotency token. This is a reserved parameter, and the backend does not currently provide persistent idempotency guarantees. |
c2d8a6f0-3b1e-4a7d-9f25-6e4b0c1a8d37 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| requestId |
string |
The request ID, which is used to locate and troubleshoot the request. |
5E8F3C2A-1B4D-4F6E-9A7C-0D2B8E6F4A1C |
| message |
string |
The response message. The value is success if the request is successful, or an error message if the request fails. |
success |
| httpStatusCode |
integer |
The HTTP status code. |
200 |
| code |
string |
The business status code. The value is SUCCESS if the request is successful, or an error code if the request fails. |
SUCCESS |
| success |
boolean |
Indicates whether the request is successful. |
Examples
Success response
JSON format
{
"requestId": "5E8F3C2A-1B4D-4F6E-9A7C-0D2B8E6F4A1C",
"message": "success",
"httpStatusCode": 200,
"code": "SUCCESS",
"success": false
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 404 | AgentVersionNotFound | The specified AgentVersion does not exist. | |
| 409 | AgentVersionInUseByEndpoint | The AgentVersion is still referenced by a ServiceEndpoint. | |
| 409 | AgentVersionDeleteConflict | The AgentVersion could not be deleted because it was changed concurrently. Try again later. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.