Skip to content

Cancel a lab execution

POST https://rest.haasapi.com/v1/labs/{lab_id}/cancel

Cancels the lab’s queued or running execution. Idempotent by shape: cancelled: false means there was nothing to cancel - a no-op, not an error. Partial results of the cancelled execution are kept.

Requires the labs scope.

Terminal window
curl "https://rest.haasapi.com/v1/labs/{lab_id}/cancel" \
-X POST \
-H "Authorization: Bearer hk_live_YOUR_KEY" \
--data ""

200 OK. Returns a LabCancelled.

{
"lab_id": "2f4f0f8a9df646c78be7a2a9f6d5b1c3",
"cancelled": true
}
Field Type Description
lab_id string The lab the cancel addressed.
cancelled boolean true - a queued or running execution was cancelled; false - there was nothing to cancel (already finished, cancelled or never started). A no-op, not an error.

All errors are RFC 9457 problem documents.

Status Description
400 The request is malformed (invalid limit, unusable cursor, …). (code: invalid_request)
401 Missing, malformed, disabled, or revoked API key. (code: invalid_api_key)
404 No accessible lab with that id. (code: lab_not_found)
409 A request with this Idempotency-Key is still being processed. (code: idempotency_in_progress)
422 The Idempotency-Key was already used with a different request. (code: idempotency_key_reuse)
500 An unexpected error inside the API. Nothing about the request caused it; retry, and quote the instance value if it persists. (code: internal_error)
502 An internal service answered in a way the API could not serve. Retry. (code: upstream_error)
503 The request could not be served right now. Retry with the same key - do not discard it. (code: temporarily_unavailable)
504 An internal service did not answer within the deadline. Retry with backoff. (code: upstream_timeout)
{
"type": "https://docs.haasapi.com/errors/invalid_request",
"title": "Invalid request",
"status": 400,
"detail": "The request is malformed (invalid limit, unusable cursor, …).",
"code": "invalid_request"
}