Creating Clients

Use the create method to create a client entry (i.e. a recipient) with an EXT_USER_ID attribute (an external ID) to further add them to broadcasts. If the request is successful, you will receive a response with code 200 from the server.

URL

To use the method, send a POST request to api/subscribers/create.

Request Parameters

ParameterTypeDescription
blacklistedbooleanIndicates whether the client needs to be excluded from broadcasts. true — the client is “blacklisted” and does not receive broadcast, false — the client receives broadcasts.
addressesarrayArray of the client’s addresses/identifiers.
addressstringClient’s phone number
typestringClient’s identifier type:
• INSTAGRAM_ID
• FACEBOOK_ID
• DEVICE_APP_ID
• PHONE
• EMAIL
• UTM
• COOKIE_ID
• TELEGRAM_ID 
• GOOGLE_ID
• APPLE_ID
• YANDEX_ID
• EXT_USER_ID

The EXT_USER_ID parameter is required to use this method.
parameterValuesarrayArray of parameters
namestringParameter name
valueTypestringParameter type (STRING/ENUM/DATE)
valuestringParameter value
tagValuesarrayArray of tags
namestringTag’s name (the tag must be created in advance)

Request Example

{
    "blacklisted": false,
    "addresses": [
        {
            "address": "79991234567",
            "type": "PHONE"
        },
        {
            "address": "any_string",
            "type": "EXT_USER_ID"
        }
    ],
    "parameterValues": [
        {
            "name": "Name",
            "valueType": "STRING",
            "value": "Alex"
        },
        {
            "name": "Surname",
            "valueType": "STRING",
            "value": "Johhson"
        },
        {
            "name": "Middle name",
            "valueType": "STRING",
            "value": "James"
        },
        {
            "name": "Gender",
            "valueType": "ENUM",
            "value": "MALE"
        },
        {
            "name": "City",
            "valueType": "STRING",
            "value": "London"
        },
        {
            "name": "Birthday",
            "valueType": "DATE",
            "value": "1999-12-29"
        }
    ],
    "tagValues": [
        {
            "name": "new_tag"
        }
    ]
}
Pay attention to this code block:

{
"address": "any_string",
"type": "EXT_USER_ID"
}

This block contains the identifier that you can use to refer to the client’s entry to further update or remove it. In the address variable, you can specify any string: phone number, internal identifier, UUID, etc. You must take note of the identifier and store it by yourself, otherwise you will not be able to update or remove the entry.

Curl Example

curl --location --request POST 'https://app.edna.io/api/subscribers/create' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_secret_key' \
--data-raw '{
    "your",
    "pretty",
    "json"
}'