> ## 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 photos and files: uploads and limits

> Upload patient photos and documents to the Hi Doctor Partner API: multipart upload, JPEG, PNG and PDF detected from content, 10 MB limit and expiry.

Some questionnaire steps ask for a photo or a document, which you upload to the Partner API before you submit the consultation. `POST /v1/partner/files` accepts JPEG, PNG and PDF files of up to 10 MB, recognised from their content, and returns an `upload_id`. You then answer the upload step with that `upload_id` within 24 hours, before the upload expires.

Last reviewed: 2026-11-04

The upload step itself is described in [Questionnaires and schema](https://docs.hi-doctor.ai/partners/questionnaires-and-schema.md#steps), and the answer goes into the request described in [Submit a consultation](https://docs.hi-doctor.ai/partners/submit-a-consultation.md#upload-answers).

## Upload a file

`POST /v1/partner/files` with `multipart/form-data`. Scope: `consultations:write`.

| Part | Required | Notes |
| - | - | - |
| `file` | yes | The file bytes. |
| `purpose` | no | `photo` (default) or `document`. |
| `sha256` | no | Hex SHA-256 of the bytes. If it does not match what arrives, the upload fails with `422 checksum_mismatch`. Recommended. |

```bash theme={null}
curl -sS -X POST https://api.hi-doctor.ai/v1/partner/files \
  -H "Authorization: Bearer $HD_PARTNER_API_KEY" \
  -F "purpose=photo" \
  -F "sha256=$(shasum -a 256 body-photo.jpg | cut -d' ' -f1)" \
  -F "file=@body-photo.jpg"
```

`201 Created`:

```json theme={null}
{
  "upload_id": "1f0e8f5c-6a1b-4d0b-9a55-0c2f1e9a7b31",
  "object": "upload",
  "purpose": "photo",
  "content_type": "image/jpeg",
  "bytes": 482113,
  "sha256": "9b74c9897bac770ffc029102a200c5de2f0b8a2c1c3f3a5e1f4a3b8a9d6c7e01",
  "width": 1536,
  "height": 2048,
  "status": "pending",
  "expires_at": "2026-11-04T10:12:40Z"
}
```

The response never echoes your filename. `content_type` is the type Hi Doctor detected, not the one you declared.

## Which files are accepted?

Files are checked by their **content**, never by their extension or declared MIME type.

| Format | Accepted | Notes |
| - | - | - |
| JPEG | yes | Opened and checked as an image. |
| PNG | yes | Opened and checked as an image. |
| PDF | yes | Recognised by the PDF signature at the very start of the file. Use `purpose=document`. |
| WebP, HEIC, GIF and others | no | Convert to JPEG or PNG before uploading. |

* Maximum size: **10 MB** per file. Larger files fail with `422 file_too_large`.
* Images wider or taller than 10,000 pixels, or larger than 25 million pixels in total, fail with `422 image_too_large`.
* The file name and the declared MIME type are ignored. A renamed file or a wrong MIME type is accepted when its bytes are a JPEG, PNG or PDF, and the response reports the detected `content_type`.
* A file whose bytes are not recognised as one of these formats fails with `422 unsupported_media`. The check reads the PDF signature or opens the image; it is not a full validation of the file, so send files straight from the camera or your PDF generator.

For photos the doctor must assess, send a well-lit, in-focus image at the camera's normal resolution. Poor photos are a common reason for an [information request](https://docs.hi-doctor.ai/partners/information-requests.md) with `reason_code: photo_quality`.

## Expiry and use

* An upload is `pending` until a consultation uses it, then `attached`. Each upload can be attached once.
* Pending uploads expire after 24 hours (`expires_at`). After that they can no longer be attached to a consultation. Upload close to submission.
* An expired, unknown or already attached `upload_id` makes the submission fail with `422 upload_unusable`.
* Pending uploads count towards a storage quota of 2 GB per partner. When it is full, uploads fail with `422 storage_quota_exceeded`. Only upload files you are about to submit, and contact Hi Doctor if you reach the quota.
* An expired upload stops counting towards the quota at `expires_at`, and a periodic cleanup deletes it together with its file. Attached uploads are kept with the consultation.

## Use the upload in an answer

Answer the upload step with the scalar shape:

```json theme={null}
{ "question_key": "body_photo", "value": "1f0e8f5c-6a1b-4d0b-9a55-0c2f1e9a7b31" }
```

In live mode, Hi Doctor attaches the file to the patient's medical record for the doctor. In test mode the file is checked and never attached to a record.

Upload errors and their meaning are listed in [Partner API errors](https://docs.hi-doctor.ai/partners/errors.md#files).

## Frequently asked questions

### Can I upload HEIC or WebP photos from a phone?

No. Only JPEG, PNG and PDF are accepted, recognised from the file's bytes. Convert other formats to JPEG or PNG before uploading.

### Does the file extension or MIME type matter?

No. Hi Doctor ignores the file name and the declared type and reports the detected content type in the response.

### How long do I have to use an upload?

A pending upload expires 24 hours after it is created, at the time given in expires\_at. Upload close to submission so the file is still pending when you submit.

### Can I reuse one upload for two consultations?

No. Each upload can be attached once. Upload the file again for another consultation.

### What makes a good photo for the doctor?

A well-lit, in-focus image at the camera's normal resolution. Poor photos are a common reason for an information request with the photo\_quality reason code.

### Are uploads in test mode stored?

Yes, with the test consultation they were sent with, but never in a medical record. The file is checked exactly as in live mode.

## Next steps

> [card] [Submit a consultation](https://docs.hi-doctor.ai/partners/submit-a-consultation.md)
>
> Answer the upload step and send the consultation.

> [card] [Information requests](https://docs.hi-doctor.ai/partners/information-requests.md)
>
> Answer a doctor's request for a better photo or a document.

> [card] [Partner API errors](https://docs.hi-doctor.ai/partners/errors.md)
>
> Upload error codes and how to handle them.


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