Create a new run copied from an existing run

POST /runs/{run_id}/retry

Creates a NEW run record with the same configuration as the source run. The original run and all its results are preserved. WARNING: Do NOT use the legacy restart_test route internally — it destructively deletes TestResult and TestProgress rows for the existing run_id. This endpoint always creates a new run_id. new_run_id in the response is the ID of the newly created run.

Path parameters

  • run_id integer Required

    Numeric run ID

    Minimum value is 1.

application/json

Body

  • failed_only boolean

    If true, only re-run regression tests that failed in the source run. If false (default), re-run the full test set.

    Default value is false.

  • reason string

    Maximum length is 255.

Responses

  • 202 application/json

    Retry run queued. new_run_id is the ID of the new run.

    Hide response attributes Show response attributes object
    • run_id integer Required

      ID of the source run (for cancel) or original run (for retry).

      Minimum value is 1.

    • new_run_id integer | null

      Set on retry actions only. ID of the newly created run. The original run is always preserved.

      Minimum value is 1.

    • action string Required

      Values are cancel or retry.

    • status string Required

      no_op is returned when canceling an already-terminal run.

      Values are accepted, rejected, or no_op.

    • message string

      Maximum length is 500.

  • 401 application/json

    Missing, expired, or invalid bearer token

    Hide response attributes Show response attributes object
    • code string Required

      Machine-readable error code (snake_case)

      Maximum length is 100.

    • message string Required

      Human-readable error summary

      Maximum length is 500.

    • details object Required

      Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available.

      Additional properties are allowed.

  • 403 application/json

    Token is valid but lacks the required scope or role

    Hide response attributes Show response attributes object
    • code string Required

      Machine-readable error code (snake_case)

      Maximum length is 100.

    • message string Required

      Human-readable error summary

      Maximum length is 500.

    • details object Required

      Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available.

      Additional properties are allowed.

  • 404 application/json

    Resource not found

    Hide response attributes Show response attributes object
    • code string Required

      Machine-readable error code (snake_case)

      Maximum length is 100.

    • message string Required

      Human-readable error summary

      Maximum length is 500.

    • details object Required

      Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available.

      Additional properties are allowed.

  • 422 application/json

    Request is valid JSON but semantically invalid

    Hide response attributes Show response attributes object
    • code string Required

      Machine-readable error code (snake_case)

      Maximum length is 100.

    • message string Required

      Human-readable error summary

      Maximum length is 500.

    • details object Required

      Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available.

      Additional properties are allowed.

  • 429 application/json

    Too many requests. Retry after the indicated number of seconds.

    Hide headers attributes Show headers attributes
    • Retry-After integer

      Seconds to wait before retrying

    • X-RateLimit-Limit

      Maximum requests allowed in the current window

    • X-RateLimit-Remaining

      Requests remaining in the current window

    • X-RateLimit-Reset

      Unix timestamp when the rate limit window resets

    Hide response attributes Show response attributes object
    • code string Required

      Machine-readable error code (snake_case)

      Maximum length is 100.

    • message string Required

      Human-readable error summary

      Maximum length is 500.

    • details object Required

      Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available.

      Additional properties are allowed.

  • default application/json

    Unexpected server error

    Hide response attributes Show response attributes object
    • code string Required

      Machine-readable error code (snake_case)

      Maximum length is 100.

    • message string Required

      Human-readable error summary

      Maximum length is 500.

    • details object Required

      Structured context for the error. Always an object, never null. Empty object {} when no additional detail is available.

      Additional properties are allowed.

POST /runs/{run_id}/retry
curl \
 --request POST 'https://sampleplatform.ccextractor.org/api/v1/runs/{run_id}/retry' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"failed_only":false,"reason":"string"}'
Request examples
{
  "failed_only": false,
  "reason": "string"
}
Response examples (202)
{
  "run_id": 42,
  "new_run_id": 42,
  "action": "cancel",
  "status": "accepted",
  "message": "string"
}
Response examples (401)
{
  "code": "unauthorized",
  "message": "Bearer token is missing, expired, or invalid.",
  "details": {}
}
Response examples (403)
{
  "code": "forbidden",
  "message": "Token does not have the required scope for this operation.",
  "details": {
    "required_scope": "runs:write",
    "token_scopes": [
      "runs:read",
      "results:read"
    ]
  }
}
Response examples (404)
{
  "code": "not_found",
  "message": "Run 9317 not found.",
  "details": {
    "resource": "run",
    "id": 9317
  }
}
Response examples (422)
{
  "code": "unprocessable",
  "message": "regression_test_ids contains inactive test IDs.",
  "details": {
    "inactive_ids": [
      42,
      99
    ]
  }
}
Response examples (429)
{
  "code": "rate_limited",
  "message": "Rate limit exceeded. Retry after 30 seconds.",
  "details": {
    "retry_after": 30,
    "limit": 120,
    "window": "60s"
  }
}
Response examples (default)
{
  "code": "not_found",
  "message": "Run 9317 not found.",
  "details": {}
}