# Create a team `POST /api/v1/teams` Creates a team in the sport selected by the X-Sport-Id header. ## 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. ## Body parameters - `name` (string, required) — 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. The API accepts a key with Teams write access, but the save can fail when the workspace cannot attribute the request to a user. If this happens, create the team in the workspace and use [List teams](/api/teams/list.md) to find its ID. ## Request Set ASDINCLOUD_API_KEY and SPORT_ID before running. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/teams" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: $SPORT_ID" \ --header "Content-Type: application/json" \ --data '{"name":"Under 14 Basketball"}' ``` ## Response **201 Created** Returns a confirmation and the newly created [Team object](/api/teams/object.md) in `data`. Example with fictional data and selected fields. ```json { "message_key": "entities.team.messages.created", "data": { "id": 12, "sport_id": 1, "name": "Under 14 Basketball", "archived_at": null } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks one or more required permissions. - `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.