API documentation | API docs for agents | OpenAPI 3.1

POST /api/v1/agent-sessions/{sessionId}/stop

ark.stop_agent_session

Stops an active MCP or hosted-agent session for the connected user.

Availability
Expanded preview
Scopes
agents:write
ARK permissions
None
Team visibility
Not entity-scoped
Idempotency-Key
Required for this write
Approval
No MCP approval on REST API-token calls
Rate limit
API credential and organization budgets

Parameters

sessionIdpathstringrequired
format: uuid
Idempotency-Keyheaderstringrequired
Required for external write operations. Reuse the same key only for exact retries of the same request body.
min length: 1; max length: 200

Request body

reasonstring

min length: 1; max length: 1000

Example request

Shell
curl -X POST 'https://arktms.com/api/v1/agent-sessions/<sessionId>/stop' \
  -H "Authorization: Bearer $ARK_API_TOKEN" \
  -H "Idempotency-Key: <unique-key>" \
  -H "Content-Type: application/json" \
  -d '{}'

Success response

Stopped agent session

objectstringrequired
okbooleanrequired
api_versionstringrequired
request_idstringrequired
dataobjectrequired

Errors

HTTP 400
Invalid request
HTTP 401
Authentication required
HTTP 403
Permission, scope, team, or entitlement denied
HTTP 404
Resource not found
HTTP 409
Idempotency conflict or in-progress retry