# Update a file `PATCH / PUT / POST /api/v1/files/{id}` Updates a file by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Files → 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 file. ## Body parameters - `name` (string) — Original filename or folder name, up to 160 characters. - `friendly_name` (string or null) — Optional display name, up to 160 characters. Use null to clear it. - `description` (string or null) — Description, up to 160 characters. Use [Move files or folders](/api/files/move.md) to change the parent folder. ## 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/files/${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 '{"friendly_name":"Welcome and registration guide"}' ``` ## 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/files/${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 '{"friendly_name":"Welcome and registration guide"}' ``` ## 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/files/${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 '{"friendly_name":"Welcome and registration guide"}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "status": "success", "message_key": "entities.file.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. - `400` — The display name must be a string. - `409` — The item is managed in company settings. - `422` — One or more fields failed validation.