---
title: "Clear message queue"
method: DELETE
path: "/api/apps/{app_id}/chat/queue"
---

# Clear message queue

`DELETE /api/apps/{app_id}/chat/queue`

## Request

- Base URL: `https://app.base44.com`
- URL: `https://app.base44.com/api/apps/{app_id}/chat/queue`
- Auth: HTTP bearer

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Removes every queued message and lifts any pause, so the next message you send runs as soon as the AI is free. With `keep_pr_watch=true`, queued PR Watch runs stay in the queue, and if any remain the queue keeps its pause. The turn that's already running isn't affected. Stop it with [Stop generation](/api-reference/stop-generation).

A message that was just taken off the queue to run is cancelled too, if its turn hasn't started yet.

A collaborator in the editor can send a queued message into the turn that's running. While that's happening the message can't be changed or removed. Clearing the queue is refused until it finishes, unless you pass `keep_sent=true`.

With `keep_sent=true`, messages already sent into the chat stay in the queue and still run, even after the turn they were sent into ends, and the request is never refused for a message being sent. Until that behavior reaches your account, `keep_sent` has no effect and the clear works as without it.

This is limited to 60 requests per minute per app for each workspace's personal API keys, so every key in a workspace shares one allowance. Every endpoint that changes the queue shares it. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

## Path parameters

- `app_id` string, required: ID of the app whose message queue this request acts on.

## Query parameters

- `keep_pr_watch` string: `true` keeps queued PR Watch runs. If any remain, the queue keeps its pause.
- `keep_sent` string: `true` keeps messages already sent into the chat, which still run, and never refuses the clear with a 409. The response can then include them.
- `branch_id` string: ID of the branch to work on, as returned by [List branches](/api-reference/list-branches). Omit it to work on the app's main branch.

## Response `200`

The emptied, unpaused queue. With `keep_pr_watch=true`, any kept PR Watch runs remain and the queue keeps its pause. With `keep_sent=true`, messages already sent into the chat remain too.

- MessageQueue: The messages waiting to run, in the order they run.
  - `items` QueuedMessage[], required: The queued messages, next to run first. Holds at most 7.
    - `id` string, required: ID of the queued message.
    - `content` string, required: Text of the message, as it will be sent to the AI.
    - `branch_id` string, nullable, required: ID of the branch the message was queued on, or `null` for main. The API acts on main's queue, so this is normally `null`.
    - `created_at` string, required: When the message was queued, as a UTC timestamp in ISO 8601 format.
  - `is_paused` boolean, required: Whether the queue is paused. While it is, queued messages don't run.

## Other responses

- `401`: Missing or invalid credentials.
- `403`: You don't have editor access to this app, the app is blocked, you're a viewer in the app's workspace, your API key is read-only, or you used a workspace API key.
- `404`: App not found, or no branch you can see has this `branch_id`.
- `409`: A collaborator is sending a queued message into the turn that's running. Try again once it finishes. Not returned with `keep_sent=true`.
- `422`: `keep_pr_watch` or `keep_sent` is not `true` or `false`.
- `429`: Rate limit exceeded. The base limit is 60 requests per minute. See [Rate limits](/developers/references/apps-api/get-started/rate-limits) for the multiplier your plan gets.

## Changes

- **2026-10-21** `c23775445de2`: 1 breaking, 1 info
  - `query` request parameter `branch_id` list-of-types was narrowed by removing types `null`
  - for the `query` request parameter `branch_id`, the type was generalized from no type to `string`
- **2026-10-21** `721c47176351`: 1 info
  - added the new optional `query` request parameter `branch_id`
- **2026-10-20** `46196bdb8fca`: 1 info
  - added the new optional `query` request parameter `keep_sent`
- **2026-10-18** `7e1e1096475d`: 2 info
  - added the new optional `query` request parameter `keep_pr_watch`
  - added the non-success response with the status `422`
- **2026-10-11** `80287813ab84`: 1 info
  - the endpoint scheme security `PersonalAccessTokenAuth` was added to the API

[Operation history](https://skmtc.dev/base44/apis/base44-app-management-api/changes/api/apps/:app_id/chat/queue/delete.md)

---

[API](https://skmtc.dev/base44/apis/base44-app-management-api.md) - [All operations](https://skmtc.dev/base44/apis/base44-app-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/base44/apis/base44-app-management-api/revisions/c534f09cf314?raw)
