Contacts Insert and Update (Batch)

Create or Update a Bulk of Contacts in the MainBrainer CRM

This endpoint is particularly useful for periodically syncing data from another database to the Mainbrainer CRM. While we support batch sizes of up to 1000 contacts per request, we recommend that you limit the batch size to 100 contacts or fewer per request to maximize the performance. and It can take a few minutes for the changes/updates to be applied to the records because the changes made through this endpoint are processed asynchronously.

SecurityBearer
Request
Request Body schema: application/json

This endpoint upserts (insert/ update) a batch of contacts to the MainBrainer CRM. In an update, any fields omitted from the request will remain as they were.

listId
string or null <uuid>

Specify the List ID of the CRM contact list under which you wish to upsert the contact.

required
Array of objects (CreateUpdateContacts)
Array
listId
string or null <uuid>

Specify the List ID of the CRM contact list under which you wish to upsert the contact.

contactId
integer or null <int64>

ContactID is the unique identifier for a contact created in the MainBrainer CRM. When making an update request, we recommend that you always include the contactID in your request..

mobileCountryCode
integer or null <int32>

The country code of the contact you wish to create/update.

mobileNumber
integer or null <int64>

The mobile number of the contact you wish to create/update.

mobileOptIn
boolean or null

The Mobile Opt-In status of the contact.

email
string or null

The email address of the contact you wish to create/update.

emailOptIn
boolean or null

The Email Opt-In status of the contact you wish to create/update.

Array of objects or null (PropertyFields)

MainBrainer CRM stores information about the contacts under different Property Fields. Specify the property fields along with the corresponding contact details for the contacts you wish to create/update.

Array
propertyId
string or null <uuid>

Unique identifier of the property field under which you wish to insert/update contact data

propertyName
string or null

Name of the property field under which you wish to insert/update contact data

propertyValue
string or null

The contact data you wish to insert/update under the specified property field

webHookUrl
string or null

The webhook URL where you want to receive updates for the contacts being created. For each batch, the update will specify the following:
• Number of Contacts inserted along with the Contact IDs.
• Number of Contacts updated along with the Contact IDs
• Number of Contacts skipped along with the Contact IDs

Responses
202

Success

400

Bad Request

401

Unauthorized

406

Not Acceptable

409

Conflict

422

Client Error

500

Server Error

post/contacts/batch
Request samples
application/json
{
  • "listId": "9fc6ad7d-902a-4834-b161-a4911b883d44",
  • "createUpdateContacts": [
    • {
      • "listId": "9fc6ad7d-902a-4834-b161-a4911b883d44",
      • "contactId": 0,
      • "mobileCountryCode": 0,
      • "mobileNumber": 0,
      • "mobileOptIn": true,
      • "email": "string",
      • "emailOptIn": true,
      • "propertyFields": [
        • {
          • "propertyId": "8e8b8450-dc1b-4360-8109-7067337b42cb",
          • "propertyName": "string",
          • "propertyValue": "string"
          }
        ]
      }
    ],
  • "webHookUrl": "string"
}
Response samples
{
  • "status": "Success",
  • "message": "string",
  • "data": {
    • "batchId": "string",
    • "processed": "string",
    • "contactId": "string",
    • "status": 0,
    • "message": "string",
    • "invalidPropertiesList": [
      • {
        • "propertyId": "8e8b8450-dc1b-4360-8109-7067337b42cb",
        • "propertyName": "string",
        • "propertyValue": "string"
        }
      ],
    • "invalidContactIdList": [
      • "string"
      ],
    • "balance": { }
    }
}