# POST /api/v1/contracts/{contract_id}/drawdowns

> Record a drawdown (hours consumed)

- **Tag:** contracts
- **Operation ID:** `record_drawdown_api_v1_contracts__contract_id__drawdowns_post`

## Description

Records hours consumed as a pending entry awaiting approval.

## Authentication

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

## Parameters

- `contract_id` (path, string, required)

## Request body

Schema: `DrawdownCreate`

- `order_line_id` (string) — Order line the hours are drawn against.
- `catalog_item_id` (string) — Catalog item.
- `hours` (number | string · required) — Hours consumed.
- `entry_date` (string · required) — Date the work happened (YYYY-MM-DD).
- `description` (string) — Optional note.
- `submitted_by` (string) — Who submitted the hours.
- `submitted_via` (string) — slack, email, or manual.
- `source_message_id` (string) — ID of the reply that created this entry.

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_DrawdownResponse_`

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

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

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "hours": "string",
  "entry_date": "string"
}

response = httpx.post("https://api.ondayzero.com/api/v1/contracts/{contract_id}/drawdowns", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/contracts/record-drawdown
- OpenAPI slice: https://www.ondayzero.com/docs/reference/contracts/record-drawdown/openapi.json
- Other endpoints in **contracts**: https://www.ondayzero.com/docs/reference/contracts
