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
      • POSTCreate contact attribute
      • PUTUpdate contact attribute
      • GETList all attributes
      • DELDelete an attribute
      • DELDelete a multiple-choice attribute option
  • 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 ManagementAttributes

Create contact attribute

POST
https://api.brevo.com/v3/contacts/attributes/:attributeCategory/:attributeName
POST
/v3/contacts/attributes/:attributeCategory/:attributeName
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.createAttribute("normal", "attributeName", {});
8}
9main();
1{}
Create a new contact attribute under the specified category and name. The required body properties depend on the category: use "type" for normal, transactional, or category attributes; use "value" for calculated or global attributes; use "enumeration" for category attributes; and use "multiCategoryOptions" for normal multiple-choice attributes. None of the category or multicategory option values can exceed 200 characters.
Was this page helpful?
Previous

Update contact attribute

Next
Built with

Create a new contact attribute under the specified category and name. The required body properties depend on the category: use “type” for normal, transactional, or category attributes; use “value” for calculated or global attributes; use “enumeration” for category attributes; and use “multiCategoryOptions” for normal multiple-choice attributes. None of the category or multicategory option values can exceed 200 characters.

Authentication

api-keystring

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

Path parameters

attributeCategoryenumRequired
Category of the attribute
Allowed values:
attributeNamestringRequired
Name of the attribute

Request

Values to create an attribute
enumerationlist of objectsOptional

List of values and labels that the attribute can take. Use only if the attribute’s category is “category”. None of the category options can exceed max 200 characters. For example: [{“value”:1, “label”:“male”}, {“value”:2, “label”:“female”}]

isRecurringbooleanOptional

Type of the attribute. Use only if the attribute’s category is ‘calculated’ or ‘global’

multiCategoryOptionslist of stringsOptional

List of options you want to add for multiple-choice attribute. Use only if the attribute’s category is “normal” and attribute’s type is “multiple-choice”. None of the multicategory options can exceed max 200 characters. For example: [“USA”,“INDIA”]

typeenumOptional
Type of the attribute. **Use only if the attribute's category is 'normal', 'category' or 'transactional'** Type **user and multiple-choice** is only available if the category is **normal** attribute Type **id** is only available if the category is **transactional** attribute Type **category** is only available if the category is **category** attribute
valuestringOptional

Value of the attribute. Use only if the attribute’s category is ‘calculated’ or ‘global’

Response

Attribute created

Errors

400
Bad Request Error

Type of the attribute. Use only if the attribute’s category is ‘normal’, ‘category’ or ‘transactional’ Type user and multiple-choice is only available if the category is normal attribute Type id is only available if the category is transactional attribute Type category is only available if the category is category attribute