---
title: "Post Agent Chat"
method: POST
path: "/agent/chat"
tags: ["Agents"]
---

# Post Agent Chat

`POST /agent/chat`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/agent/chat`
- Auth: HTTP bearer

Say something to the agent and get its answer.

`kind` in the answer says which way the turn went: `chat` is a reply in
`message`; `work_item` means the agent read the message as a job and
STARTED it - `work_item_id` is the work item, and whether its workflow
actually launched is in `workflow_started`.

Each turn runs a model and is charged. Omit `session_id` to start a new
session.

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- AgentChatRequest: Mirror of `agent_runtime.interfaces.routers.chat_router.ChatRequest`.
  - `message` string: What you say to the agent. Required unless you attach a file.
  - `session_id` string, uuid, nullable: Continue this session. Omit to start a new one; the answer carries its `session_id`.
  - `client_turn_id` string, uuid, nullable: Your own id for this turn, so a retry is recognised as the same turn rather than said twice. Needs an existing `session_id`.
  - `attachment_ids` string[]: Uploaded file ids to attach, each at most once.
  - `subject_account_id` string, nullable: Bind a NEW session to this account. Ignored for an existing one.
  - `subject_campaign_id` string, nullable: Bind a NEW session to this campaign. Ignored for an existing one.
  - `mode` string, nullable: Bias the agent: `web_search`, `deep_thinking` or `research`. Left open, as the app leaves it: an unknown mode is ignored rather than refused.
  - `mentions` object[], nullable: @-mentions from `POST /agent/mention-search`, passed through as returned (`id`, `category`, `display_name`, ...).
  - `page` string, nullable: Where the user is in your product, so 'this' and 'here' resolve.

## Response `200`

Successful Response

- ApiResponseAgentConversationPayload
  - `data` AgentConversationPayload, required: An open envelope for the app's answer. Open because the chat answer (`kind`, `message`, `chips`, `sources`, `work_item_id`, ...) and the oversight feed (`approvals`, `blockers`, `autonomous_fixes`, `states`, `bounds`) are both still growing, and a dropped field on an agent surface is one the caller does not know they lost.
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/89fc11143b70?raw)
