# Update a tag `PATCH / PUT / POST /api/v1/tags/{id}` Updates a tag by ID. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Tags → Write**. ## Path parameters - `id` (integer, required) — ID of the tag. ## Body parameters - `name` (string) — Name, up to 100 characters. - `tag_type` (string) — Use tag or accounting_category. Defaults to tag. - `direction` (string or null) — Use incoming or outgoing for accounting categories. - `selected` (boolean) — Select this as the default accounting category. Supply the intended name, type, direction, and default flag when updating the tag. ## 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/tags/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"name":"Annual fees","tag_type":"accounting_category","direction":"incoming","selected":false}' ``` ## 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/tags/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"name":"Annual fees","tag_type":"accounting_category","direction":"incoming","selected":false}' ``` ## 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/tags/${ID:?Set ID}" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --data '{"name":"Annual fees","tag_type":"accounting_category","direction":"incoming","selected":false}' ``` ## Response **200 OK** Returns a successful update response. Example with fictional data and selected fields. ```json { "message_key": "entities.tag.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 type or direction is invalid. - `422` — One or more fields failed validation. - `500` — The change could not be saved.