Update a reusable email block
/v1/email/blocks/{block_id}// Requires email_management:write permission in the target workspace.
const current = await bird.email.blocks.get("ebl_01krdgeqcxet5s7t44vh8rt9mg");
const block = await bird.email.blocks.update(current.id, {
revision: current.revision,
archived: true,
});
console.log(block.archived_at);# Requires email_management:write permission in the target workspace.
current = client.email.blocks.get("ebl_01krdgeqcxet5s7t44vh8rt9mg")
block = client.email.blocks.update(current.id, revision=current.revision, archived=True)
print(block.archived_at)// 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()
current, err := client.Email.Blocks.Get(ctx, "ebl_01krdgeqcxet5s7t44vh8rt9mg")
if err != nil {
log.Fatal(err)
}
block, err := client.Email.Blocks.Update(ctx, current.Id, bird.EmailBlocksUpdateParams{
Revision: int(current.Revision),
Archived: bird.Bool(true),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(block.ArchivedAt)// Requires email_management:write permission in the target workspace.
$blockId = 'ebl_01krdgeqcxet5s7t44vh8rt9mg';
$current = $bird->email->blocks->get($blockId);
$params = (new \MessageBird\Wire\Model\EmailBlockUpdate())
->setRevision($current->getRevision())
->setArchived(true);
$block = $bird->email->blocks->update($blockId, $params);
var_dump($block->getArchivedAt());bird email blocks update <block-id> --revision 1 --source-language pt-BRcurl -X PATCH "https://us1.platform.bird.com/v1/email/blocks/{block_id}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"revision": 1,
"source_language": "pt-BR"
}'{
"id": "ebl_01krdgeqcxet5s7t44vh8rt9mg",
"name": "Legal disclosure",
"source_language": "pt-BR",
"revision": 1,
"created_by": {
"id": "usr_01krdgeqcxet5s7t44vh8rt9mg",
"type": "user"
},
"created_at": "2026-05-20T09:14:52Z",
"updated_at": "2026-05-25T16:42:01Z"
}
Changes a block's name, description, archive state or source language, using the revision you last read. A stale revision returns a 409 conflict_error. The source language can change until the block is first published.
Templates that already link an archived block keep filling it, and new links to it are refused. Unarchive the block to link it again.
Parametry
block_idstringBlock to read or edit.
Treść żądania
revisionMetadata revision last read. A concurrent change returns 409.
nameNew name for the block.
descriptionReplacement maintenance notes. Send an empty string to clear them.
source_languageAn existing block language. It can change only before the first publication.
archivedArchive or unarchive the block. Archiving retains its content and history.
Treść odpowiedzi
idnameName for people choosing the block, such as when linking it into a template.
descriptionOptional notes for people maintaining the block. Omitted when empty.
source_languageA language tag in BCP-47 form, for example en or pt-BR.
revisionMetadata revision to send when editing or duplicating this block.
created_byWho created the block. A duplicate is created by whoever duplicated it.
archived_atPresent when the block is archived. Retained published content remains readable.
created_atupdated_atPowiązane zasoby
Przejdź do dokumentacji, przewodników i przykładów dotyczących tego tematu.