---
title: "Отправить сообщение в диалог"
method: POST
path: "/api/v1/crm/inbox/conversations/{id}/messages"
tags: ["CRM inbox"]
---

# Отправить сообщение в диалог

`POST /api/v1/crm/inbox/conversations/{id}/messages`

## Request

- Base URL: `https://erp.akeda.ru`
- URL: `https://erp.akeda.ru/api/v1/crm/inbox/conversations/{id}/messages`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://erp.akeda.ru/oauth2/authorize`, token URL `https://erp.akeda.ru/oauth2/token`, scopes: `akeda:delegate`)

Ответ 202 - сообщение принято в очередь доставки; окончательный статус приходит через переписку диалога.

## Request body

- CRMInboxSendInput
  - `body` string
  - `upload_ids` UUID[]: Идентификаторы заранее загруженных файлов: id из crmFinishInboxUploadSession (сессия загрузки) или из crmUploadInboxOutboundFile (форма)
  - `voice` object: Запись микрофоном: загрузка уходит клиенту голосовым сообщением, а не файлом
    - `upload_id` string, uuid, required
    - `duration_ms` integer: Длительность записи в миллисекундах

## Response `202`

Сообщение поставлено в очередь доставки

- CRMInboxMessage
  - `id` string, uuid, required
  - `conversation_id` string, uuid, required
  - `direction` 'inbound' | 'outbound' | 'system', required
  - `provider_message_id` string
  - `body` string, required
  - `status` 'queued' | 'received' | 'sent' | 'delivered' | 'failed', required
  - `sent_by` integer
  - `created_at` string, date-time, required
  - `attachment_count` integer: Сколько файлов у сообщения; список — GET /api/v1/crm/inbox/messages/{id}/attachments
  - `automation` boolean: Ответ поставил робот — правило автоматизации; в переписке он подписан «робот»
  - `attachments` CRMInboxMessageAttachment[]: Файлы сообщения: готовые вложения и файлы клиента, которые ещё скачиваются из канала
    - `id` string, uuid, required
    - `filename` string, required
    - `content_type` string, required
    - `size_bytes` integer, required
    - `media_kind` 'image' | 'video' | 'voice' | 'audio' | 'video_note' | 'file', required: Вид файла: фото показывается картинкой, голосовое — плеером
    - `duration_ms` integer: Длительность голосового, аудио или видео в миллисекундах
    - `state` 'ready' | 'pending' | 'too_large' | 'failed', required: ready — файл можно открыть; pending — скачивается из канала; too_large — больше предела, открыть можно только в канале; failed — канал не отдал файл
    - `scan_status` 'pending' | 'clean' | 'infected' | 'skipped': Вердикт антивируса у готового файла

## Other responses

- `400`: Некорректный запрос или нарушение бизнес-правила
- `401`: Сессия, ключ или кабинет не подтверждены
- `403`: Текущая роль не имеет требуемого права
- `404`: Запись не найдена или не видима текущему пользователю

## Changes

- **2026-10-20** `a99574d597cc`: 3 info
  - added the new optional request property `voice`
  - added the optional property `attachments` to the response with the `202` status
  - added the optional property `automation` to the response with the `202` status

[Operation history](https://skmtc.dev/akeda/apis/akeda-erp-client-api/changes/api/v1/crm/inbox/conversations/:id/messages/post.md)

---

[API](https://skmtc.dev/akeda/apis/akeda-erp-client-api.md) · [All operations](https://skmtc.dev/akeda/apis/akeda-erp-client-api/llms.txt) · [OpenAPI document](https://skmtc.dev/akeda/apis/akeda-erp-client-api/revisions/a99574d597cc?raw)
