Skip to content

Latest commit

 

History

History
1753 lines (1312 loc) · 66.4 KB

ContactsApi.md

File metadata and controls

1753 lines (1312 loc) · 66.4 KB

brevo_python.ContactsApi

All URIs are relative to https://api.brevo.com/v3

Method HTTP request Description
add_contact_to_list POST /contacts/lists/{listId}/contacts/add Add existing contacts to a list
create_attribute POST /contacts/attributes/{attributeCategory}/{attributeName} Create contact attribute
create_contact POST /contacts Create a contact
create_doi_contact POST /contacts/doubleOptinConfirmation Create Contact via DOI (Double-Opt-In) Flow
create_folder POST /contacts/folders Create a folder
create_list POST /contacts/lists Create a list
delete_attribute DELETE /contacts/attributes/{attributeCategory}/{attributeName} Delete an attribute
delete_contact DELETE /contacts/{identifier} Delete a contact
delete_folder DELETE /contacts/folders/{folderId} Delete a folder (and all its lists)
delete_list DELETE /contacts/lists/{listId} Delete a list
get_attributes GET /contacts/attributes List all attributes
get_contact_info GET /contacts/{identifier} Get a contact's details
get_contact_stats GET /contacts/{identifier}/campaignStats Get email campaigns' statistics for a contact
get_contacts GET /contacts Get all the contacts
get_contacts_from_list GET /contacts/lists/{listId}/contacts Get contacts in a list
get_folder GET /contacts/folders/{folderId} Returns a folder's details
get_folder_lists GET /contacts/folders/{folderId}/lists Get lists in a folder
get_folders GET /contacts/folders Get all folders
get_list GET /contacts/lists/{listId} Get a list's details
get_lists GET /contacts/lists Get all the lists
get_segments GET /contacts/segments Get all the Segments
import_contacts POST /contacts/import Import contacts
remove_contact_from_list POST /contacts/lists/{listId}/contacts/remove Delete a contact from a list
request_contact_export POST /contacts/export Export contacts
update_attribute PUT /contacts/attributes/{attributeCategory}/{attributeName} Update contact attribute
update_batch_contacts POST /contacts/batch Update multiple contacts
update_contact PUT /contacts/{identifier} Update a contact
update_folder PUT /contacts/folders/{folderId} Update a folder
update_list PUT /contacts/lists/{listId} Update a list

add_contact_to_list

PostContactInfo add_contact_to_list(list_id, contact_emails)

Add existing contacts to a list

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
contact_emails = brevo_python.AddContactToList() # AddContactToList | Emails addresses OR IDs of the contacts

try:
    # Add existing contacts to a list
    api_response = api_instance.add_contact_to_list(list_id, contact_emails)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->add_contact_to_list: %s\n" % e)

Parameters

Name Type Description Notes
list_id int Id of the list
contact_emails AddContactToList Emails addresses OR IDs of the contacts

Return type

PostContactInfo

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_attribute

create_attribute(attribute_category, attribute_name, create_attribute)

Create contact attribute

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_category = 'attribute_category_example' # str | Category of the attribute
attribute_name = 'attribute_name_example' # str | Name of the attribute
create_attribute = brevo_python.CreateAttribute() # CreateAttribute | Values to create an attribute

try:
    # Create contact attribute
    api_instance.create_attribute(attribute_category, attribute_name, create_attribute)
except ApiException as e:
    print("Exception when calling ContactsApi->create_attribute: %s\n" % e)

Parameters

Name Type Description Notes
attribute_category str Category of the attribute
attribute_name str Name of the attribute
create_attribute CreateAttribute Values to create an attribute

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_contact

CreateUpdateContactModel create_contact(create_contact)

Create a contact

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_contact = brevo_python.CreateContact() # CreateContact | Values to create a contact

try:
    # Create a contact
    api_response = api_instance.create_contact(create_contact)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->create_contact: %s\n" % e)

Parameters

Name Type Description Notes
create_contact CreateContact Values to create a contact

Return type

CreateUpdateContactModel

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_doi_contact

create_doi_contact(create_doi_contact)

Create Contact via DOI (Double-Opt-In) Flow

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_doi_contact = brevo_python.CreateDoiContact() # CreateDoiContact | Values to create the Double opt-in (DOI) contact

try:
    # Create Contact via DOI (Double-Opt-In) Flow
    api_instance.create_doi_contact(create_doi_contact)
except ApiException as e:
    print("Exception when calling ContactsApi->create_doi_contact: %s\n" % e)

Parameters

Name Type Description Notes
create_doi_contact CreateDoiContact Values to create the Double opt-in (DOI) contact

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_folder

CreateModel create_folder(create_folder)

Create a folder

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_folder = brevo_python.CreateUpdateFolder() # CreateUpdateFolder | Name of the folder

try:
    # Create a folder
    api_response = api_instance.create_folder(create_folder)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->create_folder: %s\n" % e)

Parameters

Name Type Description Notes
create_folder CreateUpdateFolder Name of the folder

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_list

CreateModel create_list(create_list)

Create a list

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
create_list = brevo_python.CreateList() # CreateList | Values to create a list

try:
    # Create a list
    api_response = api_instance.create_list(create_list)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->create_list: %s\n" % e)

Parameters

Name Type Description Notes
create_list CreateList Values to create a list

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_attribute

delete_attribute(attribute_category, attribute_name)

Delete an attribute

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_category = 'attribute_category_example' # str | Category of the attribute
attribute_name = 'attribute_name_example' # str | Name of the existing attribute

try:
    # Delete an attribute
    api_instance.delete_attribute(attribute_category, attribute_name)
except ApiException as e:
    print("Exception when calling ContactsApi->delete_attribute: %s\n" % e)

Parameters

Name Type Description Notes
attribute_category str Category of the attribute
attribute_name str Name of the existing attribute

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_contact

delete_contact(identifier)

Delete a contact

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact

try:
    # Delete a contact
    api_instance.delete_contact(identifier)
except ApiException as e:
    print("Exception when calling ContactsApi->delete_contact: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Email (urlencoded) OR ID of the contact

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_folder

delete_folder(folder_id)

Delete a folder (and all its lists)

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | Id of the folder

try:
    # Delete a folder (and all its lists)
    api_instance.delete_folder(folder_id)
except ApiException as e:
    print("Exception when calling ContactsApi->delete_folder: %s\n" % e)

Parameters

Name Type Description Notes
folder_id int Id of the folder

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_list

delete_list(list_id)

Delete a list

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list

try:
    # Delete a list
    api_instance.delete_list(list_id)
except ApiException as e:
    print("Exception when calling ContactsApi->delete_list: %s\n" % e)

Parameters

Name Type Description Notes
list_id int Id of the list

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_attributes

GetAttributes get_attributes()

List all attributes

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))

try:
    # List all attributes
    api_response = api_instance.get_attributes()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_attributes: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetAttributes

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_contact_info

GetExtendedContactDetails get_contact_info(identifier, start_date=start_date, end_date=end_date)

Get a contact's details

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.brevo.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges.

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact OR its SMS attribute value
start_date = 'start_date_example' # str | **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate  (optional)
end_date = 'end_date_example' # str | **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate.  (optional)

try:
    # Get a contact's details
    api_response = api_instance.get_contact_info(identifier, start_date=start_date, end_date=end_date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_contact_info: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Email (urlencoded) OR ID of the contact OR its SMS attribute value
start_date str Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate [optional]
end_date str Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. [optional]

Return type

GetExtendedContactDetails

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_contact_stats

GetContactCampaignStats get_contact_stats(identifier, start_date=start_date, end_date=end_date)

Get email campaigns' statistics for a contact

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact
start_date = 'start_date_example' # str | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate (optional)
end_date = 'end_date_example' # str | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days (optional)

try:
    # Get email campaigns' statistics for a contact
    api_response = api_instance.get_contact_stats(identifier, start_date=start_date, end_date=end_date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_contact_stats: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Email (urlencoded) OR ID of the contact
start_date str Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate [optional]
end_date str Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days [optional]

Return type

GetContactCampaignStats

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_contacts

GetContacts get_contacts(limit=limit, offset=offset, modified_since=modified_since, created_since=created_since, sort=sort, segment_id=segment_id, list_ids=list_ids, filter=filter)

Get all the contacts

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 50 # int | Number of documents per page (optional) (default to 50)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
modified_since = 'modified_since_example' # str | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
created_since = 'created_since_example' # str | Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)
segment_id = 789 # int | Id of the segment. **Either listIds or segmentId can be passed.** (optional)
list_ids = [56] # list[int] | Ids of the list. **Either listIds or segmentId can be passed.** (optional)
filter = 'filter_example' # str | Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))**  (optional)

try:
    # Get all the contacts
    api_response = api_instance.get_contacts(limit=limit, offset=offset, modified_since=modified_since, created_since=created_since, sort=sort, segment_id=segment_id, list_ids=list_ids, filter=filter)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_contacts: %s\n" % e)

Parameters

Name Type Description Notes
limit int Number of documents per page [optional] [default to 50]
offset int Index of the first document of the page [optional] [default to 0]
modified_since str Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. [optional]
created_since str Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. [optional]
sort str Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc]
segment_id int Id of the segment. Either listIds or segmentId can be passed. [optional]
list_ids list[int] Ids of the list. Either listIds or segmentId can be passed. [optional]
filter str Filter the contacts on the basis of attributes. Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,"Antoine"), filter=equals(B1, true), filter=equals(DOB, "1989-11-23")) [optional]

Return type

GetContacts

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_contacts_from_list

GetContacts get_contacts_from_list(list_id, modified_since=modified_since, limit=limit, offset=offset, sort=sort)

Get contacts in a list

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
modified_since = 'modified_since_example' # str | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. (optional)
limit = 50 # int | Number of documents per page (optional) (default to 50)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)

try:
    # Get contacts in a list
    api_response = api_instance.get_contacts_from_list(list_id, modified_since=modified_since, limit=limit, offset=offset, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_contacts_from_list: %s\n" % e)

Parameters

Name Type Description Notes
list_id int Id of the list
modified_since str Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. [optional]
limit int Number of documents per page [optional] [default to 50]
offset int Index of the first document of the page [optional] [default to 0]
sort str Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc]

Return type

GetContacts

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_folder

GetFolder get_folder(folder_id)

Returns a folder's details

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | id of the folder

try:
    # Returns a folder's details
    api_response = api_instance.get_folder(folder_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_folder: %s\n" % e)

Parameters

Name Type Description Notes
folder_id int id of the folder

Return type

GetFolder

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_folder_lists

GetFolderLists get_folder_lists(folder_id, limit=limit, offset=offset, sort=sort)

Get lists in a folder

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | Id of the folder
limit = 10 # int | Number of documents per page (optional) (default to 10)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)

try:
    # Get lists in a folder
    api_response = api_instance.get_folder_lists(folder_id, limit=limit, offset=offset, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_folder_lists: %s\n" % e)

Parameters

Name Type Description Notes
folder_id int Id of the folder
limit int Number of documents per page [optional] [default to 10]
offset int Index of the first document of the page [optional] [default to 0]
sort str Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc]

Return type

GetFolderLists

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_folders

GetFolders get_folders(limit, offset, sort=sort)

Get all folders

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 10 # int | Number of documents per page (default to 10)
offset = 0 # int | Index of the first document of the page (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)

try:
    # Get all folders
    api_response = api_instance.get_folders(limit, offset, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_folders: %s\n" % e)

Parameters

Name Type Description Notes
limit int Number of documents per page [default to 10]
offset int Index of the first document of the page [default to 0]
sort str Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc]

Return type

GetFolders

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_list

GetExtendedList get_list(list_id, start_date=start_date, end_date=end_date)

Get a list's details

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
start_date = 'start_date_example' # str | Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)
end_date = 'end_date_example' # str | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result (optional)

try:
    # Get a list's details
    api_response = api_instance.get_list(list_id, start_date=start_date, end_date=end_date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_list: %s\n" % e)

Parameters

Name Type Description Notes
list_id int Id of the list
start_date str Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result [optional]
end_date str Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result [optional]

Return type

GetExtendedList

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_lists

GetLists get_lists(limit=limit, offset=offset, sort=sort)

Get all the lists

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 10 # int | Number of documents per page (optional) (default to 10)
offset = 0 # int | Index of the first document of the page (optional) (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)

try:
    # Get all the lists
    api_response = api_instance.get_lists(limit=limit, offset=offset, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_lists: %s\n" % e)

Parameters

Name Type Description Notes
limit int Number of documents per page [optional] [default to 10]
offset int Index of the first document of the page [optional] [default to 0]
sort str Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc]

Return type

GetLists

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_segments

GetSegments get_segments(limit, offset, sort=sort)

Get all the Segments

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
limit = 10 # int | Number of documents per page (default to 10)
offset = 0 # int | Index of the first document of the page (default to 0)
sort = 'desc' # str | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (optional) (default to desc)

try:
    # Get all the Segments
    api_response = api_instance.get_segments(limit, offset, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->get_segments: %s\n" % e)

Parameters

Name Type Description Notes
limit int Number of documents per page [default to 10]
offset int Index of the first document of the page [default to 0]
sort str Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [optional] [default to desc]

Return type

GetSegments

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

import_contacts

CreatedProcessId import_contacts(request_contact_import)

Import contacts

It returns the background process ID which on completion calls the notify URL that you have set in the input. Note: - Any contact attribute that doesn't exist in your account will be ignored at import end.

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
request_contact_import = brevo_python.RequestContactImport() # RequestContactImport | Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``

try:
    # Import contacts
    api_response = api_instance.import_contacts(request_contact_import)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->import_contacts: %s\n" % e)

Parameters

Name Type Description Notes
request_contact_import RequestContactImport Values to import contacts in Brevo. To know more about the expected format, please have a look at ``https://help.brevo.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

remove_contact_from_list

PostContactInfo remove_contact_from_list(list_id, contact_emails)

Delete a contact from a list

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
contact_emails = brevo_python.RemoveContactFromList() # RemoveContactFromList | Emails addresses OR IDs of the contacts

try:
    # Delete a contact from a list
    api_response = api_instance.remove_contact_from_list(list_id, contact_emails)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->remove_contact_from_list: %s\n" % e)

Parameters

Name Type Description Notes
list_id int Id of the list
contact_emails RemoveContactFromList Emails addresses OR IDs of the contacts

Return type

PostContactInfo

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

request_contact_export

CreatedProcessId request_contact_export(request_contact_export)

Export contacts

It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
request_contact_export = brevo_python.RequestContactExport() # RequestContactExport | Values to request a contact export

try:
    # Export contacts
    api_response = api_instance.request_contact_export(request_contact_export)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ContactsApi->request_contact_export: %s\n" % e)

Parameters

Name Type Description Notes
request_contact_export RequestContactExport Values to request a contact export

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_attribute

update_attribute(attribute_category, attribute_name, update_attribute)

Update contact attribute

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
attribute_category = 'attribute_category_example' # str | Category of the attribute
attribute_name = 'attribute_name_example' # str | Name of the existing attribute
update_attribute = brevo_python.UpdateAttribute() # UpdateAttribute | Values to update an attribute

try:
    # Update contact attribute
    api_instance.update_attribute(attribute_category, attribute_name, update_attribute)
except ApiException as e:
    print("Exception when calling ContactsApi->update_attribute: %s\n" % e)

Parameters

Name Type Description Notes
attribute_category str Category of the attribute
attribute_name str Name of the existing attribute
update_attribute UpdateAttribute Values to update an attribute

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_batch_contacts

update_batch_contacts(update_batch_contacts)

Update multiple contacts

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
update_batch_contacts = brevo_python.UpdateBatchContacts() # UpdateBatchContacts | Values to update multiple contacts

try:
    # Update multiple contacts
    api_instance.update_batch_contacts(update_batch_contacts)
except ApiException as e:
    print("Exception when calling ContactsApi->update_batch_contacts: %s\n" % e)

Parameters

Name Type Description Notes
update_batch_contacts UpdateBatchContacts Values to update multiple contacts

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_contact

update_contact(identifier, update_contact)

Update a contact

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
identifier = 'identifier_example' # str | Email (urlencoded) OR ID of the contact
update_contact = brevo_python.UpdateContact() # UpdateContact | Values to update a contact

try:
    # Update a contact
    api_instance.update_contact(identifier, update_contact)
except ApiException as e:
    print("Exception when calling ContactsApi->update_contact: %s\n" % e)

Parameters

Name Type Description Notes
identifier str Email (urlencoded) OR ID of the contact
update_contact UpdateContact Values to update a contact

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_folder

update_folder(folder_id, update_folder)

Update a folder

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
folder_id = 789 # int | Id of the folder
update_folder = brevo_python.CreateUpdateFolder() # CreateUpdateFolder | Name of the folder

try:
    # Update a folder
    api_instance.update_folder(folder_id, update_folder)
except ApiException as e:
    print("Exception when calling ContactsApi->update_folder: %s\n" % e)

Parameters

Name Type Description Notes
folder_id int Id of the folder
update_folder CreateUpdateFolder Name of the folder

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_list

update_list(list_id, update_list)

Update a list

Example

from __future__ import print_function
import time
import brevo_python
from brevo_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api-key
configuration = brevo_python.Configuration()
configuration.api_key['api-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api-key'] = 'Bearer'
# Configure API key authorization: partner-key
configuration = brevo_python.Configuration()
configuration.api_key['partner-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['partner-key'] = 'Bearer'

# create an instance of the API class
api_instance = brevo_python.ContactsApi(brevo_python.ApiClient(configuration))
list_id = 789 # int | Id of the list
update_list = brevo_python.UpdateList() # UpdateList | Values to update a list

try:
    # Update a list
    api_instance.update_list(list_id, update_list)
except ApiException as e:
    print("Exception when calling ContactsApi->update_list: %s\n" % e)

Parameters

Name Type Description Notes
list_id int Id of the list
update_list UpdateList Values to update a list

Return type

void (empty response body)

Authorization

api-key, partner-key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]