---
agentTools:
  projectIndex: https://sendinblue.readme.io/llms.txt
---

# Create/Update object records in bulk

This API allows bulk upsert of object records in a single request. Each object record may include
  - Attributes
  - Identifiers
  - Associations
**Response:**
  The API processes the request asynchronously and returns a processId that you can use to track the background process status.
**API and Schema Limitation:**
  - Size:
      - Max 1000 objects records per request
      - Max request body size: 1 MB
  - Max 500 attributes defined per object record upsert request
    - This is coherent with schema limitation: an object cannot have more than 500 attributes.
    - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation)
  - Max 10 associations defined per object record upsert request
    - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records.
**Errors:**
    - Make sure both object records exist before associating them, else the API will return an error.
    - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error "invalid object type".

> 📘 Enterprise access only
>
> * Custom objects are only available to Enterprise plans.
> * This feature is in beta. These are subject to change.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "contact": {
      "email": "contact@brevo.com",
      "name": "Brevo Support",
      "url": "https://account.brevo.com/support"
    },
    "description": "Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to :\n  - Manage your campaigns and get the statistics\n  - Manage your contacts\n  - Send transactional Emails and SMS\n  - and much more...\n\nYou can download our wrappers at https://github.com/orgs/brevo\n**Possible responses**\n  | Code | Message |\n  | :-------------: | ------------- |\n  | 200  | OK. Successful Request  |\n  | 201  | OK. Successful Creation |\n  | 202  | OK. Request accepted |\n  | 204  | OK. Successful Update/Deletion  |\n  | 400  | Error. Bad Request  |\n  | 401  | Error. Authentication Needed  |\n  | 402  | Error. Not enough credit, plan upgrade needed  |\n  | 403  | Error. Permission denied  |\n  | 404  | Error. Object does not exist |\n  | 405  | Error. Method not allowed  |\n  | 406  | Error. Not Acceptable  |\n  | 422  | Error. Unprocessable Entity |\n",
    "license": {
      "name": "MIT",
      "url": "http://opensource.org/licenses/MIT"
    },
    "title": "Brevo API",
    "version": "3.0.0"
  },
  "servers": [
    {
      "url": "https://api.brevo.com/v3"
    }
  ],
  "security": [
    {
      "api-key": []
    },
    {
      "partner-key": []
    }
  ],
  "paths": {
    "/objects/{object_type}/batch/upsert": {
      "post": {
        "description": "This API allows bulk upsert of object records in a single request. Each object record may include\n  - Attributes\n  - Identifiers\n  - Associations\n**Response:**\n  The API processes the request asynchronously and returns a processId that you can use to track the background process status.\n**API and Schema Limitation:**\n  - Size:\n      - Max 1000 objects records per request\n      - Max request body size: 1 MB\n  - Max 500 attributes defined per object record upsert request\n    - This is coherent with schema limitation: an object cannot have more than 500 attributes.\n    - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation)\n  - Max 10 associations defined per object record upsert request\n    - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records.\n**Errors:**\n    - Make sure both object records exist before associating them, else the API will return an error.\n    - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error \"invalid object type\".\n",
        "operationId": "upsertrecords",
        "parameters": [
          {
            "description": "object type for the attribute",
            "in": "path",
            "name": "object_type",
            "required": true,
            "schema": {
              "example": "vehicle",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "records": {
                    "description": "List of object records to be upsert. Each record can have attributes, identifiers, and associations.",
                    "items": {
                      "oneOf": [
                        {
                          "properties": {
                            "associations": {
                              "items": {
                                "oneOf": [
                                  {
                                    "properties": {
                                      "object_type": {
                                        "description": "Type of the associated object",
                                        "example": "garage",
                                        "type": "string"
                                      },
                                      "records": {
                                        "items": {
                                          "properties": {
                                            "identifiers": {
                                              "example": {
                                                "id": 435435
                                              },
                                              "properties": {
                                                "ext_id": {
                                                  "description": "ext_id is ID of record in the external system that client_dev want to store in the object system.",
                                                  "example": "9ab4c8d2ef",
                                                  "type": "string"
                                                },
                                                "id": {
                                                  "description": "Internal ID of the object record generated by Brevo",
                                                  "type": "integer"
                                                }
                                              },
                                              "type": "object"
                                            }
                                          },
                                          "type": "object"
                                        },
                                        "maxItems": 100,
                                        "minItems": 1,
                                        "type": "array"
                                      }
                                    },
                                    "type": "object"
                                  },
                                  {
                                    "properties": {
                                      "object_type": {
                                        "description": "Type of the associated object",
                                        "example": "insurance",
                                        "type": "string"
                                      },
                                      "records": {
                                        "items": {
                                          "oneOf": [
                                            {
                                              "properties": {
                                                "identifiers": {
                                                  "description": "Identifiers attached with the associated object record. It can be ext_id or id. NOTE: - Either ext_id or id is required, if both are not provided, then error will be returned. - Both ext_id and id cannot be provided in the same request.\n",
                                                  "example": {
                                                    "id": 1236
                                                  },
                                                  "properties": {
                                                    "ext_id": {
                                                      "description": "ext_id is ID of record in the external system that client_dev want to store in the object system.",
                                                      "example": "9ab4c8d2ef",
                                                      "type": "string"
                                                    },
                                                    "id": {
                                                      "description": "Internal ID of the object record generated by Brevo",
                                                      "type": "integer"
                                                    }
                                                  },
                                                  "type": "object"
                                                }
                                              },
                                              "type": "object"
                                            },
                                            {
                                              "properties": {
                                                "identifiers": {
                                                  "example": {
                                                    "ext_id": "f7e8d9c0ba"
                                                  },
                                                  "type": "object"
                                                }
                                              },
                                              "type": "object"
                                            }
                                          ]
                                        },
                                        "maxItems": 100,
                                        "minItems": 1,
                                        "type": "array"
                                      }
                                    },
                                    "type": "object"
                                  }
                                ]
                              },
                              "maxItems": 10,
                              "minItems": 0,
                              "type": "array"
                            },
                            "attributes": {
                              "description": "Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required.\n",
                              "example": {
                                "color": "Gray",
                                "engine_type": "Diesel",
                                "make": "Honda",
                                "model": "Civic",
                                "year": 2021
                              },
                              "type": "object"
                            },
                            "identifiers": {
                              "description": "Identifiers attached with the object record. It can have id or ext_id. ext_id is ID of record in the external system that client want to store in the object system, id is an internal ID of object record generated by Brevo system. NOTE: - Its an optional field, if identifier is not provided, then id of object records will be generated by Brevo. This id can be used for further operation with the object record. - Both ext_id and id cannot be provided in the same request.\n",
                              "example": {
                                "id": 400
                              },
                              "properties": {
                                "ext_id": {
                                  "description": "ext_id is ID of record in the external system that client_dev want to store in the object system.",
                                  "type": "string"
                                },
                                "id": {
                                  "description": "Internal ID of the object record generated by Brevo",
                                  "example": 16789,
                                  "type": "integer"
                                }
                              },
                              "type": "object"
                            }
                          },
                          "type": "object"
                        }
                      ]
                    },
                    "maxItems": 1000,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "records"
                ],
                "type": "object"
              }
            }
          },
          "description": "Payload for batch upsert object records with associations",
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "message": {
                      "example": "Batch object records are being processed",
                      "type": "string"
                    },
                    "processId": {
                      "description": "Unique Id for the batch process used to track the status of the batch.",
                      "example": 21,
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Batch request accepted for processing of upsert object records."
          },
          "400": {
            "description": "Bad request (e.g., invalid organization ID, invalid object_type, records cannot be empty or more than 1000)"
          },
          "403": {
            "description": "Custom objects are not available on this account."
          },
          "404": {
            "description": "Object not found for the provided organization or object type"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "summary": "Create/Update object records in bulk",
        "tags": [
          "Custom Objects"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api-key": {
        "description": "The API key should be passed in the request headers as `api-key` for authentication.",
        "in": "header",
        "name": "api-key",
        "type": "apiKey"
      },
      "partner-key": {
        "description": "The partner key should be passed in the request headers as `partner-key` along with `api-key` pair for successful authentication of partner (Optional).",
        "in": "header",
        "name": "partner-key",
        "type": "apiKey"
      }
    }
  },
  "x-samples-languages": [
    "curl"
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 91,
      "1": 104,
      "2": 180,
      "3": 205,
      "4": 240,
      "5": 82,
      "6": 207,
      "7": 0,
      "8": 3,
      "9": 36,
      "10": 63,
      "11": 142
    }
  }
}
```