> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Clear message queue

> <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>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json delete /api/apps/{app_id}/chat/queue
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/chat/queue:
    delete:
      summary: Clear message queue
      description: >-
        <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>
      operationId: clear_queue_api_api_apps__app_id__chat_queue_delete
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app whose message queue this request acts on.
            title: App Id
          description: ID of the app whose message queue this request acts on.
          example: 6820f3a4e7b91d003c45a1f2
        - name: keep_pr_watch
          in: query
          required: false
          schema:
            type: string
            description: >-
              `true` keeps queued PR Watch runs. If any remain, the queue keeps
              its pause.
            default: 'false'
            title: Keep Pr Watch
          description: >-
            `true` keeps queued PR Watch runs. If any remain, the queue keeps
            its pause.
        - name: keep_sent
          in: query
          required: false
          schema:
            type: string
            description: >-
              `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.
            default: 'false'
            title: Keep Sent
          description: >-
            `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.
        - name: branch_id
          in: query
          required: false
          schema:
            type: string
            description: >-
              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.
            title: Branch Id
          description: >-
            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.
          example: 68f1a2b3c4d5e6f708192a3b
      responses:
        '200':
          description: >-
            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.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageQueue'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            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':
          description: App not found, or no branch you can see has this `branch_id`.
        '409':
          description: >-
            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':
          description: '`keep_pr_watch` or `keep_sent` is not `true` or `false`.'
        '429':
          description: >-
            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.
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    MessageQueue:
      properties:
        items:
          items:
            $ref: '#/components/schemas/QueuedMessage'
          type: array
          title: Items
          description: The queued messages, next to run first. Holds at most 7.
          example:
            - branch_id: 68f1a2b3c4d5e6f708192a3b
              content: Add a contact form to the home page
              created_at: '2026-10-05T14:30:00.123456+00:00'
              id: 3b9d2f6e-8c41-4a7e-9f05-1d2c3b4a5e6f
        is_paused:
          type: boolean
          title: Is Paused
          description: Whether the queue is paused. While it is, queued messages don't run.
          example: false
      type: object
      required:
        - items
        - is_paused
      title: MessageQueue
      description: The messages waiting to run, in the order they run.
    QueuedMessage:
      properties:
        id:
          type: string
          title: Id
          description: ID of the queued message.
          example: 3b9d2f6e-8c41-4a7e-9f05-1d2c3b4a5e6f
        content:
          type: string
          title: Content
          description: Text of the message, as it will be sent to the AI.
          example: Add a contact form to the home page
        branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Id
          description: >-
            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`.
          example: 68f1a2b3c4d5e6f708192a3b
        created_at:
          type: string
          title: Created At
          description: When the message was queued, as a UTC timestamp in ISO 8601 format.
          example: '2026-10-05T14:30:00.123456+00:00'
      type: object
      required:
        - id
        - content
        - branch_id
        - created_at
      title: QueuedMessage
      description: A message waiting for the AI to finish its current turn.
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.