For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Help CenterAPI KeysStatusSign In
GuidesAPI ReferenceChangelog
GuidesAPI ReferenceChangelog
  • Introduction
    • Getting started
  • Email API
  • Transactional SMS
  • Transactional WhatsApp
  • Marketing Campaigns
  • Contact Management
      • GETGet all the contacts
      • POSTCreate a contact
      • POSTCreate Contact via DOI (Double-Opt-In) Flow
      • GETGet a contact's details
      • DELDelete a contact
      • PUTUpdate a contact
      • GETGet email campaigns' statistics for a contact
      • GETGet all the segments
      • POSTExport contacts
      • POSTImport contacts
  • Events
    • GETGet events
    • POSTCreate an event
    • POSTCreate events in batch
  • Object Management
  • Accounts and Settings
  • Sales CRM
  • Conversations
  • Ecommerce
  • Loyalty
LogoLogo
Help CenterAPI KeysStatusSign In
Contact ManagementContacts

Create a contact

POST
https://api.brevo.com/v3/contacts
POST
/v3/contacts
1import { BrevoClient } from "@getbrevo/brevo";
2
3async function main() {
4 const client = new BrevoClient({
5 apiKey: "YOUR_API_KEY_HERE",
6 });
7 await client.contacts.createContact({});
8}
9main();
1{
2 "id": 21
3}
<Note>Follow this format when passing a "SMS" phone number as an attribute. Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx</Note> Creates new contacts on Brevo. Contacts can be created by passing either - <br><br> 1. email address of the contact (email_id), <br> 2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"} <br> 3. ext_id <br>
Was this page helpful?
Previous

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

Next
Built with

Follow this format when passing a “SMS” phone number as an attribute. Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
Creates new contacts on Brevo. Contacts can be created by passing either - <br /><br /> 1. email address of the contact (email_id), <br /> 2. phone number of the contact (to be passed as “SMS” field in “attributes” along with proper country code), For example- {“SMS”:“+91xxxxxxxxxx”} or {“SMS”:“0091xxxxxxxxxx”} <br /> 3. ext_id <br />

Authentication

api-keystring

The API key should be passed in the request headers as api-key for authentication.

Request

Values to create a contact
attributesmap from strings to doubles or integers or strings or booleans or lists of stringsOptional
Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. **These attributes must be present in your Brevo account**. For eg: **{"FNAME":"Elly", "LNAME":"Roger", "COUNTRIES": ["India","China"]}**
emailstringOptionalformat: "email"

Email address of the user. Mandatory if “ext_id” & “SMS” field is not passed.

emailBlacklistedbooleanOptional

Set this field to blacklist the contact for emails (emailBlacklisted = true)

ext_idstringOptional
Pass your own Id to create a contact.
listIdslist of longsOptional
Ids of the lists to add the contact to
smsBlacklistedbooleanOptional

Set this field to blacklist the contact for SMS (smsBlacklisted = true)

smtpBlacklistSenderlist of stringsOptional

transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true )

updateEnabledbooleanOptionalDefaults to false

Facilitate to update the existing contact in the same request (updateEnabled = true)

forceMergebooleanOptionalDefaults to false

When true, if the contact being created shares an identifier (email, SMS, ext_id, whatsapp, landline) with an existing contact, the two contacts are force-merged. The contact with the most recent last_modified timestamp is retained; the other is deleted. When false (default), a 4xx error is returned on identifier conflict.

getIdbooleanOptionalDefaults to false

When true, the response returns the id of the surviving contact after merge.

Response

Contact created
idlong
ID of the contact when a new contact is created

Errors

400
Bad Request Error
425
Too Early Error

Pass the set of attributes and their values. The attribute’s parameter should be passed in capital letter while creating a contact. Values that don’t match the attribute type (e.g. text or string in a date attribute) will be ignored. These attributes must be present in your Brevo account. For eg: {“FNAME”:“Elly”, “LNAME”:“Roger”, “COUNTRIES”: [“India”,“China”]}