# List messages `GET /api/v1/messages` Lists message records in the workspace. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Messages → Read**. ## Query parameters - `channel` (string) — Filter by email or sms. - `status` (string or array) — Filter by one status or several comma-separated statuses. - `email` (string) — Recipient email address. - `phone` (string) — Filter by exact phone number. - `athlete_id` (integer or null) — ID of the associated athlete. - `parent_id` (integer or null) — ID of the associated parent. - `staff_id` (integer or null) — ID of the associated staff member or coach. - `coach_id` (integer) — Filter by coach. Takes precedence over staff_id. - `q` (string) — Search text, subject, or recipient contact details. - `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, tsc, tsu, channel, status, sent_at, delivered_at, read_at, or clicked_at. Prefix the field name with a minus sign for descending order. - `order` (string) — Direction for unprefixed sort fields. Use asc or desc. ## 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/messages" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --data-urlencode "channel=email" \ --data-urlencode "status=queued" \ --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": 18, "channel": "email", "status": "queued", "email": "alex@example.com", "subject": "Practice schedule", "body": "
Practice starts at 18:00.
", "sent_at": null, "recipient_type": "athlete", "recipient_name": "", "source_type": "direct" } ], "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.