Skip to main content

Delete an agent

Permanently delete an agent. This operation is irreversible.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>

Path parameters

ParameterTypeRequiredDescription
agent_idstringYesUnique agent identifier.

Request body

No request body is required.

Example request

curl -X DELETE "https://api.qoder.com.cn/api/v1/cloud/agents/agent_019eXXXX..." \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK
{
  "type": "agent",
  "id": "agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "deleted": true
}

Response fields

FieldTypeDescription
typestringAlways "agent".
idstringUnique identifier of the deleted agent.
deletedbooleanAlways true on success.

Errors

HTTPTypeTrigger
401TOKEN_INVALIDThe PAT is invalid, missing, or malformed.
403permission_errorCaller lacks permission to delete this agent. An admin role may be required.
404not_found_errorNo agent exists with the given ID, or it has already been deleted.
See Errors for the full error envelope.

Notes

  • Deletion is permanent and cannot be undone.
  • To temporarily disable an agent instead, use Archive an agent.
  • Deleting an already-archived agent is allowed.
  • Calling DELETE again on the same ID returns 404.
  • Some deployments require additional admin permissions (the x-gw-roles: admin header); insufficient permissions return 403.

Before deleting

  1. Confirm that the agent has no active sessions running.
  2. If you are not sure whether permanent deletion is needed, archive the agent first.
  3. Back up the agent configuration through the version history endpoint before deleting.