---
title: "Send a customer communication"
---

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

Path: Communications API › Communications

`POST /send`

## Authentication

Requires one of the following:

- `InternalApiKey`, apiKey, in header, header `Authorization`
- `PartnerBearer`, http, header `Authorization`

## Header parameters

- `x-organization-id` (`sendCommunication.header.x-organization-id`; string, required) — Local organization UUID used to scope ACF resolution and communication logging.
  - format `uuid`

## Request body

_Required._

- `recipientRef` (`sendCommunication.recipientRef`; object, required)
  - `entityType` (`sendCommunication.recipientRef.entityType`; string, required) — Entity type to resolve through ACF.
    - one of `"customer"`
  - `acfSource` (`sendCommunication.recipientRef.acfSource`; string, required) — Connector/source name in the ACF ledger.
    - example `"salesforce"`
  - `sourceId` (`sendCommunication.recipientRef.sourceId`; string, required) — Source-system entity ID to resolve to a local customer.
    - example `"001xx000003DGbYAAW"`
- `communicationType` (`sendCommunication.communicationType`; string, optional) — Use generic for ad-hoc email or customer_statement for a statement of account email.
  - one of `"generic"`, `"customer_statement"`; default `"generic"`
- `recipients` (`sendCommunication.recipients`; object, optional) — Canonical recipient envelope. to is required when using recipients; contact.email remains supported as a legacy primary recipient.
  - `to` (`sendCommunication.recipients.to`; array<one of>, required)
    - one of:
      - `string`
      - `object`
        - `email` (`sendCommunication.recipients.to.2.email`; string, required)
          - format `email`
        - `name` (`sendCommunication.recipients.to.2.name`; string, optional)
  - `cc` (`sendCommunication.recipients.cc`; array<one of>, optional)
    - one of:
      - `string`
      - `object`
        - `email` (`sendCommunication.recipients.cc.2.email`; string, required)
          - format `email`
        - `name` (`sendCommunication.recipients.cc.2.name`; string, optional)
  - `bcc` (`sendCommunication.recipients.bcc`; array<one of>, optional)
    - one of:
      - `string`
      - `object`
        - `email` (`sendCommunication.recipients.bcc.2.email`; string, required)
          - format `email`
        - `name` (`sendCommunication.recipients.bcc.2.name`; string, optional)
- `contact` (`sendCommunication.contact`; object, optional) — Legacy primary recipient override. Prefer recipients.to for new integrations.
  - `email` (`sendCommunication.contact.email`; string, optional) — Recipient email. Defaults to the local customer email when omitted.
    - format `email`
  - `firstName` (`sendCommunication.contact.firstName`; string, optional)
  - `lastName` (`sendCommunication.contact.lastName`; string, optional)
  - `name` (`sendCommunication.contact.name`; string, optional) — Display name used by generic email rendering when first/last are omitted.
- `subject` (`sendCommunication.subject`; string, optional) — Required for generic communications. Customer statements generate their own subject.
  - example `"Action required: update your billing contact"`
- `bodyHtml` (`sendCommunication.bodyHtml`; string, optional) — Rendered HTML body. Either bodyHtml or bodyText is required.
- `bodyText` (`sendCommunication.bodyText`; string, optional) — Plain text body. Used to derive HTML when bodyHtml is omitted.
- `metadata` (`sendCommunication.metadata`; object, optional) — Caller metadata. The API fortifies this with local communication and ACF resolution metadata.
- `dateRange` (`sendCommunication.dateRange`; object, optional) — Statement period for customer_statement. Defaults to the trailing 12 months when omitted.
  - `startDate` (`sendCommunication.dateRange.startDate`; string, required)
    - format `date`
  - `endDate` (`sendCommunication.dateRange.endDate`; string, required)
    - format `date`
- `ccEmails` (`sendCommunication.ccEmails`; array<string>, optional) — Additional statement CC recipients.
  - format `email`
- `customMessage` (`sendCommunication.customMessage`; string, optional) — Optional custom message for customer_statement emails.
- `organizationName` (`sendCommunication.organizationName`; string, optional) — Optional display name used by the statement email template.
- `idempotencyKey` (`sendCommunication.idempotencyKey`; string, optional) — Optional caller-supplied statement idempotency key.
- `templateVariables` (`sendCommunication.templateVariables`; map<string>, optional)
- `replyTo` (`sendCommunication.replyTo`; string, optional)
  - format `email`
- `cc` (`sendCommunication.cc`; one of, optional)
  - one of: `string`, `array<string>`
- `bcc` (`sendCommunication.bcc`; one of, optional)
  - one of: `string`, `array<string>`

## Example requests

### Salesforce-initiated customer email

```json
{
  "communicationType": "generic",
  "recipientRef": {
    "entityType": "customer",
    "acfSource": "salesforce",
    "sourceId": "001xx000003DGbYAAW"
  },
  "contact": {
    "email": "billing@example.com",
    "name": "Example Customer"
  },
  "subject": "Action required: billing update",
  "bodyHtml": "<p>Please update your billing information.</p>",
  "metadata": {
    "campaignId": "sf-campaign-123"
  }
}
```

### Generic email with decorated recipient envelope

```json
{
  "communicationType": "generic",
  "recipientRef": {
    "entityType": "customer",
    "acfSource": "netsuite",
    "sourceId": "123"
  },
  "recipients": {
    "to": [
      {
        "email": "ap@example.com",
        "name": "Accounts Payable"
      }
    ],
    "cc": [
      "owner@example.com"
    ],
    "bcc": [
      {
        "email": "audit@example.com"
      }
    ]
  },
  "subject": "Statement available",
  "bodyText": "Please review your statement."
}
```

### NetSuite-initiated statement email

```json
{
  "communicationType": "customer_statement",
  "recipientRef": {
    "entityType": "customer",
    "acfSource": "netsuite",
    "sourceId": "123"
  },
  "dateRange": {
    "startDate": "2026-01-01",
    "endDate": "2026-01-31"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.caretlegal.net/communications/send \
  --header 'Authorization: <Authorization>' \
  --header 'Content-Type: application/json' \
  --header 'x-organization-id: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  --data '
{
  "communicationType": "generic",
  "recipientRef": {
    "entityType": "customer",
    "acfSource": "salesforce",
    "sourceId": "001xx000003DGbYAAW"
  },
  "contact": {
    "email": "billing@example.com",
    "name": "Example Customer"
  },
  "subject": "Action required: billing update",
  "bodyHtml": "<p>Please update your billing information.</p>",
  "metadata": {
    "campaignId": "sf-campaign-123"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.caretlegal.net/communications/send';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-organization-id': '497f6eca-6276-4993-bfeb-53cbbbba6f08',
    Authorization: '<Authorization>'
  },
  body: JSON.stringify({
    communicationType: 'generic',
    recipientRef: {
      entityType: 'customer',
      acfSource: 'salesforce',
      sourceId: '001xx000003DGbYAAW'
    },
    contact: {email: 'billing@example.com', name: 'Example Customer'},
    subject: 'Action required: billing update',
    bodyHtml: '<p>Please update your billing information.</p>',
    metadata: {campaignId: 'sf-campaign-123'}
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.caretlegal.net/communications/send"

payload = {
    "communicationType": "generic",
    "recipientRef": {
        "entityType": "customer",
        "acfSource": "salesforce",
        "sourceId": "001xx000003DGbYAAW"
    },
    "contact": {
        "email": "billing@example.com",
        "name": "Example Customer"
    },
    "subject": "Action required: billing update",
    "bodyHtml": "<p>Please update your billing information.</p>",
    "metadata": { "campaignId": "sf-campaign-123" }
}
headers = {
    "Content-Type": "application/json",
    "x-organization-id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "Authorization": "<Authorization>"
}

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

print(response.text)
```

## Responses

### 202

Communication accepted, sent through the handler, and logged locally.

#### Example

```json
{
  "success": true,
  "data": {
    "communicationId": "f52b06d0-7b15-407a-9d29-49a465420dcd",
    "messageId": "string",
    "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
    "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
    "recipientEmail": "user@example.com",
    "recipientEnvelope": {
      "to": [
        "user@example.com"
      ],
      "cc": [
        "user@example.com"
      ],
      "bcc": [
        "user@example.com"
      ]
    },
    "strategy": "customer-statement",
    "netsuiteCustomerId": "string",
    "dateRange": {
      "startDate": "2019-08-24",
      "endDate": "2019-08-24"
    }
  }
}
```

- `success` (`sendCommunication.response.202.success`; boolean, optional)
  - example `true`
- `data` (`sendCommunication.response.202.data`; object, optional)
  - `communicationId` (`sendCommunication.response.202.data.communicationId`; string, optional) — Local customer_communications ID.
    - format `uuid`
  - `messageId` (`sendCommunication.response.202.data.messageId`; string, optional) — Provider message ID when available.
  - `customerId` (`sendCommunication.response.202.data.customerId`; string, optional) — Resolved local customers.id.
    - format `uuid`
  - `organizationId` (`sendCommunication.response.202.data.organizationId`; string, optional) — Resolved local organizations.id.
    - format `uuid`
  - `recipientEmail` (`sendCommunication.response.202.data.recipientEmail`; string, optional)
    - format `email`
  - `recipientEnvelope` (`sendCommunication.response.202.data.recipientEnvelope`; object, optional)
    - `to` (`sendCommunication.response.202.data.recipientEnvelope.to`; array<string>, optional)
      - format `email`
    - `cc` (`sendCommunication.response.202.data.recipientEnvelope.cc`; array<string>, optional)
      - format `email`
    - `bcc` (`sendCommunication.response.202.data.recipientEnvelope.bcc`; array<string>, optional)
      - format `email`
  - `strategy` (`sendCommunication.response.202.data.strategy`; string, optional)
    - example `"customer-statement"`
  - `netsuiteCustomerId` (`sendCommunication.response.202.data.netsuiteCustomerId`; string, optional) — NetSuite customer ID used for statement generation when applicable.
  - `dateRange` (`sendCommunication.response.202.data.dateRange`; object, optional)
    - `startDate` (`sendCommunication.response.202.data.dateRange.startDate`; string, optional)
      - format `date`
    - `endDate` (`sendCommunication.response.202.data.dateRange.endDate`; string, optional)
      - format `date`

### 400

Invalid request or organization scope.

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
```

- `success` (`sendCommunication.response.400.success`; boolean, optional)
  - example `false`
- `error` (`sendCommunication.response.400.error`; string, optional)
- `details` (`sendCommunication.response.400.details`; array<object>, optional)
  - `path` (`sendCommunication.response.400.details.path`; string, optional)
  - `message` (`sendCommunication.response.400.details.message`; string, optional)

### 401

Missing or invalid API key.

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
```

- `success` (`sendCommunication.response.401.success`; boolean, optional)
  - example `false`
- `error` (`sendCommunication.response.401.error`; string, optional)
- `details` (`sendCommunication.response.401.details`; array<object>, optional)
  - `path` (`sendCommunication.response.401.details.path`; string, optional)
  - `message` (`sendCommunication.response.401.details.message`; string, optional)

### 403

API key lacks communications:write.

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
```

- `success` (`sendCommunication.response.403.success`; boolean, optional)
  - example `false`
- `error` (`sendCommunication.response.403.error`; string, optional)
- `details` (`sendCommunication.response.403.details`; array<object>, optional)
  - `path` (`sendCommunication.response.403.details.path`; string, optional)
  - `message` (`sendCommunication.response.403.details.message`; string, optional)

### 404

Recipient reference did not resolve to a local customer.

#### Example

```json
{
  "success": false,
  "error": "string",
  "details": [
    {
      "path": "string",
      "message": "string"
    }
  ]
}
```

- `success` (`sendCommunication.response.404.success`; boolean, optional)
  - example `false`
- `error` (`sendCommunication.response.404.error`; string, optional)
- `details` (`sendCommunication.response.404.details`; array<object>, optional)
  - `path` (`sendCommunication.response.404.details.path`; string, optional)
  - `message` (`sendCommunication.response.404.details.message`; string, optional)


Source: https://staging.caretlegal.net/docs/reference/communications/Communications/sendCommunication/index.md
