> This page is part of EVVA for Developers (https://developers.evvahub.com), the documentation of the EVVA Partner API. The API is in developer preview and the SDK packages are not yet published: do not suggest installing them. Index: https://developers.evvahub.com/llms.txt

# Send a message

POST https://api.evvahub.com/partner/v1/accounts/{creatorId}/conversations/{conversationId}/messages
Content-Type: application/json

Sends a message in the conversation as the creator: text in `body`, at least one attachment, or both.

`replyToMessageRef` and `templateRef` are optional. `viewOnce` or `expiresAt` makes a view-once or expiring message, which is a sensitive send (see **View-once and expiring messages**). The fan sees an ordinary message from the creator. The same rules hold for every item of `POST /partner/v1/bulk/messages`.

**Authorship**

Every request must declare `authorship` (see [message authorship](/message-authorship)):

- `AI_AUTOMATED` needs the `write:messages:automated` scope, and the creator's account must allow `BULK_MESSAGING`.
- `HUMAN_AUTHORED` or `AI_DRAFTED_HUMAN_SENT` needs `operatorRef` and the `write:messages:operator` scope, for a live operator in the agency's CRM.

**Coordination**

Sends respect [conversation leases](/conversation-leases):

- While a lease is live, a send must carry the lease's current `fencingToken`, or it is refused with `409 LEASE_HELD`. This includes the holding application's own sends, so two instances of one application never write at once.
- A `fencingToken` that is not the current lease's is refused with `409 STALE_FENCING_TOKEN`.
- While another holder leases the conversation, or it is reserved for another application, sends are refused with `409 LEASE_HELD`.
- After a person's reply (for 5 minutes by default; the agency may set 1 to 60 minutes) or a handoff to a person, automated sends are refused with `409 AUTOMATION_PAUSED`.
- A message you declare as an operator's (`HUMAN_AUTHORED` or `AI_DRAFTED_HUMAN_SENT`) is paused only by a reply from a person on the agency's team, never by the creator's or the operator's own replies. It is also refused with `409 AUTOMATION_PAUSED` while a handoff to a person has been taken up, until a person hands the conversation back. It may answer a handoff that nobody has taken up yet.
- `expectedLastMessageId` makes the send conditional: when the newest message is another one, it is refused with `409 CONVERSATION_ADVANCED`.
- `takeover` is refused: taking a conversation over is a person's action alone.

**Idempotency**

`Idempotency-Key` is optional and lives in your application's own key space. The same key with the same message returns `200` with the stored message. A replay is answered before any coordination check. See [idempotency](/conventions/idempotency).

**Limits**

Sends are limited per conversation (30 per minute) and per creator (300 per minute), both shared with the creator's own sends, and per application and per agency, scaled by active creators. A replay or a refused request costs nothing. See [rate limits](/authentication/rate-limits).

**View-once and expiring messages**

A send that sets a lifetime (`viewOnce` or `expiresAt`) also needs the `write:messages:view_once` scope. Without it, the send is refused with `403 OAUTH_SCOPE_MISSING` before any approval is asked. With it, the send goes through [action approval](/approvals):

- The agency's policy may refuse it: `403 ACTION_DENIED_BY_POLICY`.
- Under `AUTO_WITHIN_LIMITS`, it is sent while it stays within the agency's own limits.
- Otherwise you get `202 APPROVAL_REQUIRED`. Re-send with the `Partner-Approval-Id` header. The approval is bound to the conversation, the files and the lifetime, and is spent once.

An ordinary send asks for no approval.

**Errors**

- `400 AUTHORSHIP_REQUIRED` — `authorship` is missing.
- `400 AUTHORSHIP_INVALID` — the value is not one an application may declare.
- `400 OPERATOR_REF_REQUIRED`, `400 OPERATOR_REF_INVALID` — `operatorRef` is missing, malformed or misplaced.
- `403 AUTHORSHIP_NOT_PERMITTED` — the creator has not consented to this authorship. `details.requiredScope` names the missing scope.
- `403 CREATOR_SUSPENDED` — an automated send for a suspended creator.
- `403 RECIPIENT_NOT_ACCEPTING_MESSAGES` — the fan muted or blocked the creator, which refuses every creator-side send.
- `409 IDEMPOTENCY_KEY_REUSED` — the key was already used for a different message.
- `409 MEDIA_NOT_READY` — an attachment is not ready.
- `409 LEASE_HELD`, `409 STALE_FENCING_TOKEN`, `409 AUTOMATION_PAUSED`, `409 CONVERSATION_ADVANCED` — see **Coordination**.
- `429 TOO_MANY_MESSAGES` — a send limit is full. `Retry-After` says when to retry, and `details.level` names the level that refused.
- `503 SERVICE_UNAVAILABLE` — the limits cannot be checked, and nothing was written. Retry after `Retry-After`.

**Required scopes:** `write:messages`.

**Approval:** setting or changing `viewOnce`, `expiresAt` runs through [action approval](/approvals).

Reference: https://developers.evvahub.com/api-reference/messaging/send-message

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 client credentials. Request an access token at `POST /partner/v1/oauth/token` (`grant_type=client_credentials`) with the application's client secret or a `private_key_jwt` assertion, then send it as `Authorization: Bearer evpa_live_…` (or `evpa_test_…` for a sandbox application). Tokens are opaque and short lived (see `expires_in`); there is no refresh token. Each operation lists the scopes it requires.

## Request

### Path parameters

- `creatorId` (string, required) — The creator profile id — the ONLY source of the creator a request acts for.
- `conversationId` (string, required)

### Headers

- `X-Creator-Id` (string, optional) — Optional echo of the path `creatorId`; any other value is refused with 403 CREATOR_CONTEXT_MISMATCH.
- `Idempotency-Key` (string, optional) — Optional key for the send; blank means no key. Otherwise 1..128 characters of `[A-Za-z0-9_-]`, or `400 INVALID_REQUEST` before anything is written. The same key with the same message answers `200` with the stored message; with a different message it is `409 IDEMPOTENCY_KEY_REUSED` (formerly `CONFLICT`). The key is scoped to the sender, your application, and never echoed.
- `Partner-Approval-Id` (string, optional) — The `approvalId` a previous `202 APPROVAL_REQUIRED` returned, for an operation your application may run only with approval. Re-send it with the same payload once a person has approved. A blank value is no approval. The approval is spent once, for exactly that agency, application, creator, operation and payload digest, the same amount and currency, and at most the units it was given for. It is claimed for the request's `Idempotency-Key` (required) and becomes final when the operation succeeds: - A refusal before the effect, a `4xx` or `429`, hands it back for your next attempt. - A `5xx`, `503` included, keeps it claimed for this key, because the effect may have happened. It is handed back only when EVVA knows nothing was done. - The same key re-sent replays the request and never has a second effect. You get the stored result where the operation keeps one, otherwise `409 APPROVAL_CONSUMED` with `details.replay: true`: read the resource to see the result. - Another key is `409 APPROVAL_CONSUMED`. When the approval cannot be used, the request is refused with `403` (`APPROVAL_INVALID`, `APPROVAL_MISMATCH` or `APPROVAL_DECLINED`) or `409` (`APPROVAL_PENDING`, `APPROVAL_EXPIRED` or `APPROVAL_CONSUMED`). See [action approval](/approvals).

### Body (application/json)

This endpoint expects a SendMessageRequest.

- `body` (string, optional, nullable) — Trimmed length ≤ 2000; no NUL, no lone surrogate. Optional when attachments are sent.
- `replyToMessageRef` (string, optional) — The message this one answers (must be in this conversation, checked in the send transaction).
- `viewOnce` (boolean, optional) — A free message the fan may open once. It needs a grant carrying `write:messages:view_once`, which is not part of the default consent; otherwise `403`. For an application it also goes through action approval: `202 APPROVAL_REQUIRED` unless the agency's policy lets it through. `409 ASSET_REACHABLE_ELSEWHERE` when the fan can already open the file from another message.
- `expiresAt` (datetime, optional) — When the media stops being servable: 5 minutes to 30 days ahead.
- `templateRef` (string, optional) — The saved reply this message came from — counts one use when a message is created.
- `attachments` (list of string, optional) — Vault asset ids, with no duplicates: at most the per-message attachment limit, 10 by default.
- `authorship` (enum, optional) — REQUIRED for an application: `AI_AUTOMATED` needs `write:messages:automated`; `HUMAN_AUTHORED` / `AI_DRAFTED_HUMAN_SENT` need `write:messages:operator` and `operatorRef`.
  - Allowed values: `AI_AUTOMATED`, `HUMAN_AUTHORED`, `AI_DRAFTED_HUMAN_SENT`
- `operatorRef` (string, optional) — The external CRM's opaque operator id — required with HUMAN_AUTHORED / AI_DRAFTED_HUMAN_SENT, refused otherwise. Stored in the agency audit only.
- `expectedLastMessageId` (string, optional) — Makes the send conditional: the message is written only while this is the conversation's newest live message, otherwise `409 CONVERSATION_ADVANCED`. The check is made inside the write transaction, so two sends that expected the same last message cannot both be written.
- `fencingToken` (SendMessageRequestFencingToken, optional) — The fencing token of the conversation's current lease; a token that is not current is `409 STALE_FENCING_TOKEN`. An application must send it while the lease is live: without it the send is `409 LEASE_HELD`, even the lease holder's own. See [conversation leases](/conversation-leases).
- `automationRunId` (string, optional) — The client's own reference for the automation run (metadata); stored in the agency audit, never shown to the buyer.

## Response

### 200

An idempotent replay of a message already sent.

- `message` (DirectMessage, required)

### 201

Sent.

- `message` (DirectMessage, required)

### 202

The action waits for an authorised person of the agency, and nothing was done. It waits because the agency has no policy for it, its policy requires approval, or the action is over the agency's own automatic limit (`LIMIT_EXCEEDED`). Once an `approval.decided` event approves it, re-send the same request with `Partner-Approval-Id: <approvalId>`. See [action approval](/approvals).

- `code` (enum, required)
  - Allowed values: `APPROVAL_REQUIRED`
- `error` (string, required)
- `approvalId` (string, required)
- `status` (enum, required) — The status of an approval request. Reads show the effective status. - `PENDING` becomes `APPROVED`, `DECLINED`, `EXPIRED` or `REVOKED`. - `APPROVED` becomes `CONSUMED`, `EXPIRED` or `REVOKED`. - `REVOKED` means the request was voided: its access was withdrawn (grant or consent link), the application or agency stopped, the creator was held or restricted, or the policy that governed it was replaced. `revokedReason` says which.
  - Allowed values: `PENDING`, `APPROVED`, `DECLINED`, `EXPIRED`, `CONSUMED`, `REVOKED`
- `reason` (enum, required) — Why the action was not automatic: no policy (the default), a policy that asks for approval, or over a limit.
  - Allowed values: `NO_POLICY`, `POLICY_REQUIRES_APPROVAL`, `LIMIT_EXCEEDED`
- `expiresAt` (datetime, required)
- `requestId` (string, optional, nullable)

## Errors

### 400 Bad Request Error

Invalid or missing parameters: `INVALID_REQUEST` (`details` names the fields), or a more specific code of the operation.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 401 Unauthorized Error

Token missing, malformed, expired or revoked: `INVALID_TOKEN` (or `UNAUTHORIZED` when no bearer token was sent). Request a new token and retry.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 403 Forbidden Error

Not your creator (`GRANT_REVOKED`, `INSUFFICIENT_SCOPE`, …), or the fan does not accept this message: `RECIPIENT_NOT_ACCEPTING_MESSAGES`, `CREATOR_ACCEPTS_FOLLOWERS_ONLY`, `CREATOR_ACCEPTS_FOLLOWERS_OR_SUBSCRIBERS`, `CREATOR_ACCEPTS_FANS_WHO_GIFTED`.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 404 Not Found Error

No such resource, or it belongs to another creator: `NOT_FOUND` or a more specific code.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 409 Conflict Error

`IDEMPOTENCY_KEY_REUSED` — the `Idempotency-Key` was used with a different message or attachment set, or by a retracted message. `MEDIA_NOT_READY` — an attachment is not ready. Coordination: `LEASE_HELD` (with `Retry-After` while the other lease lives), `STALE_FENCING_TOKEN`, `AUTOMATION_PAUSED` (with `Retry-After` while a person's reply pauses automation) and `CONVERSATION_ADVANCED`.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 429 Too Many Requests Error

Too many messages (`TOO_MANY_MESSAGES`, `details.level` names the limit) or rate limited (`RATE_LIMIT_EXCEEDED`). Wait `Retry-After` seconds before retrying.

- `code` (enum, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
  - Allowed values: `RATE_LIMIT_EXCEEDED`, `TOO_MANY_MESSAGES`
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (RateLimitErrorDetails, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 500 Internal Server Error

Unexpected server error: `INTERNAL_ERROR`. Nothing internal is disclosed; quote the `X-Request-Id` when you report it.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

### 503 Service Unavailable Error

Temporarily unavailable: `SERVICE_UNAVAILABLE`, `TEMPORARILY_UNAVAILABLE`, `MEDIA_STORAGE_UNAVAILABLE` or `CREATOR_STANDING_UNAVAILABLE`. Retry after `Retry-After` seconds.

- `code` (string, required) — A stable machine-readable code (see `KnownErrorCode`; new codes may appear within v1).
- `error` (string, required)
- `requestId` (string, required, nullable) — The same value as the `X-Request-Id` response header — quote it when reporting a problem.
- `details` (any, optional) — Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

## Types

### SendMessageRequestFencingToken

The fencing token of the conversation's current lease; a token that is not current is `409 STALE_FENCING_TOKEN`. An application must send it while the lease is live: without it the send is `409 LEASE_HELD`, even the lease holder's own. See [conversation leases](/conversation-leases).

- string
- integer

### DirectMessage

- `id` (string, required)
- `senderRole` (enum, required)
  - Allowed values: `USER`, `CREATOR`
- `body` (string, required, nullable)
- `createdAt` (datetime, required)
- `kind` (enum, required)
  - Allowed values: `UNRECORDED`, `STANDARD`, `PAID`, `PAID_BROADCAST`, `PAID_ICE_BREAKER`, `TIP`, `ICE_BREAKER`, `BROADCAST`, `AUTOMATED`
- `authorship` (enum, required)
  - Allowed values: `UNRECORDED`, `HUMAN_AUTHORED`, `AI_DRAFTED_HUMAN_SENT`, `AI_GENERATED_APPROVED`, `AI_AUTOMATED`, `PLATFORM_AUTOMATED`
- `lifetime` (DirectMessageLifetime, required, nullable)
- `media` (list of MessageMedia, required)
- `receipt` (enum, required, nullable) — The actual status of a message the creator sent; null on the fan's messages. - `sent` — the message was saved. - `delivered` — the fan's client acknowledged delivery. A realtime publish or a partner call never counts. - `read` — the fan's read position reached it, subject to the fan's receipt setting. - `purchased` — the same as `paid.purchased`, and only with `read:revenue`.
  - Allowed values: `sent`, `delivered`, `read`
- `editedAt` (datetime, required, nullable)
- `revision` (integer, required)
- `replyTo` (DirectMessageReplyTo, required, nullable) — The quoted message this one answers (on the Partner reads).
- `reactions` (list of DirectMessageReactionsItems, required) — Reaction chips folded for the creator (on the Partner reads).
- `paid` (PaidMessageTerms, required, nullable) — The PPV facet as the seller sees it, with `purchased` (on the Partner reads). The PPV send answers its own terms in `PaidMessageSendResult.paid`.
- `tip` (DirectMessageTip, required, nullable) — Always null on the Partner surface (no per-fan gross spend for an agency).
- `senderBuyerRef` (string, optional, nullable) — APPLICATIONS ONLY, on the message page — the application's pairwise pseudonym of the buyer on a message the buyer wrote (`senderRole: USER`); `null` on the creator's side.

### RateLimitErrorDetails

Extra detail for the code, specific to the operation, such as field errors, limits or the creator's account-status details.

- `retryAfterSec` (integer, required)
- `level` (enum, optional) — The DM send limit that refused the message, set only with `TOO_MANY_MESSAGES`. It is never a quota, a count or a key. - `conversation` — one side of one thread. - `sender` — a person's own ceiling; it does not apply to applications. - `creator` — everything sent for the creator, studio included. - `application` — everything your application sends. - `agency` — everything your agency sends. - `platform` — the agency's fair share of the platform: its throughput or its concurrency. See [rate limits](/authentication/rate-limits).
  - Allowed values: `conversation`, `sender`, `creator`, `application`, `agency`, `platform`

### DirectMessageLifetime

- `viewOnce` (boolean, required)
- `opened` (boolean, required)
- `expiresAt` (datetime, required, nullable)

### MessageMedia

- `mediaAssetId` (string, required)
- `kind` (string, required)
- `position` (integer, required)
- `available` (boolean, required)
- `durationLabel` (string, required, nullable) — The media's duration, as `m:ss`.
- `width` (integer, required, nullable)
- `height` (integer, required, nullable)
- `freeSample` (boolean, required)
- `caption` (string, required, nullable)
- `displayName` (string, required, nullable)
- `sizeBytes` (integer, required)

### DirectMessageReplyTo

The quoted message this one answers (on the Partner reads).

- `id` (string, required)
- `senderRole` (enum, required)
  - Allowed values: `USER`, `CREATOR`
- `preview` (string, required)
- `hasMedia` (boolean, required)
- `retracted` (boolean, required)

### DirectMessageReactionsItems

- `kind` (string, required)
- `count` (integer, required)
- `mine` (boolean, required)

### PaidMessageTerms

- `priceMinor` (string, required)
- `currency` (string, required)
- `blurPreview` (boolean, required)
- `unlocked` (boolean, required)
- `offerExpiresAt` (datetime, optional, nullable)
- `orderRef` (string, optional, nullable) — The reader's own order — always null for the seller side.
- `purchased` (boolean, optional, nullable) — Whether the offer sold, as the seller (the creator) sees it. On the Partner reads (history, window, after, status) it is set only when the reader's consent covers `read:revenue`, because a purchase is a money fact on every channel; otherwise `null`.

### DirectMessageTip

Always null on the Partner surface (no per-fan gross spend for an agency).

- `amountMinor` (string, required)
- `currency` (string, required)
- `settled` (boolean, required)
- `payment` (enum, optional)
  - Allowed values: `OPEN`, `IN_FLIGHT`, `CLOSED`

## Examples

### Messaging_sendMessage_example

**Request**

```json
{
  "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
  "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
  "authorship": "AI_AUTOMATED",
  "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
  "fencingToken": "42",
  "automationRunId": "run.2026-12-01.8f3a2c"
}
```

**Response**

```json
{
  "message": {
    "id": "cm4rbf2jm000gqz8wr4x9d6pa",
    "senderRole": "CREATOR",
    "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
    "createdAt": "2026-12-01T18:42:07.512Z",
    "kind": "STANDARD",
    "authorship": "AI_AUTOMATED",
    "lifetime": null,
    "media": [],
    "receipt": null,
    "editedAt": null,
    "revision": 0,
    "replyTo": null,
    "reactions": [],
    "paid": null,
    "tip": null
  }
}
```

**SDK Code**

```python Messaging_sendMessage_example
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages"

payload = {
    "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
    "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
    "authorship": "AI_AUTOMATED",
    "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
    "fencingToken": "42",
    "automationRunId": "run.2026-12-01.8f3a2c"
}
headers = {
    "Idempotency-Key": "f7510cb2-a96c-44ff-a208-a058504574e8",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go Messaging_sendMessage_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages"

	payload := strings.NewReader("{\n  \"body\": \"Thank you! There's more from that trip — the full set goes live on Friday.\",\n  \"replyToMessageRef\": \"cm4r9c3hd000bqz8wp6t1x8ny\",\n  \"authorship\": \"AI_AUTOMATED\",\n  \"expectedLastMessageId\": \"cm4r9c3hd000bqz8wp6t1x8ny\",\n  \"fencingToken\": \"42\",\n  \"automationRunId\": \"run.2026-12-01.8f3a2c\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "f7510cb2-a96c-44ff-a208-a058504574e8")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Messaging_sendMessage_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages', [
  'body' => '{
  "body": "Thank you! There\'s more from that trip — the full set goes live on Friday.",
  "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
  "authorship": "AI_AUTOMATED",
  "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
  "fencingToken": "42",
  "automationRunId": "run.2026-12-01.8f3a2c"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'f7510cb2-a96c-44ff-a208-a058504574e8',
  ],
]);

echo $response->getBody();
```

### Messaging_sendMessage_example

**Request**

```json
{
  "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
  "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
  "authorship": "AI_AUTOMATED",
  "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
  "fencingToken": "42",
  "automationRunId": "run.2026-12-01.8f3a2c"
}
```

**Response**

```json
{
  "message": {
    "id": "cm4rbf2jm000gqz8wr4x9d6pa",
    "senderRole": "CREATOR",
    "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
    "createdAt": "2026-12-01T18:42:07.512Z",
    "kind": "STANDARD",
    "authorship": "AI_AUTOMATED",
    "lifetime": null,
    "media": [],
    "receipt": null,
    "editedAt": null,
    "revision": 0,
    "replyTo": null,
    "reactions": [],
    "paid": null,
    "tip": null
  }
}
```

**SDK Code**

```python Messaging_sendMessage_example
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages"

payload = {
    "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
    "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
    "authorship": "AI_AUTOMATED",
    "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
    "fencingToken": "42",
    "automationRunId": "run.2026-12-01.8f3a2c"
}
headers = {
    "Idempotency-Key": "f7510cb2-a96c-44ff-a208-a058504574e8",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go Messaging_sendMessage_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages"

	payload := strings.NewReader("{\n  \"body\": \"Thank you! There's more from that trip — the full set goes live on Friday.\",\n  \"replyToMessageRef\": \"cm4r9c3hd000bqz8wp6t1x8ny\",\n  \"authorship\": \"AI_AUTOMATED\",\n  \"expectedLastMessageId\": \"cm4r9c3hd000bqz8wp6t1x8ny\",\n  \"fencingToken\": \"42\",\n  \"automationRunId\": \"run.2026-12-01.8f3a2c\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "f7510cb2-a96c-44ff-a208-a058504574e8")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Messaging_sendMessage_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages', [
  'body' => '{
  "body": "Thank you! There\'s more from that trip — the full set goes live on Friday.",
  "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
  "authorship": "AI_AUTOMATED",
  "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
  "fencingToken": "42",
  "automationRunId": "run.2026-12-01.8f3a2c"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'f7510cb2-a96c-44ff-a208-a058504574e8',
  ],
]);

echo $response->getBody();
```

### Messaging_sendMessage_example

**Request**

```json
{
  "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
  "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
  "authorship": "AI_AUTOMATED",
  "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
  "fencingToken": "42",
  "automationRunId": "run.2026-12-01.8f3a2c"
}
```

**Response**

```json
{
  "approvalId": "apr_8sKq2VnT4xLm7RcB1pYw9ZdH",
  "code": "APPROVAL_REQUIRED",
  "error": "This action needs the approval of an authorised person",
  "expiresAt": "2026-12-03T14:31:00.000Z",
  "reason": "NO_POLICY",
  "requestId": "2ac01c39-6b45-4a0b-8db1-be67984d2cac",
  "status": "PENDING"
}
```

**SDK Code**

```python Messaging_sendMessage_example
import requests

url = "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages"

payload = {
    "body": "Thank you! There's more from that trip — the full set goes live on Friday.",
    "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
    "authorship": "AI_AUTOMATED",
    "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
    "fencingToken": "42",
    "automationRunId": "run.2026-12-01.8f3a2c"
}
headers = {
    "Idempotency-Key": "f7510cb2-a96c-44ff-a208-a058504574e8",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```go Messaging_sendMessage_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages"

	payload := strings.NewReader("{\n  \"body\": \"Thank you! There's more from that trip — the full set goes live on Friday.\",\n  \"replyToMessageRef\": \"cm4r9c3hd000bqz8wp6t1x8ny\",\n  \"authorship\": \"AI_AUTOMATED\",\n  \"expectedLastMessageId\": \"cm4r9c3hd000bqz8wp6t1x8ny\",\n  \"fencingToken\": \"42\",\n  \"automationRunId\": \"run.2026-12-01.8f3a2c\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "f7510cb2-a96c-44ff-a208-a058504574e8")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```php Messaging_sendMessage_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.evvahub.com/partner/v1/accounts/cm4r7k2xq0001qz8w3n5v6b2d/conversations/cm4r8a1vz0007qz8wk2j9h4mt/messages', [
  'body' => '{
  "body": "Thank you! There\'s more from that trip — the full set goes live on Friday.",
  "replyToMessageRef": "cm4r9c3hd000bqz8wp6t1x8ny",
  "authorship": "AI_AUTOMATED",
  "expectedLastMessageId": "cm4r9c3hd000bqz8wp6t1x8ny",
  "fencingToken": "42",
  "automationRunId": "run.2026-12-01.8f3a2c"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'f7510cb2-a96c-44ff-a208-a058504574e8',
  ],
]);

echo $response->getBody();
```