---
title: "Queue Pending Message"
method: POST
path: "/api/chat/sessions/{session_id}/messages/pending"
tags: ["v2", "chat", "chat"]
---

# Queue Pending Message

`POST /api/chat/sessions/{session_id}/messages/pending`

Queue a follow-up message while the session has an active turn.

## Path parameters

- `session_id` string, required

## Request body

- QueuePendingMessageRequest — Request model for queueing a follow-up while a turn is running.
  - `message` string, required
  - `context` object, nullable
  - `file_ids` string[], nullable

## Response `200`

Successful Response

- QueuePendingMessageResponse — Response returned when a message is queued because the session already has a turn in flight. - ``buffer_length``: how many messages are now in the session's pending buffer (after this push) - ``max_buffer_length``: the per-session cap (server-side constant) - ``turn_in_flight``: ``True`` if a copilot turn was running when we checked — purely informational for UX feedback.
  - `buffer_length` integer, required
  - `max_buffer_length` integer, required
  - `turn_in_flight` boolean, required

## Other responses

- `401` — Authentication required
- `404` — Session not found or access denied
- `409` — Session has no active turn to receive pending messages
- `422` — Validation Error
- `429` — Call-frequency cap exceeded
- `503` — Chat service degraded (Redis unavailable); client should honour the Retry-After header before retrying.

---

[API](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server.md) · [All operations](https://skmtc.net/significant-gravitas/apis/autogpt-agent-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/significant-gravitas/autogpt-agent-server/revisions/382041c7ecb2/schema)
