# Classify a voice command into an action code

Operation ID: `patient.assistantClassify`

Classify a transcribed voice command into one action code from the built-in (or caller-supplied) action catalog, using an LLM classifier. Always returns HTTP 200 — an unmatched command, missing/invalid input, or an unconfigured/failed LLM call all resolve to `{"Action": ""}` rather than an error response. No authentication is required.

## Public method

`classifyVoiceCommand`

Signature: `patient.classifyVoiceCommand(request)`

Return type: `Promise<ClassifyResponse>`

## Authentication

Classification: **PUBLIC**

## Prerequisites

None documented.

## HTTP

`POST /assistant/classify`

## Path parameters

None.

## Query parameters

None.

## Body parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `body` | [`AssistantClassifyRequest`](../models/AssistantClassifyRequest.md) | Yes |  |  |  | No |  |

Request model: [`AssistantClassifyRequest`](../models/AssistantClassifyRequest.md)

## Request example

```json
{
  "options": [
    {
      "code": "VIEW_APPOINTMENTS",
      "examples": [
        "show me my upcoming appointments"
      ],
      "label": "View appointments"
    }
  ],
  "text": "show me my upcoming appointments"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`AssistantClassifyResponse`](../models/AssistantClassifyResponse.md) | application/json | Matched action code, or empty when nothing matches |

## Success response examples

### 200

```json
{
  "Action": "VIEW_APPOINTMENTS"
}
```

## Common errors

None declared in canonical OpenAPI.

## Error examples

None declared in canonical OpenAPI.

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
import type { ClassifyRequest } from "@healthcloudai/hc-sdk";
```

```ts
const request = {
  "options": [
    {
      "code": "VIEW_APPOINTMENTS",
      "examples": [
        "show me my upcoming appointments"
      ],
      "label": "View appointments"
    }
  ],
  "text": "show me my upcoming appointments"
};

const result = await patient.classifyVoiceCommand(request);
```

## cURL

```bash
curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"options":[{"code":"VIEW_APPOINTMENTS","examples":["show me my upcoming appointments"],"label":"View appointments"}],"text":"show me my upcoming appointments"}' \
  'https://dev-api-patient.health.cloud/assistant/classify'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
