Cancel a humanization that has not yet started executing.
Eligibility. Only jobs with status=pending are cancelable.
Anything else — running, completed, failed, already
canceled — returns 409 conflict. In-flight cancel requires the
job queue migration (FastAPI BackgroundTasks has no stop hook) and
will ship in a later PR.
Credits. Cancel refunds the full submission cost to the organization’s subscription bucket — the pipeline never ran, so the customer isn’t charged.
Cross-resource scoping mirrors the fetch endpoint: a non-humanization
job id returns 404.
Cost: write — burns rate + quota. Does not debit credits.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Successful Response
Humanization job envelope — pipeline status + typed results.
Field layout matches the shared spec in docs/strategy/api-plan.md
so the next 5 resource-per-job-type endpoints can ship identical
envelopes and the Python SDK can define one Job base class.
Opaque humanization identifier (UUID).
"dddd1111-eeee-2222-ffff-333344445555"
Lifecycle state. pending → running → completed | failed. canceled is terminal and only reachable via POST /v1/humanizations/{id}/cancel on a still-pending job.
pending, running, completed, failed, canceled "pending"
ISO-8601 timestamp (UTC) when the job was submitted.
"2026-04-22T14:15:00+00:00"
Credits debited at submission for this job type.
1
Echo of the caller's submit body — useful for clients that don't cache.
Polymorphic discriminator. Always humanization on this endpoint.
"humanization"ISO-8601 timestamp when execution started. null while pending.
ISO-8601 timestamp when the job completed successfully. null otherwise.
ISO-8601 timestamp when the job failed. null unless status=failed. Synthesized from the underlying job's terminal timestamp — the DB does not carry a separate failed_at column.
ISO-8601 timestamp when the job was canceled via POST /v1/humanizations/{id}/cancel. null unless status=canceled.
Populated only when status=failed. Same shape as problem+json.
Per-strategy humanization outputs. null until status=completed; empty list is valid if the pipeline produced no viable strategies.