Skip to main content
POST
/
api
/
v1
/
subscribers
Create a subscriber
curl --request POST \
  --url https://api.railmail.app/api/v1/subscribers \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "email": "jane@example.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "topicKeys": [
    "APIT-1",
    "APIT-2"
  ],
  "consent": {
    "source": "checkout-form",
    "sourceUrl": "https://shop.example.com/checkout",
    "ipAddress": "203.0.113.10",
    "userAgent": "Mozilla/5.0",
    "consentText": "I agree to receive product updates",
    "formVersion": "v3"
  },
  "customFields": {
    "plan": "pro"
  }
}
'
{
  "subscriberKey": "SUB-1A2B",
  "email": "jane@example.com",
  "firstName": "Jane",
  "lastName": "Doe",
  "phone": null,
  "status": "ACTIVE",
  "source": "API",
  "createdAt": "2026-06-24T10:15:00Z",
  "updatedAt": "2026-06-24T10:15:00Z"
}

Authorizations

X-API-Key
string
header
required

Project-scoped API key, format rm_(live|test)_... . May also be sent as Authorization: Bearer rm_....

Body

application/json
email
string<email>
required
topicKeys
string[]
required
Minimum array length: 1
firstName
string | null
Maximum string length: 50
lastName
string | null
Maximum string length: 50
phone
string | null
Maximum string length: 20
customFields
object

Response

Subscriber created

subscriberKey
string | null
email
string<email>
firstName
string | null
lastName
string | null
phone
string | null
status
string
source
string | null
createdAt
string<date-time>
updatedAt
string<date-time>