# Update a team `PATCH / PUT / POST /api/v1/teams/{id}` Updates an existing team. PATCH, PUT, and POST accept the same JSON body. ## 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 - `name` (string) — The team name, up to 50 characters. Use a unique name within the sport. - `archived_at` (boolean or null) — Send `true` to archive using the current time. Send `false` or `null` to leave the team unarchived. Omitting `archived_at` clears it. To keep a team archived, send `true`. This replaces its archive timestamp with the current time. ## Request (PATCH) Set ASDINCLOUD_API_KEY, SPORT_ID, and TEAM_ID before running. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/teams/${TEAM_ID:?Set TEAM_ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: $SPORT_ID" \ --header "Content-Type: application/json" \ --data '{"name":"Under 15 Basketball","archived_at":null}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY, SPORT_ID, and TEAM_ID before running. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/teams/${TEAM_ID:?Set TEAM_ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: $SPORT_ID" \ --header "Content-Type: application/json" \ --data '{"name":"Under 15 Basketball","archived_at":null}' ``` ## Request (POST) Set ASDINCLOUD_API_KEY, SPORT_ID, and TEAM_ID before running. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/teams/${TEAM_ID:?Set TEAM_ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: $SPORT_ID" \ --header "Content-Type: application/json" \ --data '{"name":"Under 15 Basketball","archived_at":null}' ``` ## Response **200 OK** Returns a confirmation. Use [Retrieve a team](/api/teams/retrieve.md) to read the updated fields. Example with fictional data and selected fields. ```json { "message_key": "entities.team.messages.updated" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks one or more required permissions. - `404` — The team was not found in the selected sport. Requests with missing or unavailable sport context can also return this status. - `422` — Validation failed. This can include a duplicate name in the sport, even if the existing team is archived or deleted. - `500` — The team could not be saved.