Skip to content
Browse documentation

API reference

Subscribers

Let a storefront capture newsletter subscribers and process unsubscribe requests. Submissions are attributed to the project.

Feature requirement: the project must have the newsletter feature enabled, or these endpoints return 404.

POST/api/v1/storefront/projects/{project_slug}/subscribe

Public Subscribe

Parameters
NameTypeInDescription
project_slugstringpathRequired.
Request body · SubscriberSubscribeCreate
FieldTypeDescription
emailstring<email>required—
namestring (nullable)optional—
sourcestring (nullable)optional—
Response 201 · SubscriberSubscribeRead
FieldTypeDescription
idstringrequired—
project_idstringrequired—
emailstring<email>required—
namestring (nullable)optional—
statusSubscriberStatusrequiredNewsletter subscriber lifecycle.
sourcestring (nullable)optional—
subscribed_atstring<date-time> (nullable)optional—
unsubscribed_atstring<date-time> (nullable)optional—
created_atstring<date-time>required—
updated_atstring<date-time>required—
unsubscribe_tokenstring (nullable)optional—
Example request
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/your-project/subscribe" \
  -H "X-Project-Key: wt_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "email": "…" }'
POST/api/v1/storefront/projects/unsubscribe

Public Unsubscribe

Request body · SubscriberUnsubscribeRequest
FieldTypeDescription
tokenstringrequired—
Response 200 · UnsubscribeMessage
FieldTypeDescription
messagestringrequired—
subscriber_idstring (nullable)optional—
Example request
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/unsubscribe" \
  -H "X-Project-Key: wt_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "token": "…" }'

← All resource groups