# List plans `GET /api/v1/plans` Lists plan records in the workspace. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Plans → Read**. ## Headers - `X-Sport-Id` (integer) — Use the sport ID to limit the response to one sport. ## Query parameters - `expired` (integer) — Use 1 to list plans whose end date has passed. The default returns plans that have not ended. - `q` (string) — Search by plan name. - `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, amount, plan_start, 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. ## 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/plans" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --data-urlencode "length=25" \ --data-urlencode "sort=name" ``` ## Response **200 OK** Returns matching plans in `data` with counts before and after text search. Example with fictional data and selected fields. ```json { "status": "success", "data": [ { "id": 13, "sport_id": 3, "name": "Junior season", "amount": 18000, "currency": "EUR", "plan_start": 1788220800, "plan_end": 1819756800, "is_membership_fee": 0, "exclude": 0, "exclude_from_renewals": 0, "metadata": {} } ], "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.