Api referenceNewsletterDomains

Add a publication domain (Preview)

Preview · Available to selected organizations. Claims a hostname for an opt-in topic with its public archive enabled and published.

POST
/v1/newsletters/{id}/domains

Claims a hostname for an opt-in topic with its public archive enabled and published. Requires newsletters. Pass the same Idempotency-Key header when retrying. The hostname serves no publication until Cloudflare confirms both ownership and SSL are active.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^nl_[0-9a-hjkmnp-tv-z]{16,24}$

Header Parameters

idempotency-key?|null

Request Body

application/json
  1. body
hostname*string
Match^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$
Lengthlength <= 253

Response Body

Success

application/json
  1. response
organizationId*OrganizationId
Match^org_[0-9a-hjkmnp-tv-z]{16,24}$
topicId*TopicId
Match^unsub_[0-9a-hjkmnp-tv-z]{16,24}$
hostname*string
Match^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$
Lengthlength <= 253
canonicalHostname*string
phase*string
Value in"pending""active""removing""removed""conflict"
active*boolean
hostnameStatus*string|null
sslStatus*string|null
cname*
verificationRecords*array<>
verificationErrors*array<string>
Example Request
import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.newsletters.domains.add({  "id": "example",  "hostname": "example"});
Example Response
{  "organizationId": "string",  "topicId": "string",  "hostname": "string",  "canonicalHostname": "string",  "phase": "pending",  "active": true,  "hostnameStatus": "string",  "sslStatus": "string",  "cname": {    "type": "CNAME",    "name": "string",    "value": "string"  },  "verificationRecords": [    {      "type": "CNAME",      "name": "string",      "value": "string"    }  ],  "verificationErrors": [    "string"  ]}