# Update a membership `PATCH / PUT / POST /api/v1/memberships/{id}` Updates a membership by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Memberships → Write**. ## Headers - `X-Sport-Id` (integer, required) — The sport ID from [List sports](/api/sports/list.md). Use the sport the record belongs to. ## Path parameters - `id` (integer, required) — ID of the membership. ## Body parameters - `subject_type` (string) — Use athlete, coach, or staff. - `subject_id` (integer) — ID of the person holding the membership. - `organization` (string) — Governing organization, up to 100 characters. - `card_type` (string or null) — Membership card category, up to 100 characters. - `membership_plan_id` (integer or null) — ID of the associated membership plan. - `card_number` (string or null) — Membership card number, up to 100 characters. - `issued_at` (integer or date string or null) — Issue date, as Unix seconds or an ISO date. - `valid_from` (integer or date string) — Start date, as Unix seconds or an ISO date. - `valid_to` (integer or date string) — End date, at or after the start date. The validity period can span up to 366 days. - `season_label` (string or null) — Season label, for example 2026/2027. - `subscription_id` (integer or null) — ID of an associated subscription. - `payment_id` (integer or null) — ID of an associated payment. - `canceled_at` (integer or date string or null) — Cancellation date. Use null to clear it. - `notes` (string or null) — Notes about the membership. - `metadata` (map or null) — Additional membership information. ## Request (PATCH) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/memberships/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"card_number":"DEMO-0043"}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/memberships/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"card_number":"DEMO-0043"}' ``` ## Request (POST) 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/memberships/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"card_number":"DEMO-0043"}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "status": "success", "data": { "id": 28, "sport_id": 3, "subject_type": "athlete", "subject_id": 42, "membership_plan_id": 8, "organization": "Example Sports Federation", "card_number": "DEMO-0043", "card_type": "Junior", "issued_at": 1788220800, "valid_from": 1788220800, "valid_to": 1819756800, "season_label": "2026/2027", "subscription_id": null, "payment_id": null, "canceled_at": null, "notes": null }, "message": "Membership updated" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `404` — The requested record was not found. - `400` — The update failed validation, including a possible overlap with another membership.