# POST /api/v1/notes

> Create a note

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

## Description

Create a new note for the current business.

## Authentication

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

## Request body

Schema: `NoteCreateRequest`

- `title` (string)
- `body` (string)

## Responses

### 201 — Successful Response

Schema: `NoteResponse`

- `id` (string · required)
- `title` (string · required)
- `body` (string)
- `pinned` (boolean)
- `author_id` (string · required)
- `author_name` (string)
- `author_email` (string)
- `created_at` (string · date-time · required)
- `updated_at` (string · date-time · required)
- `attachments` (array · AttachmentResponse) → `AttachmentResponse`
  - `id` (string · required)
  - `note_id` (string · required)
  - `file_name` (string · required)
  - `file_size` (integer · required)
  - `mime_type` (string · required)
  - `uploaded_by` (string · required)
  - `created_at` (string · date-time · required)

### 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' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "string",
  "body": "string"
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "title": "string",
  "body": "string"
}

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

## See also

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