Skip to content

Newsletter Subscribe

Subscribe an email address to the newsletter.

Endpoint

POST /newsletter/subscribe

Request

Headers

Content-Type: application/json

Body

json
{
  "email": "user@example.com"
}

Parameters

FieldTypeRequiredDescription
emailstringYesValid email address to subscribe

The body must be a JSON object. email is validated by VineJS as a required email string; no other request fields are used.

Response

Success (201 Created)

json
{
  "messages": [
    {
      "title": "Successfully subscribed to the newsletter."
    }
  ]
}

Error (422 Unprocessable Entity)

json
{
  "errors": [
    {
      "field": "email",
      "message": "The email field must be a valid email address",
      "code": "input.email.email"
    }
  ]
}

Error (409 Conflict)

json
{
  "errors": [
    {
      "message": "Subscriber already exists",
      "code": "common.resource.conflict"
    }
  ]
}

Error (500 Internal Server Error)

A provider failure returns the application error envelope with code common.server.internal. The message is the caught provider error message when the provider throws an Error; otherwise it is Failed to subscribe to the newsletter.

json
{
  "errors": [
    {
      "message": "Failed to subscribe to the newsletter.",
      "code": "common.server.internal"
    }
  ]
}

Notes

  • No authentication required (public endpoint)
  • Contact creation completes before the welcome email is sent.
  • A failure in either step prevents the 201 response.
  • Duplicate subscriptions return 409 Conflict.
  • The route-level limit is 30 requests per IP address per minute and is disabled in tests.

Built with ❤️ by the Jubiloop team