# List documents `GET /api/v1/documents` Lists document records in the workspace. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Documents → Read**. ## Headers - `X-Sport-Id` (integer) — Use the sport ID to limit the response to one sport. ## Query parameters - `athlete_id` (integer) — ID of the athlete in the selected sport. - `expand_athlete` (integer) — Use 1 to include the related athlete when available. - `q` (string) — Search document names and any expanded recipient names. - `length` (integer) — Number of records to return. - `start` (integer) — Zero-based offset. - `draw` (string) — Optional request marker echoed in the response. - `sort` (string) — Sort by id, name, belongs_to, belongs_obj_id, released_at, expires_at, got_paper, is_agonistic, filetype, filesize, url, tsc, or tsu. Prefix the field name with a minus sign for descending order. - `order` (string) — Direction for unprefixed sort fields. Use asc or desc. - `coach_id` (integer) — Filter by coach when context is coach_detail. - `context` (string) — Use coach_detail with coach_id. Aliases view_context and page_context. - `staff_id` (integer) — Filter by staff member. - `expand_recipient` (integer) — Use 1 to include the recipient's name as recipient_fullname. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --get \ --url "https://api.asdincloud.com/api/v1/documents" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --data-urlencode "athlete_id=42" \ --data-urlencode "length=25" ``` ## Response **200 OK** Returns records in `data`, counts before and after text search, and the echoed `draw` marker. Example with fictional data and selected fields. ```json { "status": "success", "data": [ { "id": 31, "sport_id": 3, "belongs_to": "athlete", "belongs_obj_id": 42, "name": "Registration consent", "doc_number": "DOC-DEMO-001", "released_at": 1788220800, "expires_at": 1819756800, "is_medical": false, "got_paper": true, "url": null, "notes": "Paper copy received." } ], "records_total": 1, "records_filtered": 1, "draw": null } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission.