RecoupGet a Free AuditFree Audit

API REFERENCE

Send Email

On this page
POST/api/emails

Send an email to one or more recipients. Emails are sent from Agent by Recoup <agent@recoupable.dev>.

Authentication

See the authentication guide for API key and account access requirements.

Request

cURL
curl --request POST \
  --url 'https://api.recoupable.dev/api/emails' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "to": [
    "recipient@example.com"
  ],
  "cc": [
    "cc@example.com"
  ],
  "subject": "Weekly Pulse Report",
  "text": "# Pulse Report\n\nHere'"'"'s your weekly summary.",
  "html": "<h1>Pulse Report</h1><p>Here'"'"'s your weekly summary.</p>",
  "headers": {},
  "chat_id": "string",
  "account_id": "YOUR_ID"
}'

Request body required

Email payload

application/json

toarray<string>

Recipient email address(es). Optional — when omitted, the email is sent to the authenticated account's own email address. Without a payment method on file, restricted to the account's own email; add a payment method to send to any recipient.

minItems: 1

Item properties for to

string

ccarray<string>

Optional CC email addresses. Without a payment method on file, restricted to the account's own email; add a payment method to send to any recipient.

Item properties for cc

string

subjectstring

Email subject line. Optional — when omitted, defaults to the first heading or line of the body, falling back to Message from Recoup if the body is empty.

textstring

Plain text or Markdown body. Rendered as HTML via Markdown if no html is provided.

htmlstring

Raw HTML body. Takes precedence over text when both are provided.

headersobject

Optional custom email headers

chat_idstring

Chat ID to include a chat link in the email footer. Use Create Chat to create one.

account_idstring

UUID of the account to send the email for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, sends for the API key's own account.

format: uuid

Responses

200Email sent successfully

application/json

successbooleanrequired

Whether the email was sent successfully

messagestringrequired

Human-readable result message

idstringrequired

Resend email ID

400Validation error

application/json

errorintegerrequired

format: int32

messagestringrequired
401Authentication required

application/json

errorintegerrequired

format: int32

messagestringrequired
502Email delivery failed

application/json

errorintegerrequired

format: int32

messagestringrequired

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download accounts.json
View operation source
json
{
  "description": "Send an email to one or more recipients. Emails are sent from `Agent by Recoup <agent@recoupable.dev>`.",
  "requestBody": {
    "description": "Email payload",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/SendEmailRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Email sent successfully",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/EmailResponse"
          }
        }
      }
    },
    "400": {
      "description": "Validation error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Authentication required",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "502": {
      "description": "Email delivery failed",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}