Cancel an import
Cancel an import that has not finished. A worker already mid-extraction observes the cancellation at its next checkpoint, so the job may run a little longer before it stops.
Cancel an import that has not finished. A worker already mid-extraction observes the cancellation at its next checkpoint, so the job may run a little longer before it stops.
Authorization
bearerAuth A Clerk session JWT. Obtain one with a Clerk frontend SDK
(session.getToken()) or, for server-to-server use, with a Clerk
machine token. The token's sub claim is the Flambe user id that scopes
every request.
In: header
Path Parameters
Import identifier.
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/imports/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "user_id": "string", "type": "web", "status": "pending", "url": "http://example.com", "file_id": "string", "file_ids": [ "1c0f12fe-c5bf-4fbd-ba1b-466cb232eca5" ], "text_file_id": "f6dba989-8fc3-4ab0-b9d1-49bdefc7e954", "source_url": "http://example.com", "source_section": "string", "recipe_id": "fa7d15d4-7670-4586-a94b-5079ed028135", "batch_id": "4da22c97-b7d5-4e31-8c3a-03870ebc7b20", "error": "string", "progress": { "stage": "extracting", "percent": 0 }, "processing_started_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Rename a household PATCH
Previous Page
Start an import POST
Creates an import job and enqueues it. Returns `201` immediately with a record whose `status` is `pending` — extraction happens asynchronously on a worker, and takes anywhere from a few seconds to a couple of minutes depending on the source. Which fields are required depends on `type`: | `type` | Required | Notes | | --- | --- | --- | | `web` | `url` | Must be `https`. Recipe sites, Instagram, YouTube, TikTok. | | `media` | `file_ids` | Upload images first with `POST /api/files`. | | `text` | `text` or `text_file_id` | `text` must be at least 3 characters. | | `image_batch` | `file_ids` | Fans out into one child import per image. | Track the job by polling `GET /api/imports/{id}` or by subscribing to `GET /api/events/stream`. When `status` becomes `completed`, `recipe_id` points at the created recipe.