Sessions

Cancel a session

Requests cancellation of a running session. The optional body selects the cancel mode: graceful (default, also used when the body is absent) stops the agent and tries to preserve the workspace with a final snapshot; hard stops immediately and relies on the last verified checkpoint. Sending hard while a graceful cancel is in progress upgrades it. Either way an explicitly cancelled Session ends suspended, never error. Returns whether the request newly flagged (or upgraded) the cancellation. Cancellation is asynchronous: requested: true means the stop is under way, and status is the Session's status after this request, so it is suspended when the Session had not started and still running while a running Session stops. Poll the Session until its status leaves running.

<sub>Scope: run</sub>

post/v3/organizations/{orgId}/sessions/{sessionId}/cancel

Request

  • Base URL: https://api.reasonmachines.com
  • URL: https://api.reasonmachines.com/v3/organizations/{orgId}/sessions/{sessionId}/cancel
  • Auth: HTTP bearer

Request body

mode'graceful' | 'hard'

graceful (default) stops the agent and tries to preserve the workspace with a final snapshot before the Session ends. hard stops immediately without waiting for a snapshot; the Session resumes from its last verified checkpoint. A later hard request upgrades an in-progress graceful cancel.

Response

Cancellation requested.

okboolean required

True when this request newly flagged, or upgraded, the cancellation.

requestedboolean required

True when cancellation is requested for the Session, by this or an earlier request. The Session may still be stopping.

statusstring required

Public Session status read after this request: suspended once the Session has stopped (at once for a Session that had not started), running while a running Session is still stopping.

mode'graceful' | 'hard' required

The cancel mode this request asked for.

Changes

No recorded changes to this operation across all 1 revision of this API.