# Update a subscription `PATCH / PUT / POST /api/v1/subscriptions/{id}` Updates a subscription by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Subscriptions → 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 subscription. ## Body parameters - `plan_id` (integer) — ID of the plan. - `athlete_id` (integer) — ID of the athlete. - `subscription_start` (date string) — Start date in YYYY-MM-DD format. - `subscription_end` (date string) — End date in YYYY-MM-DD format. - `custom_amount` (integer or null) — Override the plan amount in minor units. Use null to clear it. Omission also clears the override on this update. - `notes` (string or null) — Notes for the subscription. - `suspended` (boolean) — Set true to suspend or false to clear the suspension. - `canceled` (boolean) — Set true to cancel or false to clear cancellation. Include the current `custom_amount` to preserve an override. ## 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/subscriptions/${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 '{"notes":"Renewal reviewed.","custom_amount":null}' ``` ## 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/subscriptions/${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 '{"notes":"Renewal reviewed.","custom_amount":null}' ``` ## 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/subscriptions/${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 '{"notes":"Renewal reviewed.","custom_amount":null}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "message_key": "entities.subscription.messages.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. - `422` — One or more fields failed validation.