Translate an email
POST/v1/templates/translate
Writes a translation of a subject, HTML and plain text into another language, such as fr-CA for Canadian French, and returns it for you to review. Nothing is saved: put the result in a template’s translations or a broadcast’s translations. Merge tags ({{{FIRST_NAME|there}}}, {{#if}} blocks) and link addresses are checked to be unchanged, and the result is refused if one was lost. It runs on your own AI service key (Anthropic, Google Gemini or OpenAI), saved under Settings, Translation, so the cost is billed to your own account. Limited to a few a minute.
Required scope: templates:manage
Example
curl -X POST 'https://api.sendsend.email/v1/templates/translate' \
-H "Authorization: Bearer $SENDSEND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"to": "fr-CA",
"subject": "Welcome, {{{FIRST_NAME|there}}}",
"html": "<p>Thanks for joining.</p>"
}'Response 200
{
"object": "translation",
"language": "fr-CA",
"subject": "Bienvenue, {{{FIRST_NAME|vous}}}",
"html": "<p>Merci de vous être joint à nous.</p>"
}Errors
| Status | Code | When |
|---|---|---|
| 400 | validation_error | The request body or parameters are invalid. The message says which field. |
| 401 | unauthorized | The API key is missing, invalid or revoked. |
| 403 | forbidden | The key does not have the scope this endpoint needs. |
| 429 | rate_limited | Too many requests. Wait for the number of seconds in the Retry-After header. |
Every error has the same shape. See Errors.