Create a newsletter
Creates an opt-in topic, or adopts topicId. Name is required when creating a topic.
POST
Creates an opt-in topic, or adopts topicId. Name is required when creating a topic. A topic belongs to at most one newsletter. Sending defaults and subscriptions belong to the topic.
apiKeyheader
x-api-key<token>idempotency-key?stringLength
1 <= length <= 255application/json- body
topicId?|nullname?|nulldescription?string|null|nullnamespaceId?|null|nullarchiveEnabled?boolean|nullpublicationSlug?|null|nullNewsletter
application/json- response
id*NewsletterIdMatch
^nl_[0-9a-hjkmnp-tv-z]{16,24}$topicId*TopicIdMatch
^tpc_[0-9a-hjkmnp-tv-z]{16,24}$namespaceId*|nullname*stringdescription*string|nullissueProjectId*|nullarchiveEnabled*booleanpublicationSlug*|nullcreatedAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.newsletters.create({});Example Response
{
"id": "string",
"topicId": "string",
"namespaceId": "string",
"name": "string",
"description": "string",
"issueProjectId": "string",
"archiveEnabled": true,
"publicationSlug": "string",
"createdAt": "string",
"updatedAt": "string"
}