---
title: "Add companion chat messages"
method: POST
path: "/reader/books/{book_id}/companion/chat"
tags: ["AI"]
---

# Add companion chat messages

`POST /reader/books/{book_id}/companion/chat`

## Request

- Base URL: `https://localhost:9527`
- URL: `https://localhost:9527/reader/books/{book_id}/companion/chat`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/lxpio/apis/omnigram-api/docs/reader/books/:book_id/companion/chat/post.ts> (a function with typed inputs; its response is checked against the schema)

Bulk add companion chat messages (client → server sync)

## Path parameters

- `book_id` string, required

## Request body

- SchemaCompanionChat[]
  - `book_id` string
  - `cfi` string
  - `chapter` string
  - `content` string
  - `ctime` integer
  - `id` integer
  - `role` string
  - `user_id` integer

## Response `200`

OK

- object

## Other responses

- `400`: Bad Request

## Changes

- **2026-04-23** `20e19d9cbb5a`: 1 info
  - endpoint added
- **2026-03-21** `ffed97aaec4f`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/lxpio/apis/omnigram-api/changes/reader/books/:book_id/companion/chat/post.md)

---

[API](https://skmtc.dev/lxpio/apis/omnigram-api.md) - [All operations](https://skmtc.dev/lxpio/apis/omnigram-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lxpio/apis/omnigram-api/revisions/58911ffb3093?raw)
