---
title: "Send a direct message"
method: POST
path: "/api/v1/messages"
tags: ["Messages"]
---

# Send a direct message

`POST /api/v1/messages`

## Request

- Base URL: `https://app.tryadeli.com`
- URL: `https://app.tryadeli.com/api/v1/messages`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/adeli/apis/adeli-api/docs/api/v1/messages/post.ts> (a function with typed inputs; its response is checked against the schema)

Instagram and Facebook send text. WhatsApp sends an approved `template`, or free `text` (up to 4,096 characters) inside the 24-hour window after the customer's last message, never both. A reply outside a platform's 24-hour window is 409 window_closed.

## Request body

- union
  - object
    - `platform` 'instagram', required
    - `accountId` string, uuid, required
    - `profileId` string, uuid
    - `recipient` string, required
    - `text` string, required
  - object
    - `platform` 'facebook', required
    - `accountId` string, uuid, required
    - `profileId` string, uuid
    - `recipient` string, required
    - `text` string, required
  - object
    - `platform` 'whatsapp', required
    - `accountId` string, uuid, required
    - `profileId` string, uuid
    - `recipient` string, required
    - `template` object, required
      - `name` string, required
      - `language` string, required
      - `bodyParameters` string[]
  - object
    - `platform` 'whatsapp', required
    - `accountId` string, uuid, required
    - `profileId` string, uuid
    - `recipient` string, required
    - `text` string, required: Free text, sent only inside the 24-hour window after the customer's last message; 409 window_closed otherwise. Send a template outside it.

## Response `201`

Success

- object
  - `id` string, required
  - `providerId` string, nullable, required
  - `platform` 'instagram' | 'facebook' | 'whatsapp', required
  - `accountId` string, uuid, required
  - `profileId` string, uuid, required
  - `direction` 'inbound' | 'outbound', required
  - `type` 'text' | 'template' | 'unsupported', required
  - `recipient` string, nullable, required
  - `sender` string, nullable, required
  - `body` string, required
  - `status` string, required
  - `occurredAt` string, date-time, required
  - `createdAt` string, date-time, required
  - `conversationKey` string, nullable: `<platform>:<counterparty id>` (an IGSID, a PSID, or a WhatsApp wa_id in digits), scoped to accountId: with accountId it identifies one conversation. Pass it to listMessages to read that conversation. Null when the counterparty is unknown; optional so clients built before it existed still type-check.

## Other responses

- `400`: Invalid request or provider failure
- `401`: Missing or invalid API key
- `402`: Billing is required: a card is needed to connect more accounts or use X (`billing_required`, `x_billing_required`), or the workspace has used its free monthly allowance (`usage_limit_reached`)
- `403`: The connection lacks a permission or provider-confirmed resource
- `404`: Profile, account, or object not found
- `409`: The request conflicts with existing state
- `422`: The connected account cannot perform this operation
- `502`: Invalid request or provider failure

---

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