/
Ability to create an email account on the platform via an API request

Ability to create an email account on the platform via an API request

 

RU

 

UA

US

RU

 

 

Creation rules:

Data for creating an account can be transmitted: email (required field), phone (optional field (do not record if not validated)), name (optional field)
If only the email string is loaded, an account is created with a contact email and a name equal to email
If the email string does not pass validation, the account is not created.
Response example

{

    "status": 0,

    "error": {

        "fields": {

            "data/0/email": "WRONG_EMAIL"

        },

        "code": "FORMAT_ERROR"

    }

}

 

4. The case is when there is already a linked email account with the same email and the same connection. Then you need to ignore it.

 

Response example: (аналогичен обычному ответу)

{

    "data": {

        "count_to_process": 1

    },

    "status": 1

}

 

5. 

When creating an account, you can add a tag

Paste into the request body: (full example below)
"tags": "5d0a4d2cf73822000c44994c"

where 5d0a4d2cf73822000c44994c is the tag id. It can be copied in settings -> tags -> copy id

 

6. When creating an account, an email connection must be selected.

"connection_id":  "5cfa283a2e9096000b440d51". (full example below)

where 5cfa283a2e9096000b440d51 is the connection id. It can be copied in settings -> messengers -> connection (for example SendGrid) -> copy id

 

POST: https://api.leeloo.ai/api/v2/accounts/email

In Headers:

Specify Content type: application/json,
X-Leeloo-AuthToken - company token
In the body of the request put:

 

Request example:


{

"data":[{

"email": "revolt@xmpl.net",

"name" :  "Robin Hood"

"phone":  "+380963333333"

}],

"connection_id":  "5cfa283a2e9096000b440d51",

"tags": "5d0a4d2cf73822000c44994c"

}


Response example:


{

"data": {

"count_to_process": 1

},

"status": 1

}

 

 

Where,

email - client email

name - client name

phone - client phone

connection id - id of the connection that was created on the platform (Sendgrid, Mandril)

tags - tag id that will be assigned to the user upon creation