---
title: "Send a text reply inside the provider window"
description: "PubNio API inbox.messages.send: send a text reply inside the provider window. Request fields, examples in five clients, errors, and idempotency."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a text reply inside the provider window

Send a text reply inside the provider window with [`POST /api/v1/inbox/conversations/{conversationId}/messages`](https://pubnio.com/api/v1/docs#tag/inbox/POST/api/v1/inbox/conversations/{conversationId}/messages). Requires an API key with the `engage` scope or a signed-in workspace member.

## Request

One provider call per accepted action. A repeated key returns the stored message; a changed body conflicts. A closed window returns 409 with zero provider calls.

| Parameter        | In    | Type | Required |
| ---------------- | ----- | ---- | -------- |
| `conversationId` | path  | UUID | Yes      |
| `workspaceId`    | query | UUID | Yes      |

| Body field | Type   | Required |
| ---------- | ------ | -------- |
| `text`     | string | Yes      |

## Response

- HTTP 201: `InboxMessage` with `id`, `conversationId`, `accountId`, `provider`, `direction`, `state`, `kind`, `text`, `sender`, `replyToMessageId`, `attachments`, `actionId`, `providerCreatedAt`, `providerUpdatedAt`, `readAt`, `deletedAt`, `createdAt`.
  - `provider`: `bluesky`, `facebook`, `instagram`, `linkedin`, `pinterest`, `reddit`, `snapchat`, `tiktok`, `threads`, `x`, `youtube`, `google_business`, `meta_ads`, `google_ads`, `reddit_ads`, `pinterest_ads`, `tiktok_ads`, `linkedin_ads`, `snapchat_ads`, `amazon_ads`, `openai_ads`
  - `direction`: `inbound`, `outbound`
  - `state`: `received`, `pending`, `sending`, `sent`, `delivered`, `failed`, `unresolved`, `deleted`
  - `kind`: `text`, `media`, `template`, `interactive`, `system`, `unknown`

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const message = await workspace.inbox.sendMessage(conversationId, {
  text: "Your order ships tomorrow.",
});
```

### Python

```python
message = workspace.inbox.send_message(
    conversation_id,
    text="Your order ships tomorrow.",
)
```

### cURL

```sh
curl -X POST "https://pubnio.com/api/v1/inbox/conversations/$CONVERSATION_ID/messages?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Your order ships tomorrow."}'
```

### CLI

```sh
pnio inbox messages send "$CONVERSATION_ID" --text "Your order ships tomorrow."
```

### MCP execute

```js
async () => {
  const conversationId = "<conversationId>";
  // One key per intent; reuse it only to retry this same request.
  const idempotencyKey = crypto.randomUUID();
  const response = await codemode.request({
    method: "POST",
    path: `/api/v1/inbox/conversations/${conversationId}/messages`,
    query: { workspaceId: codemode.workspaceId },
    headers: { "Idempotency-Key": idempotencyKey },
    body: { text: "Your order ships tomorrow." },
  });
  return response.data;
};
```

## Errors

It declares no problem of its own.

It declares the problems [every Inbox operation](https://pubnio.com/docs/reference/#inbox) and [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

Required. A retry with the same `Idempotency-Key` returns the first result for 24 hours. Make one key per intent, such as `crypto.randomUUID()` or Python's `uuid4()`, and reuse it only to retry the same request. The TypeScript SDK makes a key for each call unless you pass `idempotencyKey`. See [Idempotency](https://pubnio.com/docs/concepts/idempotency/).

## Limits

- Field lengths and ranges are in the [OpenAPI document](https://pubnio.com/api/v1/openapi).

## Related

- [Inbox operations](https://pubnio.com/docs/reference/#inbox)

Source: https://pubnio.com/docs/reference/inbox-messages-send/index.mdx
