for Business

Pilot developer guide

Translate, then send.

One call sits in front of the send you already have. You give Franca the email and who it's for, and you get the same email back in that person's language. Then you send it with your own email service, from your own domain, exactly as before.

Quick start

Every call carries your key: Authorization: Bearer fr_test_…. During the pilot you get a test key from us. Keep it on your server, never in a web page or an app.

curl {BASE}/v1/email/translate \
  -H "Authorization: Bearer $FRANCA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "pt-BR",
    "subject": "Your booking is confirmed, {{first_name}}",
    "html": "<h1>See you soon, {{first_name}}!</h1><p>Check-in is from <b>3 pm</b>. <a href=\"https://example.com/b/{{id}}\">Manage your booking</a></p>",
    "text": "See you soon, {{first_name}}! Check-in is from 3 pm."
  }'

You get back:

{
  "language": "Portuguese (Brazil)",
  "code": "pt-BR",
  "dir": "ltr",
  "subject": "Sua reserva está confirmada, {{first_name}}",
  "html": "<h1>Até breve, {{first_name}}!</h1><p>O check-in é a partir das <b>15h</b>. <a href=\"https://example.com/b/{{id}}\">Gerencie sua reserva</a></p>",
  "text": "Até breve, {{first_name}}! O check-in é a partir das 15h.",
  "warnings": [],
  "usage": { "counted": 1, "month": "2026-11", "emails": 42, "limit": 300 }
}

to takes a language code (pt-BR, ja, es-MX, zh-Hant, ar) or a name (Japanese). Franca reads and writes 174 languages; GET /v1/email/languages lists them. Send subject, html and text, or any one of them.

Contacts: save the language once

If your contact list already has a language for each person, pass it as to and skip this. If it doesn't, Franca can remember it for you. Use your own id for each contact, whatever you already use.

curl {BASE}/v1/email/contacts \
  -H "Authorization: Bearer $FRANCA_KEY" -H "Content-Type: application/json" \
  -d '{ "contacts": { "cus_1041": "pt-BR", "cus_1042": "ja", "cus_1043": "ar" } }'

# then, for one person
curl {BASE}/v1/email/translate \
  -H "Authorization: Bearer $FRANCA_KEY" -H "Content-Type: application/json" \
  -d '{ "contact": "cus_1042", "subject": "Your invoice", "html": "…" }'

Franca doesn't keep your ids. It keeps a one-way fingerprint of each id with the language beside it, so a name or an email address used as an id can't be read back by anyone.

One email, many languages

For a newsletter or an announcement, translate once per language, not once per person. Give a list of languages, or a list of contacts and Franca groups them for you. Up to 10 languages in one call.

curl {BASE}/v1/email/translate \
  -H "Authorization: Bearer $FRANCA_KEY" -H "Content-Type: application/json" \
  -d '{ "to": ["pt-BR", "ja", "ar", "de", "hi"], "from": "en", "subject": "…", "html": "…" }'
{
  "translations": [
    { "language": "Portuguese (Brazil)", "code": "pt-BR", "dir": "ltr", "subject": "…", "html": "…", "warnings": [] },
    { "language": "Japanese", "code": "ja", "dir": "ltr", "subject": "…", "html": "…", "warnings": [] },
    { "language": "Arabic", "code": "ar", "dir": "rtl", "subject": "…", "html": "…", "warnings": [] }
  ],
  "usage": { "counted": 5, "month": "2026-11", "emails": 47, "limit": 300 }
}

With "contacts": ["cus_1041", "cus_1042", …] each translation also lists the contacts who read that language, and unknown_contacts names anyone with no language saved, so you can send them the original.

Examples

Node, with any email service

async function inTheirLanguage(email, language) {
  const r = await fetch('{BASE}/v1/email/translate', {
    method: 'POST',
    headers: { authorization: `Bearer ${process.env.FRANCA_KEY}`, 'content-type': 'application/json' },
    body: JSON.stringify({ ...email, to: language })
  });
  if (!r.ok) return email;               // if anything goes wrong, send the original
  const { subject, html, text } = await r.json();
  return { ...email, subject, html, text };
}

const email = await inTheirLanguage({ subject, html, text }, customer.language);
await yourEmailService.send({ to: customer.email, ...email });   // SendGrid, Mailgun, Postmark, SES, SMTP…

Python

import os, requests

def in_their_language(email, language):
    r = requests.post("{BASE}/v1/email/translate",
        headers={"Authorization": f"Bearer {os.environ['FRANCA_KEY']}"},
        json={**email, "to": language}, timeout=90)
    return {**email, **{k: r.json()[k] for k in email}} if r.ok else email

Resend: a contact property called language

Give your contacts a language property in Resend. For one email to one person, read it and translate before you send:

import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);

const { data: contact } = await resend.contacts.get({ email: 'mariana@example.com' });
const email = await inTheirLanguage({ subject, html, text }, contact.properties?.language ?? 'en');
await resend.emails.send({ from: 'Casa Azul <hello@casa-azul.example>', to: contact.email, ...email });

For a broadcast, keep one segment per language, translate once, and create one broadcast per segment. Resend's own tags, {{{FIRST_NAME|there}}} and {{{RESEND_UNSUBSCRIBE_URL}}}, come back untouched, so each person still gets their own name and their own unsubscribe link.

const segments = { 'pt-BR': 'seg_brazil', ja: 'seg_japan', ar: 'seg_gulf', de: 'seg_dach' };

const r = await fetch('{BASE}/v1/email/translate', {
  method: 'POST',
  headers: { authorization: `Bearer ${process.env.FRANCA_KEY}`, 'content-type': 'application/json' },
  body: JSON.stringify({ to: Object.keys(segments), from: 'en', subject, html, text })
});
const { translations } = await r.json();

for (const t of translations) {
  if (t.error) continue;                 // that language keeps the original; try it again later
  const { data } = await resend.broadcasts.create({
    segmentId: segments[t.code], from: 'Casa Azul <hello@casa-azul.example>',
    subject: t.subject, html: t.html, text: t.text
  });
  await resend.broadcasts.send(data.id);
}

What is never changed

Franca reads only the words people see. Everything else is held back, never leaves your email, and is put back exactly where it was.

In your emailWhat happens
Layout, tables, styles, classesUntouched. Media queries and Outlook's conditional code too.
LinksEvery address stays as it is: unsubscribe, tracking, mailto:. Only the words of the link are translated.
Merge tags and template codeKept character for character: {{name}}, {{{name}}}, {% if %}, *|FNAME|*, %recipient.name%, ${name}, <%= name %>, {name}.
PicturesUntouched. The alt text is translated.
Web and email addresses, codesKept. So is anything inside <code> or <pre>.
Names you want left aloneWrap them in translate="no" or class="notranslate", or list them in keep.
Right to left languagesdir="rtl" is set on <html> and <body>, and lang on <html>. Send "direction": false to switch that off.

Every answer is checked before it reaches you. If a link, a piece of formatting or a merge tag went missing from a paragraph, that paragraph is translated again. If it fails twice it comes back in your original words and is named in warnings, so an email is never returned broken. As a last check the whole email, with its words taken out, has to match the one you sent.

Reference

POST /v1/email/translate

FieldWhat it is
subjectUp to 400 characters.
htmlUp to 400,000 characters.
textThe plain-text part, up to 100,000 characters. Line breaks are kept.
toA language code or name, or a list of up to 10.
contactOne saved contact id, in place of to.
contactsA list of saved contact ids (up to 5,000), grouped by language for you.
fromOptional. The language the email is written in. A reader of the same language gets it back unchanged and it isn't counted.
toneOptional. formal or informal. Left out, Franca uses what suits the language and a business email.
keepOptional. A list of words and names never to translate.
directionOptional. false leaves dir alone.

POST /v1/email/contacts

{ "contacts": { "your id": "language" }, "remove": ["your id"] }. Up to 5,000 in a call. GET /v1/email/contacts?id=… returns the language saved for one.

GET /v1/email/usage

This month's emails, characters and languages for your key, and your limit. One email in one language counts as one.

GET /v1/email/languages

Every language with its code and direction. No key needed.

When something is wrong

Errors come back as { "error": "what happened", "code": "…" }.

StatusCodeWhat to do
400unknown_language, missing_language, invalid_email, too_long, too_manyFix the request.
401invalid_keyCheck the key.
404unknown_contactSave a language for that contact, or pass to.
429rate_limited, monthly_limitWait a minute, or ask us to raise the limit.
502translation_failed, server_errorTry again, or send the original. Nothing is counted.

A call takes a few seconds for a normal email and can take up to a minute and a half for a very long one in many languages, so give it a 90 second timeout. Up to 60 calls a minute per key.

Privacy

Franca doesn't keep your emails. The words are translated and handed straight back, and nothing of the email is written to our store or our logs. What we do keep, per key: how many emails and characters you translated each month and in which languages, and, if you use contacts, a one-way fingerprint of each id with its language. That store is in the EU.