# Make your first GenHealth API request

> Authenticate with a GenHealth API key and retrieve the first page of cases for your organization.

Source: [https://genhealth.ai/docs/quickstart](https://genhealth.ai/docs/quickstart)

> **Before you begin**
>
> You need a GenHealth-issued API key with read access. [Sign up for GenHealth](https://umpa.genhealth.ai/api/auth/login?screen_hint=signup) to request access. Keep the key on the server and never commit it to source control.

### 1. Store your API key

Set the key as an environment variable in your development environment.

```bash
export GENHEALTH_API_KEY="<YOUR_API_KEY>"
```

### 2. List cases

Send the API key as a bearer token and request the first page of cases.

```bash
curl 'https://api.umpa.genhealth.ai/v2/cases?page=1&limit=10' \
  --header "Authorization: Bearer $GENHEALTH_API_KEY" \
  --header 'Accept: application/json'
```

### 3. Follow the pagination object

Use the returned pagination metadata to request subsequent pages. Case results are always limited to the authenticated organization.

## Understand the response

Successful list requests return a data array and pagination metadata. Store resource IDs from the response instead of depending on display text, which may change over time.

```json
{
  "data": [{ "id": "case_123", "status": "open" }],
  "pagination": { "page": 1, "limit": 10, "has_more": false }
}
```

## Handle errors

| Status | Meaning | What to do |
| --- | --- | --- |
| 401 | Credential was not accepted | Check the bearer token and its expiration |
| 404 | Resource was not found | Confirm the ID and organization access |
| 422 | Request parameters are invalid | Use the error details to correct the request |

## Next steps

- [Retrieve one case](https://genhealth.ai/docs/api-reference/v1/cases/get-case.md): Read the full details for a known case ID.
- [Find policies](https://genhealth.ai/docs/api-reference/v1/policies/list-policies.md): Filter active policies by title or publisher.
