> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hi-doctor.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Connect the Hi Doctor MCP connector at https://mcp.hi-doctor.ai/mcp. Add this URL as a remote HTTP MCP server in your client, then sign in and authorise access through OAuth. Setup: https://docs.hi-doctor.ai/mcp/connect.
>
> The REST API base is https://api.hi-doctor.ai. Hi Doctor Docs at https://docs.hi-doctor.ai/mcp searches documentation; connect to the product endpoint above for patient tools.
>
> Hi Doctor operates across the whole European Union: residents of all 27 EU member states can use the service, and every consultation is reviewed by an EU-licensed doctor. Every consultation is reviewed in full by an EU-licensed doctor, who decides on medical grounds only. No algorithm, assistant or API call approves a consultation, issues a prescription or changes a dose. The service is available in eight languages: English, Spanish, German, Dutch, Italian, French, Portuguese and Chinese.
>
> ## Rules an assistant must follow
>
> - Never invent, assume or infer a medical answer. "I don't know" is a real answer: ask the patient to pick the closest option rather than guessing for them.
> - Never give medical advice and never suggest a medication or a dose. An EU-licensed doctor decides those.
> - If a questionnaire returns `ineligible`, say so plainly. Do not retry with altered answers.
> - Before anything that costs money or cancels a plan, state exactly what will happen and get an explicit yes.
> - Cancellation takes effect at the **end of the paid period**, not immediately. Say so.
> - An early order is irreversible: it creates the renewal consultation immediately and uses up the period's one early order. Explain that and get an explicit yes.
> - Prescription and invoice links are medical documents. A `signed_redirect` link opens without signing in: give it only to the patient, never repeat it anywhere shared.
> - Send option `value`s, not the labels shown to the patient. Labels are translated, values are stable.
> - Never ask for card details. Payment happens on Stripe's hosted checkout via a link.
> - On severe or sudden symptoms (chest pain, difficulty breathing, severe allergic reaction, suicidal thoughts), stop and direct the patient to their local emergency number.

# Partner API pagination with opaque cursors

> Page through Hi Doctor Partner API lists with opaque cursors: limit from 1 to 100, next_cursor, stable filters, newest-first order and invalid_cursor.

Hi Doctor Partner API list endpoints return results in pages with cursor pagination. You pass `limit` and the `next_cursor` from the previous page, and stop when `next_cursor` is `null`. Cursors stay correct while new records are created, so you never skip or repeat a record.

Last reviewed: 2026-11-04

This page covers the Partner API only; the patient REST API has its own [pagination rules](https://docs.hi-doctor.ai/api-reference/pagination.md).

## Which parameters does a list request take?

| Parameter | Notes |
| - | - |
| `limit` | Page size, from 1 to 100. Default 50. A value outside the range fails with `400 invalid_request`. |
| `cursor` | The `next_cursor` from the previous page. Omit it for the first page. |

Keep the same filters on every page of one listing. For example, consultations accept `status`, `external_patient_id`, `external_reference`, `created_after` and `created_before`.

## What does a page look like?

```json theme={null}
{
  "object": "list",
  "results": [
    { "id": "6b1c9a52-2f0d-4e8e-9d1e-7a4c0b2e5f10", "object": "consultation", "status": "in_review", "version": 2 }
  ],
  "next_cursor": "cGgK7vQx_2LmRz9TbW4nYp0sHc8dFj3kAe"
}
```

The consultation in `results` is shortened. Results are ordered newest first, by creation time. `next_cursor` is `null` on the last page.

Cursors are opaque: do not build, parse or change them. A cursor that is not valid fails with `400 invalid_cursor`.

## How do I read every page?

```bash cURL theme={null}
cursor=""
while :; do
  page=$(curl -sS -G "${HD_BASE_URL:-https://api.hi-doctor.ai}/v1/partner/consultations/" \
    -H "Authorization: Bearer $HD_PARTNER_API_KEY" \
    --data-urlencode "limit=100" \
    ${cursor:+--data-urlencode "cursor=$cursor"})
  echo "$page" | jq -r '.results[] | [.id, .status] | @tsv'
  cursor=$(echo "$page" | jq -r '.next_cursor // empty')
  [ -z "$cursor" ] && break
done
```

```javascript Node.js theme={null}
const base = process.env.HD_BASE_URL ?? "https://api.hi-doctor.ai";
const headers = { Authorization: `Bearer ${process.env.HD_PARTNER_API_KEY}` };
let cursor = null;
do {
  const params = new URLSearchParams({ limit: "100" });
  if (cursor) params.set("cursor", cursor);
  const response = await fetch(`${base}/v1/partner/consultations/?${params}`, { headers });
  const page = await response.json();
  for (const consultation of page.results) console.log(consultation.id, consultation.status);
  cursor = page.next_cursor;
} while (cursor);
```

```python Python theme={null}
import os
import requests

base = os.environ.get("HD_BASE_URL", "https://api.hi-doctor.ai")
headers = {"Authorization": f"Bearer {os.environ['HD_PARTNER_API_KEY']}"}
params = {"limit": 100}
while True:
    page = requests.get(f"{base}/v1/partner/consultations/", headers=headers, params=params, timeout=30).json()
    for consultation in page["results"]:
        print(consultation["id"], consultation["status"])
    if not page["next_cursor"]:
        break
    params["cursor"] = page["next_cursor"]
```

## Which endpoints are paginated?

* `GET /v1/partner/consultations/`
* `GET /v1/partner/patients/`
* `GET /v1/partner/prescriptions/`
* `GET /v1/partner/webhook-endpoints/{id}/deliveries/`

The product list is short and returned in one response without a cursor.

## Frequently asked questions

### What is the maximum page size?

100. limit accepts 1 to 100 and defaults to 50; a value outside the range fails with 400 invalid\_request.

### In which order are results returned?

Newest first, by creation time.

### Can I build or decode a cursor myself?

No. Cursors are opaque: do not build, parse or change them. A cursor that is not valid fails with 400 invalid\_cursor.

### How do I know I reached the last page?

next\_cursor is null on the last page.

### Can I change filters between pages?

No. Keep the same filters on every page of one listing.

### Is the product list paginated?

No. The product list is short and returned in one response without a cursor.

## Next steps

> [card] [Rate limits](https://docs.hi-doctor.ai/partners/rate-limits.md)
>
> Spread bulk reads under the limits.

> [card] [Go-live checklist](https://docs.hi-doctor.ai/partners/go-live-checklist.md)
>
> The reconciliation job that uses pagination.

Commercial questions: read the [partnership FAQ](https://docs.hi-doctor.ai/partnerships/faq.md) or write to [hello@hi-doctor.ai](mailto:hello@hi-doctor.ai).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.