Custom objects management
Create or update object records in bulk
Insert or update multiple records of a custom object in a single API call. Send a POST request to https://api.brevo.com/v3/objects/{object_type}/batch/upsert.
This operation is asynchronous. The endpoint returns a processId you can use to monitor the request status. See the API endpoint here.
Requirements
- Custom objects are only available for Enterprise or Pro plan accounts.
- This endpoint only supports custom objects. It will not create or update records for Brevo system objects such as contact, company, deal, task, note, store, order, or ticket.
- The target object type must already exist in your Brevo schema (see the create custom objects help article). The endpoint does not create new object types and returns an invalid
object_typeerror otherwise. - Attributes in your payload must be defined in the schema attributes. Undefined attributes are ignored, as shown here.
- To associate two object records:
- An association between the corresponding object types must exist (see here).
- Both object records must exist before associating them, otherwise the API returns an error.
Limits and behaviour
Associations
- Associations must reference existing object records, otherwise the API returns an error.
- To associate custom objects, use either
ext_idorid. - Custom objects can be associated with Brevo system objects. For example, with
object_typeas vehicle and associatedobject_typeas company:- To associate contacts, use
contact_idasidin identifiers. - To associate companies or deals, use
ext_idin identifiers and fill it with the Brevo-generated company or deal ID (e.g.company_idasext_id).
- To associate contacts, use
Storing attributes of an object record (when creating or updating one)
- Use the
attribute_idgenerated when the object attribute was created as the key. - An
attribute_idnot defined in the object schema is ignored — it will not be created and does not throw an error.
CURL request
Response
Response codes:
A successful response returns a processId and a message.
Get the list of object records and total records count for an object
Retrieve a paginated list of records for a specific object type, including associated data and a total record count.
Send a GET request to https://api.brevo.com/v3/objects/{object_type}/records. The endpoint returns a list of records and the total count of object records. See the API endpoint here.
Requirements
- This endpoint only supports custom objects. It will not return records for Brevo system objects such as contact, company, deal, task, note, store, order, or ticket.
- Custom objects are only available for Enterprise or Pro plan accounts.
- Confirm the object type is already defined in your schema. The endpoint does not return records for undefined object types.
CURL request
Response
Response codes:
The response returns a list of object records with attributes, identifiers, and associations, plus the total count of records for that object type (useful for pagination).
Get the records associated with an object record
Retrieve the records associated with a single source record. Associations of every type come back together in one paginated list, ordered by association creation time with the most recently created association first.
Send a GET request to https://api.brevo.com/v3/objects/{object_type}/associated-records. See the API endpoint here.
Requirements
- Custom objects are only available for Enterprise or Pro plan accounts.
- Use object types exactly as they are defined in your account, both in the path and in the
typefilter. An object type that does not exist in your account returns400. - Identify the source record with exactly one of
id,ext_id,emailorsms. Passing none of them, or more than one, returns400.
Pagination
Results are returned 20 per page. The page size is fixed and cannot be changed. Increase offset by 20 to walk through the pages until has_more is false. An offset beyond the last record returns an empty items array with has_more set to false.
Working with contacts
contactis supported both as the sourceobject_typeand as an associated object type.- If several contacts share the same
ext_id,emailorsms, identify the contact byidto be sure of which one is used. - An
smsvalue may be given with or without a leading+. Percent-encode the+as%2B, because a literal+in a query string is read as a space. - Contacts returned in
itemscarry all of the contact’s attributes, with attribute keys in lowercase —email,first_name,last_name,sms,ext_id, and any other contact attribute lowercased. - For contacts,
ext_id,created_atandupdated_atare not returned onobject. A contact’s external ID is available asattributes.ext_idwhen it is set.
CURL request
Filter the response to specific associated object types:
Response
Response codes:
The response returns the associated records for the page, the requested offset, and whether more records remain. On each item, ext_id, attributes, created_at and updated_at are omitted when they are not available for the record.