# POST /api/v1/notes/bulk

> Bulk-create notes (localStorage migration)

- **Tag:** notes
- **Operation ID:** `create_notes_bulk_api_v1_notes_bulk_post`

## Description

Create multiple notes at once, used to migrate existing localStorage notes to the database.

## Authentication

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

## Request body

Schema: `NoteBulkCreateRequest`

- `notes` (array · NoteCreateRequest · required) → `NoteCreateRequest`
  - `title` (string)
  - `body` (string)

## Responses

### 201 — Successful Response

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

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "notes": []
}

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

## See also

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