Skip to main content

Archive an agent

Archive an agent so it is hidden from the default listing while remaining accessible by ID.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>

Path parameters

ParameterTypeRequiredDescription
agent_idstringYesUnique agent identifier.

Request body

No request body is required.

Example request

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

Example response

HTTP 200 OK
{
  "type": "agent",
  "id": "agent_019eXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "name": "doc-test-agent-updated",
  "description": "Used for API documentation testing",
  "model": "ultimate",
  "system": "You are the updated documentation testing assistant.",
  "instructions": "You are the updated documentation testing assistant.",
  "tools": [],
  "mcp_servers": [],
  "default_environment": "",
  "version": 2,
  "created_at": "2026-05-18T15:26:39.61669Z",
  "updated_at": "2026-05-18T15:27:22.698411Z"
}

Response fields

Returns the full agent object after archival. The updated_at field is refreshed to the time of the archive operation.
FieldTypeDescription
typestringAlways "agent".
idstringUnique agent identifier.
namestringAgent name.
descriptionstringAgent description.
modelstringModel identifier.
instructionsstringSystem prompt.
systemstringAlias of instructions. Deprecated; use instructions.
toolsarrayTool configuration.
mcp_serversarrayMCP server configuration.
default_environmentstringDefault runtime environment.
versionintegerCurrent version number.
created_atstringCreation time in ISO 8601.
updated_atstringLast update time in ISO 8601. Refreshed on archive.

Errors

HTTPTypeTrigger
401authentication_errorThe PAT is invalid or expired.
403permission_errorCaller lacks permission to archive this agent.
404not_found_errorNo agent exists with the given ID.
See Errors for the full error envelope.

Archive vs. delete

ActionEffectRecoverable
ArchiveThe agent is hidden from the default listing; data is retained.Yes (unarchive supported).
DeleteThe agent is permanently removed.No.

Notes

  • Archival is a soft delete; agent data remains in the system.
  • Archived agents are excluded from the default response of GET /v1/agents.
  • Archived agents are still retrievable via GET /v1/agents/{agent_id}.
  • The operation is idempotent; archiving an already-archived agent does not raise an error.