Subscribe to email lists

Subscribe a contact to one or more email lists. This is a public endpoint that doesn't require authentication. If the list has double opt-in enabled, a confirmation email will be sent.

post/subscribe

Request body

workspace_idstring required

The ID of the workspace

list_idsstring[] required

Array of list IDs to subscribe the contact to

Example request

{
  "workspace_id": "ws_1234567890",
  "contact": {
    "email": "user@example.com",
    "email_hmac": "a1b2c3d4e5f6...",
    "external_id": "user_12345",
    "timezone": "America/New_York",
    "language": "en-US",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "+15551234567",
    "address_line_1": "123 Main St",
    "address_line_2": "Apt 4B",
    "country": "US",
    "postcode": "10001",
    "state": "NY",
    "job_title": "Software Engineer",
    "lifetime_value": 1250.5,
    "orders_count": 5,
    "last_order_at": "2023-05-15T14:30:00Z",
    "custom_string_1": "Premium tier",
    "custom_number_1": 42,
    "custom_datetime_1": "2023-06-01T09:00:00Z",
    "custom_json_1": {
      "preferences": {
        "theme": "dark",
        "notifications": true
      }
    }
  },
  "list_ids": [
    "newsletter",
    "product_updates"
  ]
}

Response

Subscription successful

successboolean

Whether the subscription was successful

Example response

{
  "success": true
}

Changes