# Update a sport `PATCH / PUT /api/v1/sports/{id}` Updates an existing sport in the workspace associated with your API key. Both PATCH and PUT accept the same JSON body. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Sports → Write**. ## Path parameters - `id` (integer, required) — The sport ID returned by [List sports](/api/sports/list.md). ## Body parameters - `name` (string) — The name used in the workspace. Use 1 to 100 characters when supplied. - `public_name` (string) — The name shown on public pages. Use 1 to 100 characters when supplied. - `slug` (string) — The URL segment used on public pages. Use a unique slug of up to 50 characters with lowercase letters, digits, hyphens, or underscores. - `is_hidden` (boolean or null) — Set to `true` to hide the sport. Set to `false` or `null` to clear the hidden flag when the sport is not archived. - `archived_at` (boolean or null) — Send `true` to archive and hide the sport using the current server time. Send `false` or `null` to clear the archive timestamp. Omitting `is_hidden` or `archived_at` clears the corresponding field. The example keeps a visible sport visible. To keep a hidden sport hidden, send `is_hidden: true` and `archived_at: null`. Keeping a sport archived sets a new archive timestamp. ## Request (PATCH) Set ASDINCLOUD_API_KEY before running. ```sh curl --request PATCH \ --url "https://api.asdincloud.com/api/v1/sports/1" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"public_name":"Youth Basketball","is_hidden":null,"archived_at":null}' ``` ## Request (PUT) Set ASDINCLOUD_API_KEY before running. ```sh curl --request PUT \ --url "https://api.asdincloud.com/api/v1/sports/1" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"public_name":"Youth Basketball","is_hidden":null,"archived_at":null}' ``` ## Response **200 OK** Returns `200 OK` with a `message_key` confirming the update. Use [Retrieve a sport](/api/sports/retrieve.md) to read the updated object. Example with fictional data and selected fields. ```json { "message_key": "entities.sport.messages.updated" } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks Sports write access. - `404` — The sport was not found. - `422` — One or more fields failed validation.