# POST /api/v1/intents/route

> Route user intent

- **Tag:** intents
- **Operation ID:** `route_intent_api_v1_intents_route_post`

## Description

Classify a Command-K query and return the appropriate action.

## Authentication

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

## Request body

Schema: `IntentRequest`

- `query` (string · required)

## Responses

### 201 — Successful Response

Schema: `IntentResponse`

- `action` (string · required) — navigate | search | ai_task_started | unknown
- `url` (string) — URL for navigation
- `search_query` (string) — Query for search
- `task_id` (string) — Task ID for AI mutations
- `confidence` (number) — Classification confidence

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

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "query": "string"
}

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

## See also

- HTML version: https://www.ondayzero.com/docs/reference/intents/route-intent
- OpenAPI slice: https://www.ondayzero.com/docs/reference/intents/route-intent/openapi.json
- Other endpoints in **intents**: https://www.ondayzero.com/docs/reference/intents
