Code preference:
Curl
Ruby
Php
Python
Node.js
C#
Java

User

Developers can access their users information as well as manage it using this API. Following are the various operations supported by this API.

This API will let you create a new user if an email provided as input, doesn’t exist in the contact list of your SendinBlue account, otherwise it will update the existing user.

Input Parameter Description
email Email address of the user to be created in SendinBlue contacts. Already existing email address of user in the SendinBlue contacts to be modified [Mandatory].
attributes The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array(“NAME”=>”name”). You can use commas to separate multiple attributes [Optional].
blacklisted This is used to blacklist/ Unblacklist a user. Possible values – 0 & 1. blacklisted = 1 means user has been blacklisted [Optional].
listid The list id(s) to be linked from user [Optional].
listid_unlink The list id(s) to be unlinked from user [Optional].
blacklisted_sms This is used to blacklist/ Unblacklist a user’s SMS number. Possible values – 0 & 1. blacklisted_sms = 1 means user’s SMS number has been blacklisted [Optional].

Note :
In case of create user, if blacklisted = ” (empty) is passed, user will be unblacklisted ( 0 ), & in case of update user, if blacklisted = ” (empty) is passed, user’s blacklist status remains unchanged. Same is the case with ‘blacklisted_sms’ input parameter.

In case of “Category” type attribute, let’s say Gender, you will have to add possible value, “1” for Mr and a “2” for Ms.

Example :

Sample Output :
On successful user creation, it returns the ID of the created user.

On successful user updation.

This API call will let you access the specific user information.

Input Parameter Description
email Email address of the already existing user in the SendinBlue contacts [Mandatory].

Example :

Sample Output :

Note: Events – hard_bounce, soft_bounce, spam, opened, clicks may be seen above and can carry multiple records.

This API call will let you unlink a user from all lists.

Input Parameter Description
email Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory].

Example :

Sample Output :

This API call will let you import users information.

bodyThe Body with csv content to be imported. Example: ‘NAME;SURNAME;EMAIL\n”Name1″;”Surname1″;”example1@example.net”\n”Name2″;”Surname2″;”example2@example.net”‘, where \n separates each user data. You can use semicolon to separate multiple attributes [Mandatory: if url is empty].

Input Parameter Description
url The URL of the file to be imported. Possible file types – .txt, .csv [Mandatory: if body is empty].
listids These are the list ids in which the the users will be imported [Mandatory: if name is empty].
notify_url URL that will be called once the import process is finished [Optional].
In notify_url, we are sending the content using POST method, example:
proc_success=255&new_emails=0&emails_exists=2&invalid_email=0&duplicates_email=0&listids=123
new_emails = The count of total new emails that have been added in the SendinBlue account.
emails_exists = The count of total existing emails (in the whole account) that have been modified.
invalid_email – The count of total Invalid emails that have not been added or updated.
duplicates_email = The count of total duplicates email in the csv.
proc_success = The id of the process that has done the import.
For further information please visit: Importing a file containing your list of contacts
name This is new list name which will be created first & then users will be imported in it [Mandatory: if listids is empty].
folder_id This is the existing folder id & can be used with name parameter to make newly created list’s desired parent [Optional].

Example :

Sample Output :

This API call will let you export users information.

Input Parameter Description
export_attrib The name of attribute present in your SendinBlue account. You can use commas to separate multiple attributes. Example: “EMAIL,NAME,SMS” [Optional].
filter Filter can be added to export users. Example: “{\”blacklisted\”:1}”, will export all blacklisted users [Mandatory].
notify_url URL that will be called once the export process is finished [Optional].

Example :

Sample Output :

Note: Web service will return the created process ID. URL notify_url written in the web service will be called and will write with POST method those two fields: “url” and “proc_success”. Either way you will still receive export notification email (on your registered email id) with exported file url.

Some more filter examples are given below:

Filter Description
‘{“blacklisted”:1}’ To get the list of all blacklised users
‘{“sms_bl”:1}’ To get all the users blacklisted for SMS
‘{“blacklisted”:1,”$or”:[{“user_history”:{“$elemMatch”:{“action”:{“$in”:[“SPAM”,”MUNSUBS”,”AUNSUBS”,”SEARCH_UNSUBSCRIBE_USERS”]}},”message_id”:X }},{“messages_sent.bnc.r”:”h_b”,”messages_sent.messageid”:X}]}’ To get the list of all blacklisted users for some particular campaign X (X= campaign id)
‘{“opened_message.messageid”: X,”messages_sent.messageid”: X}’ To get readers list for some particular campaign X
‘{“clicked_message.messageid”: X,”messages_sent.messageid”: X}’ To get clickers list for some particular campaign X
‘{“opened_message.messageid”:{“$nin”:[X]},”messages_sent.messageid”: X}’ To get not readers list for some particular campaign X
‘{“clicked_message.messageid”:{ “$nin”:[X]},”messages_sent.messageid”: X}’ To get not clickers list for some particular campaign X
‘{“messages_sent.bnc.r”:”h_b”,”messages_sent.messageid”:X}’ To get Hard bounces list for some particular campaign X
‘{“messages_sent.bnc.r”:”h_b”}’ To get Hard bounces list for all campaigns
‘{“messages_sent.bnc.r”:”s_b”,”messages_sent.messageid”:X}’ To get Soft bounces list for some particular campaign X
‘{“messages_sent.bnc.r”:”s_b”}’ To get Soft bounces list for all campaigns
‘{“blacklisted”:1,”listid.id”:X}’ To get all blacklisted users for some particular list
‘{“blacklisted”:0 ,”listid.id”:X}’ To get all unblacklisted users for some particular list
‘{“listid.id”:X}’ To get all the users for some particular list