Delete a session (refund unless analysis succeeded)
const url = 'http://localhost:8000/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url http://localhost:8000/api/sessions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/ \ --header 'Authorization: Bearer <token>'Removes the Session. Quota refund rule, by status at the moment of DELETE:
PENDING/PROCESSING— credits an offsettingsession_delete_refundentry so the slot is reused, unless the session already delivered a report at least once (processed_atset, i.e. it was re-analyzed after completing). A delivered analysis keeps its slot however the session later leavesCOMPLETED; otherwiseanalyze → reanalyze → deletewould be the free-session loop below with one extra hop.FAILED— normally already refunded at failure time (session_failed_refund), so the DELETE is a ledger no-op. A session’s debit is credited back at most once, whatever the reason, so a failed-then-deleted session returns one slot, not two.COMPLETED— no refund. The pipeline ran and the team consumed compute. Refunding here would makecreate → analyze → deletea free-session loop.
Idempotent under concurrent DELETEs — the row lock serialises racing requests. The annotated mp4 in storage is NOT eagerly removed; it gets garbage-collected by the team-wide sweep. Returns 204. Demo sessions and other teams’ sessions return 404.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”No response body
object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examplegenerated
{ "detail": "example"}object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Examples
Absent, or owned by another team (collapsed to 404)
{ "detail": "session_not_found"}