Publish a reusable email block
/v1/email/blocks/{block_id}/publish// Requires email_management:write permission in the target workspace.
const blockId = "ebl_01krdgeqcxet5s7t44vh8rt9mg";
const draft = await bird.email.blocks.languages.get(blockId, "en");
const submission = await bird.email.blocks.publish(blockId, {
languages: [{ language: "en", revision: draft.revision }],
});
console.log(submission.status, submission.published_revisions);# Requires email_management:write permission in the target workspace.
block_id = "ebl_01krdgeqcxet5s7t44vh8rt9mg"
draft = client.email.blocks.languages.get(block_id, "en")
submission = client.email.blocks.publish(
block_id,
languages=[{"language": "en", "revision": draft.revision}],
)
print(submission.status, submission.published_revisions)// Requires email_management:write permission in the target workspace.
client, err := bird.NewClient(option.WithAPIKey(os.Getenv("BIRD_API_KEY")))
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
blockID := "ebl_01krdgeqcxet5s7t44vh8rt9mg"
draft, err := client.Email.Blocks.Languages.Get(ctx, blockID, "en")
if err != nil {
log.Fatal(err)
}
submission, err := client.Email.Blocks.Publish(ctx, blockID, bird.EmailBlocksPublishParams{
Languages: []bird.EmailBlockPublishLanguage{{Language: "en", Revision: draft.Revision}},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(submission.Status, submission.PublishedRevisions)// Requires email_management:write permission in the target workspace.
$blockId = 'ebl_01krdgeqcxet5s7t44vh8rt9mg';
$draft = $bird->email->blocks->languages->get($blockId, 'en');
$params = (new \MessageBird\Wire\Model\EmailBlockPublish())
->setLanguages([
(new \MessageBird\Wire\Model\EmailBlockPublishLanguage())
->setLanguage('en')
->setRevision($draft->getRevision()),
]);
$submission = $bird->email->blocks->publish($blockId, $params);
echo $submission->getStatus();bird email blocks publish <block-id> --body-file - <<'JSON'
{
"languages": [
{
"language": "en",
"revision": 2
}
]
}
JSONcurl -X POST "https://us1.platform.bird.com/v1/email/blocks/{block_id}/publish" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"languages": [
{
"language": "en",
"revision": 2
}
]
}'{
"id": "ebs_01krdgeqcxet5s7t44vh8rt9mg",
"block_id": "ebl_01krdgeqcxet5s7t44vh8rt9mg",
"status": "published",
"languages": [
{
"language": "pt-BR",
"draft_revision": 8,
"candidate_revision_id": "ebr_01krdgeqcxet5s7t44vh8rt9mg"
}
],
"published_revisions": [
{
"language": "pt-BR",
"id": "ebr_01krdgeqcxet5s7t44vh8rt9mg",
"version_number": 3
}
],
"published_at": "2026-05-25T16:42:01Z",
"created_at": "2026-05-25T16:42:01Z"
}
Publishes the current drafts of the named languages, each with the draft revision you last read. All named languages publish together or none do. Saving a draft never publishes.
Templates that link the block in a published language use the new content for mail that starts afterwards, including broadcasts already scheduled. A message scheduled on its own keeps the content it was accepted with.
A draft saved after you read it returns a 409 conflict_error, and a draft with no unpublished changes or invalid section content returns a 422 validation_error. So does a publication that would remove the only unsubscribe link from a live marketing template; the error names up to ten of those templates.
A publication that makes live templates using the block require a new input the sender supplies returns a 409 conflict_error naming the inputs and up to ten templates. Unlike a stale draft, it asks for review: once those senders supply the inputs, repeat the same languages and revisions with confirm set to true, under a new idempotency key.
参数
block_idstringBlock to read or edit.
请求载荷
languagesLanguages to publish, each with the draft revision last read.
显示子参数
languages.languageA language tag in BCP-47 form, for example en or pt-BR.
languages.revisionDraft revision last read. A newer saved draft returns 409.
confirmPublish even though live templates that use this block will start requiring inputs this publication adds. Without it, such a publication returns 409 naming the inputs and templates.
响应载荷
idblock_idstatusWhere a block change is in its lifecycle. published means its revisions are live. New values may be added; treat an unknown value as not yet live.
Possible values (may grow over time): published
languagesEach included language, the draft revision it was taken from, and the snapshot frozen for it.
published_revisionsThe revisions that became live when this change was published.
published_atcreated_at