Runs ยท version 0.1.0
Cancel a queued, running, or blocked run
POST
/api/runs/{runId}/cancelRequest
curl -X POST 'https://sourced.sh/api/runs/{runId}/cancel' \
-H 'Authorization: Bearer $SOURCED_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
const response = await fetch("https://sourced.sh/api/runs/{runId}/cancel", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SOURCED_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await response.json();
import os
import requests
response = requests.request(
"POST",
"https://sourced.sh/api/runs/{runId}/cancel",
headers={"Authorization": f"Bearer {os.environ['SOURCED_API_KEY']}"},
json={},
)
data = response.json()
Parameters
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
runId | string | Yes | Run identifier. |
Request body
application/json
type: object
properties:
reason: string
Responses
200
Canceled run.
application/json
type: object
required: run
properties:
run (required): Run
Run:
type: object
required: id, projectId, status, createdAt
properties:
id (required): string
orgId: string
projectId (required): string
createdByUserId: string
status (required): string enum queued | running | blocked | complete | ready | failed | expired | canceled
mode: string enum flagship | stainless_compatible | custom | openapi | stainless | stainless_migration | reference-sample
verdict: string enum queued | generated | ready | needs_review | not_ready | needs_worker | needs_setup | failed | canceled
createdAt (required): string
completedAt: string
steps: array
type: array
inputSummary: object
notes: string
currentStep: string
artifactManifest: ArtifactManifest
ArtifactManifest:
type: object
properties:
version: integer
runId: string
organizationId: string
projectId: string
quality: object
artifacts: array
expiresAt: string
updatedAt: string
401
403
404
409
Run status cannot be canceled.
application/json
Error:
type: object
required: error
properties:
error (required): string
Stable machine-readable error code.
message: string
Optional human-readable description.