Skip to content
Pile
Esc
↑↓navigate↵open⌘Jpreview

Create agent session stop

POST/workspaces/{organizationId}/agent/sessions/{sessionId}/stop
Path parameters
organizationIdstringrequired
sessionIdstringrequired
Request body
application/json
reasonstring
Responses
200

Session stopped

idstringrequired
organizationIdstringrequired
issueIdstringrequired
agentIdstringrequired
providerstringrequired
actorIdstringrequired
actorTypestringrequired
Allowed:useragent
statusstringrequired
Allowed:createdrunningstalewaitingcompletedfailedcanceled
resultstring | nullrequired
urlstring | nullrequired
providerSessionIdstring | nullrequired
prUrlstring | nullrequired
prStatestring | nullrequired
branchstring | nullrequired
purposestring | null
secondaryReposstring | null
maxDurationMinutesinteger | null
effortstring | null
Allowed:lowmediumhighmaxnull
labelstring | null
resultSchemaobject | null
structuredResultany | null
resultSchemaErrorsstring[] | null
createdAtstringrequired
updatedAtstringrequired
lastProgressAtstring | null
lastStateHashstring | null
awaitingActivityIdstring | null
awaitingEscalatedAtstring | null
pausednumber
stepKeystring | null
planobject[] | null
Show properties
Array of object
contentstringrequired
min length 1 · max length 500
statusstringrequired
Allowed:pendinginProgresscompletedcanceled
guidanceobject[] | null
Show properties
Array of object
idstringrequired
namestringrequired
scopestringrequired
Allowed:workspaceteamstatusstep
scopeKeystring | nullrequired
versionintegerrequired
derivedStatusstring | null
Allowed:stalledneeds_inputnull
receiptobject | null
Show properties
idstringrequired
organizationIdstringrequired
sessionIdstringrequired
issueIdstringrequired
agentIdstringrequired
stepKeystring | nullrequired
dealIdstring | nullrequired
statusstringrequired
modelstring | nullrequired
effortstring | nullrequired
inputTokensinteger | nullrequired
outputTokensinteger | nullrequired
totalTokensinteger | nullrequired
toolCallsinteger | nullrequired
costMicrosinteger | nullrequired
externalSpendMicrosinteger | nullrequired
totalCostMicrosinteger | nullrequired
costSourcestring | nullrequired
Allowed:reportedrate_mapnull
capExceededintegerrequired
stopReasonstring | nullrequired
startedAtstring | nullrequired
endedAtstring | nullrequired
durationMsinteger | nullrequired
createdAtstringrequired
updatedAtstringrequired
activitiesobject[]
Show properties
Array of object
idstringrequired
sessionIdstringrequired
actorIdstring | nullrequired
typestringrequired
Allowed:thoughtresponseerrorelicitationpromptactionstatusartifact
messagestringrequired
payloadany | null
parentIdstring | nullrequired
startedAtstring | nullrequired
endedAtstring | nullrequired
durationMsnumber | nullrequired
createdAtstringrequired
404

Session not found

Try it
Server
Parameters
Bodyapplication/json
Request
curl -X POST '/workspaces/string/agent/sessions/string/stop' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "reason": "string"
}'
Response
{
  "id": "string",
  "organizationId": "string",
  "issueId": "string",
  "agentId": "string",
  "provider": "string",
  "actorId": "string",
  "actorType": "user",
  "status": "created",
  "result": "string",
  "url": "string",
  "providerSessionId": "string",
  "prUrl": "string",
  "prState": "string",
  "branch": "string",
  "purpose": "string",
  "secondaryRepos": "string",
  "maxDurationMinutes": 0,
  "effort": "low",
  "label": "string",
  "resultSchema": {
    "property1": null,
    "property2": null
  },
  "structuredResult": null,
  "resultSchemaErrors": [
    "string"
  ],
  "createdAt": "string",
  "updatedAt": "string",
  "lastProgressAt": "string",
  "lastStateHash": "string",
  "awaitingActivityId": "string",
  "awaitingEscalatedAt": "string",
  "paused": 0,
  "stepKey": "string",
  "plan": [
    {
      "content": "string",
      "status": "pending"
    }
  ],
  "guidance": [
    {
      "id": "string",
      "name": "string",
      "scope": "workspace",
      "scopeKey": "string",
      "version": 0
    }
  ],
  "derivedStatus": "stalled",
  "receipt": {
    "id": "string",
    "organizationId": "string",
    "sessionId": "string",
    "issueId": "string",
    "agentId": "string",
    "stepKey": "string",
    "dealId": "string",
    "status": "string",
    "model": "string",
    "effort": "string",
    "inputTokens": 0,
    "outputTokens": 0,
    "totalTokens": 0,
    "toolCalls": 0,
    "costMicros": 0,
    "externalSpendMicros": 0,
    "totalCostMicros": 0,
    "costSource": "reported",
    "capExceeded": 0,
    "stopReason": "string",
    "startedAt": "string",
    "endedAt": "string",
    "durationMs": 0,
    "createdAt": "string",
    "updatedAt": "string"
  },
  "activities": [
    {
      "id": "string",
      "sessionId": "string",
      "actorId": "string",
      "type": "thought",
      "message": "string",
      "payload": null,
      "parentId": "string",
      "startedAt": "string",
      "endedAt": "string",
      "durationMs": 0,
      "createdAt": "string"
    }
  ]
}

Was this page helpful?