Skip to main content
DELETE
/
api
/
v2
/
sessions
/
{id}
Cancel a session
curl --request DELETE \
  --url https://agp.eu.hcompany.ai/api/v2/sessions/{id} \
  --header 'Authorization: Bearer <token>'
Cancels a session that is still active. The agent is stopped and the session transitions to interrupted status. This is irreversible: use pause if you want to resume later. Returns 204 No Content on success.

Path parameters

id
string
required
The session ID to cancel.

Examples

curl -X DELETE https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID \
  -H "Authorization: Bearer $H_API_KEY"

When to cancel vs. pause

ActionEffectCan resume?Frees quota?
Cancel (DELETE)Stops the agent, terminal stateNoYes
Pause (POST /pause)Halts the agent, preserves stateYesNo
Use cancel when:
  • The task is no longer needed
  • You want to free a concurrency slot immediately
  • The agent is stuck or producing unhelpful output
Use pause when:
  • You want to review progress before continuing
  • You need to provide input later but not right now

Errors

StatusCause
404Session not found, or you don’t have access.