# List medical codes

> Returns medical codes available to the authenticated organization.

Source: [https://genhealth.ai/docs/api-reference/v1/codes/list-codes](https://genhealth.ai/docs/api-reference/v1/codes/list-codes)

## Endpoint

`GET /v1/codes`

## Authentication

Send a GenHealth credential in the `Authorization` header:

```http
Authorization: Bearer <YOUR_API_KEY>
Accept: application/json
```

Required scopes: `read:umpa`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `page` | query | integer | No | Page number. Default: 1. |
| `limit` | query | integer | No | Records per page. Default: 20. |
| `query` | query | string | No | Search by code or display name. |

## Request examples

### cURL

```curl
curl --request GET \
  --url 'https://api.umpa.genhealth.ai/v1/codes?page=1&limit=20' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Accept: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.umpa.genhealth.ai/v1/codes?page=1&limit=20', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <YOUR_API_KEY>',
    Accept: 'application/json',
  },
});

const data = await response.json();
```

### Python

```python
import requests

response = requests.get(
    'https://api.umpa.genhealth.ai/v1/codes?page=1&limit=20',
    headers={
        'Authorization': 'Bearer <YOUR_API_KEY>',
        'Accept': 'application/json',
    },
)

data = response.json()
```

## Responses

| Status | Description |
| --- | --- |
| 200 | Medical-code results. |
| 401 | The bearer token is missing, invalid, or lacks the required scope. |

### 200 response example

```json
[
  {
    "code": "99213",
    "system": "CPT",
    "display": "Office or other outpatient visit"
  }
]
```

### 401 response example

```json
{
  "detail": "The request could not be completed."
}
```
