Search Documentation

Search for a documentation page...

Subscribers API

REST API endpoints for newsletter subscriber management.

Create Subscriber

POST /api/v1/subscribers

Adds an email address to the store's subscriber list. If the email is already subscribed, returns a 200 with { status: "already_subscribed" } instead of creating a duplicate.

Request Body

FieldTypeRequiredDescription
emailstringYesSubscriber email address
namestringNoSubscriber display name
curl -X POST \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"email": "jane@example.com", "name": "Jane Doe"}' \
https://your-store.yns.store/api/v1/subscribers

Response (201)

{
"id": "0191abc0-1234-7def-8000-000000000001",
"email": "jane@example.com",
"name": "Jane Doe",
"createdAt": "2024-06-15T10:30:00.000Z"
}

Already Subscribed (200)

{
"status": "already_subscribed"
}

Delete Subscriber

DELETE /api/v1/subscribers?email=jane@example.com

Unsubscribes an email address.

Query Parameters

ParameterTypeRequiredDescription
emailstringYesEmail to unsubscribe

Response

{
"status": "unsubscribed"
}