Subscribe a new email address to receive newsletter updates. This is a public endpoint that does not require authentication.
Request Body
The email address to subscribe to the newsletter. Must be a valid email format.Validation:
- Must be a valid email address
- Cannot be empty
Response
The unique identifier of the newsletter subscriber
The subscribed email address
Whether the subscription is active (defaults to true)
ISO 8601 timestamp of when the subscription was created
Examples
curl -X POST https://api.example.com/newsletter/subscribe \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]"
}'
{
"id": 42,
"email": "[email protected]",
"isActive": true,
"createdAt": "2026-03-10T14:30:00.000Z"
}
Error Codes
| Status Code | Description |
|---|
| 201 | Successfully subscribed to newsletter |
| 400 | Invalid request body or email format |
| 409 | Email address is already subscribed |
| 500 | Internal server error |
Notes
- Email addresses are unique - attempting to subscribe the same email twice will result in a 409 Conflict error
- Email validation follows standard RFC 5322 format
- New subscriptions are automatically set to active status
- This endpoint is public and does not require authentication