Skip to content

Archive a Session idempotently

DELETE
/v1/sessions/{sessionId}
curl --request DELETE \
--url https://example.com/v1/sessions/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731 \
--header 'Authorization: Bearer <token>'

Requires wamp.cloud.sessions:archive. Archiving is the terminal state, not a delete: the Session leaves listings and refuses new Turns, its sandbox lease is released and every open Interaction is expired, while events, turns, artifacts and publications stay readable by id. It is idempotent — archiving an already archived Session is 204 again — but it is not a force stop: an in-flight Run is 409 cloud_run_in_progress (retry after cancelling it), an unfinished publication is 409 cloud_publication_in_progress, and a checkpoint still being captured is 409 cloud_session_finalizing. The retryable ones carry Retry-After.

sessionId
required

A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.

string format: uuid
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731

A UUID you mint and own; it is the idempotency key for creation and the address of every Turn, artifact and publication underneath

Archived or already archived

The resource is missing or inaccessible

Media typeapplication/json

Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.

object
error
required

Stable machine code

string
requiredScope

The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request

string
retryAfterSeconds

Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value

integer
>= 1
key
additional properties
any
Example
{
"error": "cloud_session_not_found"
}

Idempotency, lifecycle, revision or single-flight conflict

Media typeapplication/json

Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.

object
error
required

Stable machine code

string
requiredScope

The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request

string
retryAfterSeconds

Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value

integer
>= 1
key
additional properties
any
Example
{
"error": "cloud_session_conflict"
}