Send email
cooper_send_messageUse this when the user asks the agent to send an email from its Cooper address. Requires auth. Delivers real email on the public Internet and stores a copy. Inputs: inbox_id (required; inbox id, username, or email), to (required; array of recipient addresses), subject (required), text and/or html body, cc, bcc, reply_to, headers, labels, in_reply_to (optional; a msg_ id threads onto that message using its Message-ID header and thread_id; any other value is sent as In-Reply-To), attachments (optional [{filename, content_base64, content_type?, content_id?}]; content_id enables inline images), client_id (optional; retrying with the same client_id returns the original message and does not send twice), idempotency_key (optional; sent as the Idempotency-Key header; 1 to 256 characters of letters, digits, and - . _ ~; the same key and the same request within 24 hours returns the original message and does not send again). When both client_id and idempotency_key are set, client_id is checked first. Returns the stored message {id, thread_id, status, from, to, subject, text, html, created_at, delivery_events, …}. A replay includes idempotent true. HTTP 402 with upgrade_url means the monthly send limit was reached. A paused inbox returns HTTP 403 inbox_paused and does not send. A suppressed address returns HTTP 403 recipient_suppressed and nothing is sent, stored, or counted. Fails with 400 invalid_idempotency_key, 409 idempotency_key_conflict, or 409 idempotency_request_in_progress. When usage is at 80 percent of a plan limit, the response includes notices: [{type: limit_warning, resource, used, limit, upgrade_url}].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Cc addresses | |
| to | Yes | Recipient email addresses | |
| bcc | No | Bcc addresses | |
| html | No | Optional HTML body | |
| text | No | Plain-text body | |
| labels | No | Labels stored on the message. Defaults to ["sent"]. | |
| headers | No | Optional extra headers. Each name maps to a string value. | |
| subject | Yes | Subject line | |
| inbox_id | Yes | Inbox id (inb_…), username, or full email address | |
| reply_to | No | Reply-To address. Defaults to this inbox. | |
| client_id | No | Optional client_id. The same value returns the original message. | |
| attachments | No | Optional files, base64-encoded | |
| in_reply_to | No | Thread this send under a message. A msg_ id uses that message's Message-ID header and thread_id. Any other value is copied to In-Reply-To. | |
| idempotency_key | No | Optional Idempotency-Key header. 1 to 256 characters: letters, digits, and - . _ ~. The same key and request within 24 hours returns the original message. |