# Create a medical certificate `POST /api/v1/medicals` Creates a medical certificate. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Medicals → Write**. ## Headers - `X-Sport-Id` (integer, required) — The sport ID from [List sports](/api/sports/list.md). Use the sport the record belongs to. ## Body parameters - `athlete_id` (integer, required) — ID of the athlete in the selected sport. - `doc_number` (string, required) — Document number, up to 50 characters. - `released_at` (integer or date string, required) — Issue date, as Unix seconds or an ISO date. - `expires_at` (integer or date string, required) — Expiration date, as Unix seconds or an ISO date. - `got_paper` (boolean) — Whether the club received a paper copy. - `notes` (string or null) — Notes, up to 200 characters. - `is_agonistic` (boolean) — Whether the certificate is for competitive activity. - `url` (string or null) — URL for an already-uploaded attachment. - `filetype` (string or null) — MIME type of the attachment. - `filesize` (integer or null) — Attachment size in bytes. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/medicals" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"athlete_id":42,"doc_number":"CERT-DEMO-001","released_at":1788220800,"expires_at":1819756800,"got_paper":true}' ``` ## Response **201 Created** The created medical certificate is returned in data. Example with fictional data and selected fields. ```json { "message_key": "entities.medical.messages.created", "data": { "id": 32, "sport_id": 3, "belongs_to": "athlete", "belongs_obj_id": 42, "name": "Medical", "doc_number": "CERT-DEMO-001", "released_at": 1788220800, "expires_at": 1819756800, "is_medical": true, "got_paper": true, "url": null, "notes": null, "is_agonistic": 0 } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The athlete was not found in the selected sport. - `409` — The file is still processing. - `422` — One or more fields failed validation. - `500` — The record or attachment association could not be saved.