API Reference

Update topic

PATCH /topics/:id — rename a topic or change its description.

PATCH/topics/:id
Path parameters
topic_idstringrequired

The topic ID.

Body parameters
namestringoptional

New display name (max 255 chars).

descriptionstringoptional

New description shown on the preference page.

visibilitystringoptional

New visibility on the preference page: public or private.

The default_subscription (opt-in vs opt-out) is fixed at creation and cannot be updated.
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('mb_xxxxxxxxx');

const { data, error } = await mb.topics.update('topic_9a2f...', { "name": "Newsletter" });
console.log({ data, error });