9. API Request Description: Create a Subscriber with Subscription Intent Confirmation

The method is designed to create a new subscriber in the project with subscription confirmation by the subscriber themselves. This is well suited for public subscription forms on websites where any email can be entered. The Sender Solutions system will send this subscriber an email so that they can separately confirm that they want to receive the newsletter. This will protect the subscriber base from accidental or intentional errors when entering an email address. Data is transmitted in application/json format.

HTTP Request
  • URL: https://sender-solutions.com/api/subscribers/subscribe-action/
  • HTTP Method: POST
  • Content-Type: application/json
Request Body (JSON)
{
    "Subscriber": {
        "Base": {
            "Id": 0,
            "Name": "Test Users"
        },
        "IsActive": true,
        "Email": "username@example.com",
        "FirstName": "Cat",
        "LastName": "Catstone",
        "Tags": ["api", "test-user"],
        "ClientUserId": "ClientUserId3",
        "CustomField1": "CustomValue1",
        "CustomField2": "CustomValue2",
        "CustomField3": "CustomValue3",
        "Address": {
            "Country": "UA",
            "City": "Odesa",
            "State": null,
            "Zip": 65000,
            "Line1": "Very Long street",
            "Line2": "building 42",
            "Line3": null
        }
    },
    "PreferredLanguage": "en"
}
Example request using cURL

curl --location 'https://sender-solutions.com/api/subscribers/subscribe-action/' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{api-token}}' \
--data-raw '{
    "Subscriber": {
        "Base": {
            "Id": 0,
            "Name": "Test Users"
        },
        "IsActive": true,
        "Email": "username@example.com",
        "FirstName": "Cat",
        "LastName": "Catstone",
        "Tags": ["api", "test-user"],
        "ClientUserId": "ClientUserId3",
        "CustomField1": "CustomValue1",
        "CustomField2": "CustomValue2",
        "CustomField3": "CustomValue3",
        "Address": {
            "Country": "UA",
            "City": "Odesa",
            "State": null,
            "Zip": 65000,
            "Line1": "Very Long street",
            "Line2": "building 42",
            "Line3": null
        }
    },
    "PreferredLanguage": "en"
}'
Field Descriptions
Field Type Required Description
Subscriber.Base.Id number Subscriber Base ID. This field or Subscriber.Base.Name must be provided. If both fields are passed with non-empty values, priority is given to Subscriber.Base.Id
Subscriber.Base.Name string Subscriber Base Name. This field or Subscriber.Base.Id must be provided. If both fields are passed with non-empty values, priority is given to Subscriber.Base.Id
Subscriber.IsActive boolean Subscriber active flag. After subscription confirmation, the subscriber will be active. This field can be ignored.
Subscriber.Email string Subscriber's email
Subscriber.FirstName string First name
Subscriber.LastName string Last name
Subscriber.Gender string Subscriber gender. Possible values: "male" for male, "female" for female, "" (empty string) for "Not specified". Default is "Not specified"
Subscriber.Phone string Phone number
Subscriber.Tags array[string] Subscriber tags, array of strings
Subscriber.ClientUserId string Subscriber ID in the client's system
Subscriber.CustomField1 string Custom field 1. You can store any information here.
Subscriber.CustomField2 string Custom field 2. You can store any information here.
Subscriber.CustomField3 string Custom field 3. You can store any information here.
Subscriber.Address.Country string Two-letter country code (ISO 3166-1 alpha-2)
Subscriber.Address.City string City
Subscriber.Address.State string | null Region / state / province
Subscriber.Address.Zip number Postal code
Subscriber.Address.Line1 string Address line 1
Subscriber.Address.Line2 string Address line 2
Subscriber.Address.Line3 string | null Address line 3
Subscriber.Birthday string (YYYY-MM-DD) Date of birth in YYYY-MM-DD format
PreferredLanguage string Preferred language code for emails sent to the subscriber in ISO 639-1 format. Must contain 2 lowercase Latin letters (e.g.: en, uk, ru). By default en
Successful Response Example. Receiving a successful response means that a confirmation email has been sent to the subscriber. They must follow the link in the email to confirm their subscription.
{
    "success": true
}