Skip to main content
POST
/
api
/
enrichment
/
{id}
/
cancel
Cancel Enrichment
curl --request POST \
  --url https://app.puffle.ai/api/enrichment/{id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "run": {
    "id": "<string>",
    "status": "cancelled",
    "cancelledAt": "<string>"
  }
}
CLI:
puffle enrichment cancel --id <id>

Overview

Marks an in-flight Enrichment as cancelled and stops pending items from being picked up. Items already executing continue to completion — cancellation is best-effort, not a hard kill. Returns { run: { id, status: "cancelled", cancelledAt } } on success.

Allowed states

Only pending and running work can be cancelled. Anything else returns 409 with a reason discriminator:
  • run_not_cancellable — the Enrichment is already completed, failed, or cancelled.
  • run_status_changed — status changed between read and write (e.g. completed while you were cancelling). Re-check status with Enrichment status.
See also: Enrich leads · Enrichment status.

AI agent notes

Cancellation does not refund credits that were already deducted at dispatch. Use this when the goal is to stop further work, not to undo billing.
Side effects:
  • The execution row is updated with status: "cancelled", cancelled_at, and completed_at set to the same timestamp.
  • All pending items are bulk-updated to status: "skipped" with skipped_reason: "run_cancelled".
  • Items already running are left alone; they complete or fail naturally.
On 404: the Enrichment does not exist for the effective user.On 409: check the reason discriminator. If run_status_changed, re-fetch with Enrichment status — the Enrichment may already have finished.A second call after success returns 409 with run_not_cancellable; treat that as idempotent success.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required
Minimum string length: 1

Response

Enrichment cancelled.

run
object
required

Minimal Enrichment Run projection returned by the cancel endpoint.