Upsert a reusable block language
/v1/email/blocks/{block_id}/languages/{language}// Requires email_management:write permission in the target workspace.
const section =
'<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tbody><tr>' +
'<td lang="fr" style="font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; ' +
"line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;\">" +
'<p style="margin: 0;">Offre valable jusqu\'au {{ expiry_date }}.</p></td></tr></tbody></table>';
const draft = await bird.email.blocks.languages.set("ebl_01krdgeqcxet5s7t44vh8rt9mg", "fr", {
revision: 0,
fragment: { serializer_version: 2, fragment_html: section },
});
console.log(draft.revision);# Requires email_management:write permission in the target workspace.
section = (
'<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tbody><tr>'
'<td lang="fr" style="font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; '
'line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;">'
"<p style=\"margin: 0;\">Offre valable jusqu'au {{ expiry_date }}.</p></td></tr></tbody></table>"
)
draft = client.email.blocks.languages.set(
"ebl_01krdgeqcxet5s7t44vh8rt9mg",
"fr",
revision=0,
fragment={"serializer_version": 2, "fragment_html": section},
)
print(draft.revision)// Requires email_management:write permission in the target workspace.
section := `<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tbody><tr>` +
`<td lang="fr" style="font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; ` +
`line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;">` +
`<p style="margin: 0;">Offre valable jusqu'au {{ expiry_date }}.</p></td></tr></tbody></table>`
client, err := bird.NewClient(option.WithAPIKey(os.Getenv("BIRD_API_KEY")))
if err != nil {
log.Fatal(err)
}
draft, err := client.Email.Blocks.Languages.Set(context.Background(), "ebl_01krdgeqcxet5s7t44vh8rt9mg", "fr",
bird.EmailBlocksLanguagesSetParams{
Revision: 0,
Fragment: &bird.EmailBlockFragment{SerializerVersion: 2, FragmentHtml: section},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(draft.Revision)// Requires email_management:write permission in the target workspace.
$section = '<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tbody><tr>'
. '<td lang="fr" style="font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; '
. 'line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;">'
. '<p style="margin: 0;">Offre valable jusqu\'au {{ expiry_date }}.</p></td></tr></tbody></table>';
$params = (new \MessageBird\Wire\Model\EmailBlockLanguageUpsert())
->setRevision(0)
->setFragment((new \MessageBird\Wire\Model\EmailBlockFragment())
->setSerializerVersion(2)
->setFragmentHtml($section));
$draft = $bird->email->blocks->languages->set('ebl_01krdgeqcxet5s7t44vh8rt9mg', 'fr', $params);
echo $draft->getRevision();bird email blocks languages set <block-id> <language> --body-file - <<'JSON'
{
"revision": 1,
"fragment": {
"serializer_version": 2,
"fragment_html": "<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tbody><tr><td lang=\"en\" style=\"font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;\"><p style=\"margin: 0;\">Your disclosure text.</p></td></tr></tbody></table>"
}
}
JSONcurl -X PUT "https://us1.platform.bird.com/v1/email/blocks/{block_id}/languages/{language}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"revision": 1,
"fragment": {
"serializer_version": 2,
"fragment_html": "<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tbody><tr><td lang=\"en\" style=\"font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;\"><p style=\"margin: 0;\">Your disclosure text.</p></td></tr></tbody></table>"
}
}'{
"language": "en",
"revision": 2,
"authoring_mode": "html",
"published_revision_id": "ebr_01krdgeqcxet5s7t44vh8rt9mg",
"fragment": {
"serializer_version": 2,
"fragment_html": "<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tbody><tr><td lang=\"en\" style=\"font-family: Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 20px; letter-spacing: normal; text-align: left; text-transform: none; color: #333333; margin: 0; padding: 16px;\"><p style=\"margin: 0;\">Your disclosure text.</p></td></tr></tbody></table>"
},
"created_at": "2026-05-20T09:14:52Z",
"updated_at": "2026-05-25T16:42:01Z"
}
Replaces one language's draft with a complete section, or copies a published revision back into the draft with from_revision_id. Send the draft revision you last read, or 0 to add a language. A stale revision returns a 409 conflict_error.
Unfinished content can be saved, and saving never publishes. A language keeps the authoring mode of its first section, so a section in the other mode returns a 422 validation_error.
पैरामीटर
block_idstringBlock to read or edit.
languagestringExact block language as a BCP-47 tag. No fallback is applied.
Request Payload
revisionDraft revision last read, or zero to create a missing language. A concurrent change returns 409.
fragmentOne self-contained email section. Version 2 is a section written as HTML and sends fragment_html alone; the API, SDKs, CLI and MCP write version 2. Version 1 is reserved for sections built in the Bird dashboard's visual editor, and only the dashboard saves it. A block language keeps the version it was created with.
source_revision_idPublished source-language revision this translation was made from. Accepted with fragment only; leaving it out clears the reference.
from_revision_idPublished revision of this language to copy back into the draft, sent instead of fragment. Copying never publishes.
Response Payload
languageA language tag in BCP-47 form, for example en or pt-BR.
revisionDraft revision to send back when saving or publishing this language, as last returned. It is not a publication number; a published revision is a separate record numbered by version_number.
authoring_modeHow this language is edited. html content is written as HTML and can be changed through the API, CLI and MCP. visual content is built in the Bird dashboard's visual editor; outside the dashboard, a visual section can still be copied by duplicating its block or restoring a published revision. The mode follows from the stored content and cannot be set directly. New values may be added; treat an unknown value as content you cannot edit through the API, CLI or MCP.
Possible values (may grow over time): visual, html
source_revision_idPublished source-language revision used for this translation. Omitted when untracked.
published_revision_idCurrent published revision for this exact language. Omitted before publication.
fragmentOne self-contained email section. Version 2 is a section written as HTML and sends fragment_html alone; the API, SDKs, CLI and MCP write version 2. Version 1 is reserved for sections built in the Bird dashboard's visual editor, and only the dashboard saves it. A block language keeps the version it was created with.
created_atupdated_atसंबंधित संसाधन
इस विषय के लिए दस्तावेज़, गाइड और उदाहरणों के साथ आगे बढ़ें।