WA.cr APP - API v2
  1. Contacts
WA.cr APP - API v2
  • API v2 Documentation
    • Account
      • Get Account Info
      • Get Usage Statistics
      • Get Plan Limits
    • Authentication (OTP Verification)
      • Send OTP/Verification Code
      • Resend OTP
      • Verify OTP
      • Check OTP Status
      • List Authentication Templates
    • Comments
      • Get Comments
      • Add Comment
    • Contacts
      • List Contacts
        GET
      • Create Contact
        POST
      • Get Contact
        GET
      • Update Contact
        PATCH
      • Delete Contact
        DELETE
      • Batch Create Contacts
        POST
      • Batch Delete Contacts
        DELETE
    • Groups
      • List Groups
      • Create Group
      • Get Group
      • Update Group
      • Delete Group
      • Add Contacts to Group
      • Remove Contacts from Group
    • Messages
      • Send Text Message
      • Send Template Message
      • Send Media Message
      • Send Interactive Message
      • List Messages
      • Get Message
    • Sources
      • List Sources
      • Create Source
      • Get Source
      • Update Source
      • Delete Source
    • Statuses
      • List Statuses
      • Create Status
      • Get Status
      • Update Status
      • Delete Status
    • Templates
      • List Templates
      • Sync Templates from WhatsApp
      • Get Template
  1. Contacts

Batch Create Contacts

POST
/contacts/batch
Create multiple contacts in a single request. Runs inside a database transaction.

Authentication#

Required Scope: contacts:write

Request Body#

FieldTypeRequiredDescription
contactsarrayYesArray of contact objects to create
optionsobjectNoBatch operation options
options.continue_on_errorbooleanNoContinue processing remaining contacts if one fails (default: true)
options.skip_duplicatesbooleanNoSkip contacts with duplicate phone numbers instead of failing (default: false)

Contact Object Fields#

Each contact in the contacts array follows the same validation as the single create endpoint:
FieldTypeRequiredValidationDescription
firstnamestringYesmax:255First name
lastnamestringYesmax:255Last name
phonestringYesmax:20Phone number with country code
typestringYeslead, customer, guestContact type
source_idintegerYes—Source ID
status_idintegerYes—Status ID
emailstringNoemail, max:191Email address
companystringNomax:255Company name
descriptionstringNo—Additional notes
citystringNomax:255City
statestringNomax:255State/province
zipstringNomax:20ZIP/postal code
addressstringNomax:500Street address
country_idintegerNo—Country ID
assigned_idintegerNo—Assigned user ID

Duplicate Detection#

When options.skip_duplicates is true, the phone field is used as the unique identifier. Contacts with an existing phone number in the tenant will be skipped (not failed).

Response#

Success (200 OK): Returns a summary of the batch operation with detailed results.

Response Data Structure#

FieldTypeDescription
successbooleanWhether the overall operation succeeded
summary.totalintegerTotal contacts submitted
summary.createdintegerNumber successfully created
summary.skippedintegerNumber skipped (duplicates)
summary.failedintegerNumber that failed validation
createdarrayArray of created contact objects
skippedarrayArray of skipped entries with index, reason, data
errorsarrayArray of failed entries with index, data, errors

Error Responses#

StatusCodeDescription
422VALIDATION_ERRORBatch operation failed (when continue_on_error is false and a contact fails)
500INTERNAL_ERRORBatch operation failed (database error, transaction rolled back)
Note: Feature usage count (contacts) is synced after batch completion via syncModelCount.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Header Params

Body Params application/json

Examples

Responses

🟢200
application/json
Successful response
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/contacts/batch' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "contacts": [
        {
            "firstname": "Test",
            "lastname": "Three",
            "type": "lead",
            "email": "testthree@gmail.com",
            "phone": "+919587422390",
            "source_id": 115,
            "status_id": 287,
            "description": "Test one contact",
            "country_id": 101,
            "group_id": [
                12
            ],
            "zip": "360001",
            "city": "Rajkot"
        },
        {
            "firstname": "Test",
            "lastname": "Four",
            "type": "customer",
            "email": "testfour@gmail.com",
            "phone": "+919587422355",
            "source_id": 115,
            "status_id": 287,
            "description": "Test one contact",
            "country_id": 101,
            "addedfrom": 1
        }
    ],
    "options": {
        "continue_on_error": true,
        "skip_duplicates": false
    }
}'
Response Response Example
{}
Modified at 2026-02-25 01:06:20
Previous
Delete Contact
Next
Batch Delete Contacts
Built with