Create contact

Create a contact for the authenticated business. All fields are optional; any unrecognized field is stored in collected_data.

POST/api/external/v2/contacts

Authentication

This endpoint authenticates with an API key via the X-API-Key header (ek_live_... format), instead of the bearer token used in the rest of the reference.

Request body

ParameterTypeRequiredDescription
first_nameStringOptionalContact's first name.
last_nameStringOptionalContact's last name.
phone_numberStringOptionalPhone in E.164 format without '+' (digits only, 6-15 chars).
emailStringOptionalContact's email address.

Example request

bash
curl -X POST "https://eclectic-api-537143970188.us-central1.run.app/api/external/v2/contacts" \
  -H "X-API-Key: ek_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "phone_number": "56912345678",
    "email": "john@doe.com",
    "rut": "12345678-9"
  }'

Example response

json
{
  "success": true,
  "contact_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created": true
}

Notes

  • Any additional field is stored in the contact's collected_data.
  • If phone_number is sent and a contact with that number already exists, the existing one is returned (created: false).
  • Possible errors: 400 (validation), 401 (invalid or missing API key).