Skip to main content

Email

Email broadcasts and subscriber management. All endpoints require authentication.

GET /email/broadcasts

List all broadcasts.

curl https://api.paylinks.ro/api/v1/email/broadcasts \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

[
{
"id": "bc-001",
"subject": "New Product Launch",
"body": "<h1>Exciting news!</h1>...",
"status": "SENT",
"recipientCount": 150,
"sentAt": "2026-02-15T10:00:00.000Z",
"createdAt": "2026-02-15T09:00:00.000Z"
}
]

POST /email/broadcasts

Create a new broadcast (saved as draft).

curl -X POST https://api.paylinks.ro/api/v1/email/broadcasts \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"subject": "New Product Launch",
"body": "<h1>Exciting news!</h1><p>We just launched a new course.</p>"
}'

Request Body:

FieldTypeRequiredDescription
subjectstringYesEmail subject line
bodystringYesHTML email body

Response (201): Broadcast object with status: "DRAFT".


GET /email/broadcasts/:id

Get a single broadcast.

curl https://api.paylinks.ro/api/v1/email/broadcasts/bc-001 \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200): Full broadcast object.


POST /email/broadcasts/:id/send

Send a broadcast to all subscribers.

curl -X POST https://api.paylinks.ro/api/v1/email/broadcasts/bc-001/send \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"message": "Broadcast queued for sending",
"recipientCount": 150
}

POST /email/broadcasts/ai-draft

Generate a broadcast using AI.

curl -X POST https://api.paylinks.ro/api/v1/email/broadcasts/ai-draft \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"prompt": "Announce our new subscription plans starting at 29.99 RON/month"}'

Response (200): Broadcast object with AI-generated subject and body.


GET /email/subscribers

List email subscribers.

curl "https://api.paylinks.ro/api/v1/email/subscribers?limit=50" \
-H "Authorization: Bearer YOUR_TOKEN"

Response (200):

{
"data": [
{
"id": "sub-email-001",
"email": "[email protected]",
"name": "Maria Ionescu",
"subscribedAt": "2026-01-10T10:00:00.000Z"
}
],
"nextCursor": null,
"hasMore": false
}

POST /email/subscribers

Add a single subscriber.

curl -X POST https://api.paylinks.ro/api/v1/email/subscribers \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "name": "Ion"}'

Response (201):

{"id": "sub-email-002", "email": "[email protected]"}

POST /email/subscribers/bulk

Add multiple subscribers at once.

curl -X POST https://api.paylinks.ro/api/v1/email/subscribers/bulk \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"subscribers": [
{"email": "[email protected]", "name": "Alice"},
{"email": "[email protected]", "name": "Bob"}
]
}'

Response (200):

{"added": 2, "skipped": 0}

The skipped count represents subscribers that already exist.