API REFERENCE
Send Email
On this page
/api/emailsSend 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 --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
subjectstringEmail 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.
textstringPlain text or Markdown body. Rendered as HTML via Markdown if no html is provided.
htmlstringRaw HTML body. Takes precedence over text when both are provided.
headersobjectOptional custom email headers
chat_idstringChat ID to include a chat link in the email footer. Use Create Chat to create one.
account_idstringUUID 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
successbooleanrequiredWhether the email was sent successfully
messagestringrequiredHuman-readable result message
idstringrequiredResend email ID
400Validation error+
application/json
errorintegerrequiredformat: int32
messagestringrequired401Authentication required+
application/json
errorintegerrequiredformat: int32
messagestringrequired502Email delivery failed+
application/json
errorintegerrequiredformat: int32
messagestringrequiredFull specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download accounts.jsonView operation source
{
"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"
}
}
}
}
}
}