All Products
Search
Document Center

Qoder CN Series:Delete an agent

Last Updated:Jul 03, 2026

Permanently delete an agent. This operation is irreversible.

Request headers

Header

Required

Description

Authorization

Yes

Bearer <PAT>

Path parameters

Parameter

Type

Required

Description

agent_id

string

Yes

Unique 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

Field

Type

Description

type

string

Always "agent".

id

string

Unique identifier of the deleted agent.

deleted

boolean

Always true on success.

Errors

HTTP

Type

Trigger

401

authentication_error

The PAT is invalid or expired.

403

permission_error

Caller lacks permission to delete this agent. An admin role may be required.

404

not_found_error

No 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.