Confirm a pending newsletter subscription
const url = 'https://your-tenant-host/v1/newsletters/confirm';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-tenant-host/v1/newsletters/confirm \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'Flips pending → subscribed for the one list the token names, and does nothing on any other state. One-time use comes from the subscription state, never from the token: a replayed link finds nothing pending and answers confirmed: false at 200, the same as a first click that already worked. The site comes from the verified token and nowhere else, because an emailed link carries no x-edgekit-site-id header. Safe to retry, for the same reason.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The signed token from the confirmation link, carrying (userId, listId, siteId, exp). One-time use comes from the subscription state, not from the token: confirming flips pending → subscribed, so a replayed link finds nothing pending and does nothing.
Example generated
{ "token": "example"}Responses
Section titled “Responses”The list, and whether this request is what moved it.
object
Whether this request is what confirmed the subscription. false for a replay, and still a 200.
object
The list’s id (UUIDv7). A list is named by its id, never by its slug.
^[a-z][a-z0-9_]*$, unique per site: two sites in one organization can both run a morning_briefing, so it is not unique per tenant.
What a preference centre renders and what the confirmation email says it is confirming. Tenant-authored, staged and deployed.
A sentence, or null. Shown in the confirmation email beside the label; without it, somebody subscribing to two lists gets two identical emails.
Example
{ "list": { "id": "01999b1e-7a40-7c2d-9e51-2a4c8d0f6b31", "slug": "morning_briefing", "label": "The Morning Briefing" }}Invalid request.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Resource not found.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Request validation failed.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}Unexpected error.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}With Retry-After, briefly unavailable; without it, not configured.
object
object
Example
{ "error": { "code": "unauthorized", "message": "Invalid or missing API key." }}