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 Contact via DOI (Double-Opt-In) Flow

POST
https://api.brevo.com/v3/contacts/doubleOptinConfirmation
POST
/v3/contacts/doubleOptinConfirmation
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.createDoiContact({
8 email: "elly@example.com",
9 includeListIds: [
10 36,
11 ],
12 redirectionUrl: "http://requestb.in/173lyyx1",
13 templateId: 2,
14 });
15}
16main();
1{}
<Note title="How to use attributes param?">attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.</Note>
Was this page helpful?
Previous

Get a contact's details

Next
Built with
How to use attributes param?
attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.

Authentication

api-keystring

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

Request

Values to create the Double opt-in (DOI) contact

emailstringRequiredformat: "email"
Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes.
includeListIdslist of longsRequired
Lists under user account where contact should be added
redirectionUrlstringRequiredformat: "url"

URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}.

templateIdlongRequired

Id of the Double opt-in (DOI) template

attributesmap from strings to doubles or strings or booleans or lists of stringsOptional

Pass the set of attributes and their values. These attributes must be present in your Brevo account. For eg. {‘FNAME’:‘Elly’, ‘LNAME’:‘Roger’, ‘COUNTRIES’: [‘India’,‘China’]}

excludeListIdslist of longsOptional
Lists under user account where contact should not be added

Response

DOI Contact created

Errors

400
Bad Request Error