Skip to main content
POST
Requires version 2.0.1 or later of the Archetype platform.

Overview

This endpoint cancels a session that is pending or running, stops its work, and returns the session. The deployment and its other sessions are not affected. For a serving session, the answer can take up to 15 seconds while its in-flight work winds down. The cancel stands even if that cannot be confirmed. cancelled is a terminal status.
A cancelled session cannot be resumed or restarted. To run the same input again, open a new session with Create Session.

Request

string
required
Session ses_ id.

Response

Returns 200 OK with the cancelled session, with the same fields as Get Session returns. Its status is cancelled and completed_at is set.

Important Notes

  • A 409 means the session has already ended as completed, failed, or cancelled.
  • A 403 means you can see the session’s project but cannot modify it.
  • A 404 means the session does not exist, belongs to another organization, or is in a project you cannot see.
  • Stopping a deployment cancels every session on it that has not ended.