Skip to Content

Create a newsletter

Creates an opt-in topic, or adopts topicId. Name is required when creating a topic.

POST
/v1/newsletters

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.

Authorization

apiKey
headerx-api-key<token>

Header Parameters

idempotency-key?string
Length1 <= length <= 255

Request Body

application/json
  1. body
topicId?|null
name?|null
description?string|null|null
namespaceId?|null|null
archiveEnabled?boolean|null
publicationSlug?|null|null

Response Body

Newsletter

application/json
  1. response
id*NewsletterId
Match^nl_[0-9a-hjkmnp-tv-z]{16,24}$
topicId*TopicId
Match^tpc_[0-9a-hjkmnp-tv-z]{16,24}$
namespaceId*|null
name*string
description*string|null
issueProjectId*|null
archiveEnabled*boolean
publicationSlug*|null
createdAt*string
updatedAt*string
Example Request
import { 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"
}

Related documentation