---
title: "Enqueue a background task"
method: POST
path: "/api/queue/{project_id}/enqueue"
tags: ["Queue"]
---

# Enqueue a background task

`POST /api/queue/{project_id}/enqueue`

## Request

- Base URL: `https://core.blink.new`
- URL: `https://core.blink.new/api/queue/{project_id}/enqueue`
- Auth: HTTP bearer

Dispatch a background task to the project's Blink Backend handler (`POST /api/queue`). Use `options.queue` for named FIFO queues with parallelism control. Billed at 0.001 credits per enqueue. Requires Pro+ plan.

## Path parameters

- `project_id` string, required

## Request body

- object
  - `taskName` string, required: Task identifier matched against your handler's routing logic.
  - `payload` object: Arbitrary JSON passed to the handler
  - `options` object
    - `queue` string: Named queue for FIFO delivery with parallelism control
    - `delay` string: Delay before delivery (e.g. "5m", "1h", "30s")
    - `retries` integer: Max retry attempts on handler failure
    - `timeout` string: Handler execution timeout (e.g. "30s")

## Response `201`

Task enqueued

- object
  - `taskId` string
  - `status` string
  - `messageId` string, nullable

## Other responses

- `400`: Missing or invalid taskName
- `401`: Authentication required or invalid API key
- `402`: Insufficient credits
- `403`: Pro+ plan required

---

[API](https://skmtc.dev/blink/apis/blink-apis.md) - [All operations](https://skmtc.dev/blink/apis/blink-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/blink/apis/blink-apis/revisions/4c59c706078e?raw)
