Requires baselines:write scope and admin or contributor role. This is a destructive write — the approved output becomes the new expected baseline for the regression test. Provide a reason; it is stored in the audit log.
Path parameters
-
Numeric run ID
Minimum value is
1. -
Numeric sample or regression result ID
Minimum value is
1.
Body
Required
-
Minimum value is
1. -
Minimum value is
1. -
Required justification stored in the audit log. Minimum 10 characters; do not accept placeholder values.
Minimum length is
10, maximum length is500. -
If true, apply this baseline to all command variants of the regression test, not just the specific output_id.
Default value is
false.
Responses
-
Baseline approval recorded. Status begins as pending_review.
-
Request body or query parameters failed schema validation
-
Missing, expired, or invalid bearer token
-
Token is valid but lacks the required scope or role
-
Resource not found
-
Too many requests. Retry after the indicated number of seconds.
-
Unexpected server error
curl \
--request POST 'https://sampleplatform.ccextractor.org/api/v1/runs/{run_id}/samples/{sample_id}/baseline-approval' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"regression_id":42,"output_id":42,"reason":"string","apply_to_variants":false}'
{
"regression_id": 42,
"output_id": 42,
"reason": "string",
"apply_to_variants": false
}
{
"approval_id": "string",
"status": "pending_review",
"run_id": 42,
"sample_id": 42,
"regression_id": 42,
"output_id": 42,
"requested_by": "hello@example.com",
"created_at": "2026-05-04T09:42:00Z"
}
{
"code": "validation_error",
"message": "Request failed schema validation.",
"details": {
"fields": {
"commit_sha": "Must match pattern ^[a-fA-F0-9]{40}$",
"platform": "Must be one of [linux, windows]"
}
}
}
{
"code": "unauthorized",
"message": "Bearer token is missing, expired, or invalid.",
"details": {}
}
{
"code": "forbidden",
"message": "Token does not have the required scope for this operation.",
"details": {
"required_scope": "runs:write",
"token_scopes": [
"runs:read",
"results:read"
]
}
}
{
"code": "not_found",
"message": "Run 9317 not found.",
"details": {
"resource": "run",
"id": 9317
}
}
{
"code": "rate_limited",
"message": "Rate limit exceeded. Retry after 30 seconds.",
"details": {
"retry_after": 30,
"limit": 120,
"window": "60s"
}
}
{
"code": "not_found",
"message": "Run 9317 not found.",
"details": {}
}