# Subscribe team athletes `POST /api/v1/teams/{id}/subscribe` Creates a subscription for each athlete currently assigned to the team using an existing plan. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Teams → Write**. ## Headers - `X-Sport-Id` (integer, required) — The sport ID from [List sports](/api/sports/list.md). Use the sport the team belongs to. ## Path parameters - `id` (integer, required) — The team ID returned by [List teams](/api/teams/list.md). ## Body parameters - `plan_id` (integer, required) — The ID of the existing plan to apply. - `subscription_start` (integer or string) — Unix timestamp in seconds or a date such as `2026-12-01`. Uses the plan start or current time when omitted. - `subscription_end` (integer or string) — Unix timestamp in seconds or a date such as `2027-05-31`. Uses the plan end when omitted. This request can also create expected payments and associated memberships. Check the result before retrying. A retry can create duplicate subscriptions. The API accepts a key with Teams write access, but subscription saves can fail when the workspace cannot attribute the request to a user. Check which subscriptions already exist before continuing in the workspace. ## Request Set ASDINCLOUD_API_KEY, SPORT_ID, and TEAM_ID before running. Replace the example plan ID and dates. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/teams/${TEAM_ID:?Set TEAM_ID}/subscribe" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: $SPORT_ID" \ --header "Content-Type: application/json" \ --data '{"plan_id":7,"subscription_start":"2026-12-01","subscription_end":"2027-05-31"}' ``` ## Response **200 OK** `created` counts successful subscriptions and `total` counts athletes processed. A `200 OK` can also include `status: partial` and per-athlete errors when some subscriptions could not be saved. Example with fictional data and selected fields. ```json { "message_key": "entities.subscription.messages.bulk_created", "vars": { "created": 4, "total": 4 }, "status": "success", "created": 4, "total": 4 } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks one or more required permissions. - `400` — A plan ID is required or the team has no athletes. - `404` — The team was not found in the selected sport, or the plan was not found. - `500` — The request could not finish. Check existing subscriptions before retrying.