# POST /api/v1/customers/{customer_id}/contacts

> Create customer contact

- **Tag:** customers
- **Operation ID:** `create_contact_api_v1_customers__customer_id__contacts_post`

## Description

Add a new contact to a customer.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `customer_id` (path, string, required)

## Request body

Schema: `EntityContactCreateRequest`

- `name` (string · required) — Contact name.
- `email` (string · email) — Contact email address.
- `phone` (string) — Contact phone number.
- `role` (string) — Contact role (e.g., 'Billing', 'Technical').
- `is_primary` (boolean) — Set as primary contact.
- `notes` (string) — Notes about this contact.

## Responses

### 201 — Successful Response

Schema: `EntityContactResponse`

- `id` (string · required) — Contact UUID.
- `entity_type` (string · required) — Type of parent entity.
- `entity_id` (string · required) — Parent entity UUID.
- `name` (string · required) — Contact name.
- `email` (string) — Contact email.
- `phone` (string) — Contact phone.
- `role` (string) — Contact role.
- `is_primary` (boolean) — Whether this is the primary contact.
- `notes` (string) — Notes about this contact.
- `created_at` (string · date-time · required) — Creation timestamp.
- `updated_at` (string · date-time · required) — Last update timestamp.

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/customers/{customer_id}/contacts' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/customers/{customer_id}/contacts', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "name": "string"
}

response = httpx.post("https://api.ondayzero.com/api/v1/customers/{customer_id}/contacts", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/customers/create-contact
- OpenAPI slice: https://www.ondayzero.com/docs/reference/customers/create-contact/openapi.json
- Other endpoints in **customers**: https://www.ondayzero.com/docs/reference/customers
