Skip to content

Where one person stands on every list

GET
/v1/newsletters/subscriptions
curl --request GET \
--url https://your-tenant-host/v1/newsletters/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'x-edgekit-site-id: site_example'

Answers every deployed list for the site, including lists this person has no record on. Those answer unknown, so one call powers a preference centre with no client-side join against /lists. The subject comes from the credential: an EdgeKit session or a verified upstream credential names it, an API key names it with userId, and an anonymous caller names nobody and gets unknown throughout rather than a refusal.

userId

Who to answer for. Allowed only under an API key; a 400 on every other credential, which names its own subject. An anonymous caller names nobody and gets unknown for every deployed list rather than a refusal, so the route cannot be used to probe who is subscribed.

string
>= 1 characters

Who to answer for. Allowed only under an API key; a 400 on every other credential, which names its own subject. An anonymous caller names nobody and gets unknown for every deployed list rather than a refusal, so the route cannot be used to probe who is subscribed.

x-edgekit-site-id
required

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

string
>= 1 characters <= 128 characters

Example

site_example

The site this request is for, within this tenant. Every official EdgeKit SDK sets it from the client you configured; set it yourself only when calling this API directly.

Every deployed list for this site, each with a status.

Media typeapplication/json
object
subscriptions
required

Every deployed list for the site, including those this person has no record on. On a PUT this is the full resulting set, which shows what a full replacement removed: a client that renders four lists and sends four ids has just unsubscribed the fifth.

Array<object>
object
id
required

The list’s id (UUIDv7). A list is named by its id, never by its slug.

string format: uuid
slug
required

^[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.

string
label
required

What a preference centre renders and what the confirmation email says it is confirming. Tenant-authored, staged and deployed.

string
description
required

A sentence, or null. Shown in the confirmation email beside the label; without it, somebody subscribing to two lists gets two identical emails.

string | null
status
required

unknown means EdgeKit has no record of this person on this list. pending is double opt-in’s: the address was given and the confirmation link has not been clicked yet. A pending address is never sent to the delivery vendor. Open: render an unknown member as unknown.

string

Example

{
"subscriptions": [
{
"id": "01999b1e-7a40-7c2d-9e51-2a4c8d0f6b31",
"slug": "morning_briefing",
"label": "The Morning Briefing",
"status": "subscribed"
}
]
}

Invalid request.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Missing or invalid credential.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Not allowed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Resource not found.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Request validation failed.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}

Unexpected error.

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details

Example

{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key."
}
}