Runs ยท version 0.1.0
Retry a run from retained inputs
POST
/api/runs/{runId}/retryCreates a new run using the prior run's retained OpenAPI/config inputs. Returns 422 when Sourced no longer has the raw inputs needed to retry safely.
Request
curl -X POST 'https://sourced.sh/api/runs/{runId}/retry' \
-H 'Authorization: Bearer $SOURCED_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
const response = await fetch("https://sourced.sh/api/runs/{runId}/retry", {
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}/retry",
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
202
Retry run accepted.
application/json
type: object
required: project, sourceRun, run
properties:
project (required): Project
Project:
type: object
required: id, name, createdAt
properties:
id (required): string
name (required): string
apiName: string
mode: string enum flagship | stainless_compatible | custom | openapi | stainless_migration
New writes use `flagship` or `stainless_compatible`; legacy `custom`, `openapi`, and `stainless_migration` records may still be returned.
status: string enum created | active | archived
createdAt (required): string
updatedAt: string
runCount: integer
sourceRun (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
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
capabilities: object
401
402
403
404
422
The run cannot be retried because raw inputs were not retained.
application/json
Error:
type: object
required: error
properties:
error (required): string
Stable machine-readable error code.
message: string
Optional human-readable description.