# POST /api/v1/projects/bulk

> Bulk create projects

- **Tag:** projects
- **Operation ID:** `bulk_create_projects_api_v1_projects_bulk_post`

## Description

Create up to 100 projects in one request with per-row customer resolution. Rows may pass customer_name instead of customer_id — an exact case-insensitive match auto-resolves; ambiguous or unmatched names fail only that row (CUSTOMER_AMBIGUOUS / CUSTOMER_NOT_FOUND with candidate customers) unless create_missing_customers is true, in which case unmatched customers are created inline.

## Authentication

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

## Request body

Schema: `ProjectBulkCreateRequest`

- `rows` (array · ProjectBulkCreateRow · required) → `ProjectBulkCreateRow`
  - `name` (string · required) — Project name.
  - `code` (string) — Optional code.
  - `sku` (string) — Optional short catalog/site code.
  - `description` (string) — Optional description.
  - `status` (string) — One of: active, completed, on_hold.
  - `customer_id` (string) — Customer UUID; takes precedence over customer_name.
  - `customer_name` (string) — Customer name, matched case-insensitively (exact match) against the business's customers when customer_id is not given.
  - `start_date` (string · date) — Optional project start date.
  - `end_date` (string · date) — Optional project end date.
- `create_missing_customers` (boolean) — When true, rows whose customer_name matches no existing customer create that customer inline instead of failing.

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_ProjectBulkCreateResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (ProjectBulkCreateResponse)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 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/projects/bulk' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "rows": []
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "rows": []
}

response = httpx.post("https://api.ondayzero.com/api/v1/projects/bulk", headers=headers, json=payload)
data = response.json()
```

## See also

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