Cancel Team Run

Team storage and identity

Use the database-backed example Team server. Keep the Team run's returned run_id and session_id; a nested member run is not interchangeable with the Team run. Stored run, checkpoint and session operations require the configured database.

JWT user isolation is opt-in; non-admin service-account PAT callers always self-scope. Scoped callers need their own matching Team session and run, while configured resource authorization also applies. Run and checkpoint lookups return 404 for inaccessible or mismatched records. For factories, retain any factory_input needed by endpoints that reconstruct the Team.

Request cancellation

Use saved identifiers from the linked server:

RUN_ID="returned-run-id"
SESSION_ID="returned-session-id"
curl --fail-with-body -X POST --get \
  "http://127.0.0.1:7777/teams/reference-team/runs/$RUN_ID/cancel" \
  -H "Authorization: Bearer $OS_SECURITY_KEY" \
  --data-urlencode "session_id=$SESSION_ID"

Scoped callers require the session ID. 200 with {} acknowledges cancellation intent; poll Get Team Run for terminal state. An unscoped caller can receive this acknowledgement for an unknown run. It does not undo external effects or prove execution already stopped.

POST/teams/{team_id}/runs/{run_id}/cancel

Cancel a currently executing team run. This will attempt to stop the team's execution gracefully.

Note: Cancellation may not be immediate for all operations.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

team_id*Team Id
run_id*Run Id

Query Parameters

session_id?|

Session ID the run belongs to. Required for non-admin JWT users.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl --request POST 'https://example.com/teams/string/runs/string/cancel'
null