---
title: "Updates a token"
method: PUT
path: "/api/v1/tokens/{id}"
tags: ["tokens"]
---

# Updates a token

`PUT /api/v1/tokens/{id}`

## Request

- Base URL: `https://demo.invoiceninja.com`
- URL: `https://demo.invoiceninja.com/api/v1/tokens/{id}`
- Auth: none declared. Required headers: `X-API-TOKEN`, `X-Requested-With`
- TypeScript: <https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/docs/api/v1/tokens/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Handles the updating of a token by id

## Path parameters

- `id` string, string, required

## Query parameters

- `include` string

## Headers

- `X-API-TOKEN` string, required
- `X-Requested-With` string, required

## Response `200`

Returns the token object

- CompanyToken
  - `name` string: The token name
  - `token` string: The token value
  - `is_system` boolean: Determines whether the token is created by the system rather than a user

## Other responses

- `401`: Authentication error
- `403`: Authorization error
- `422`: Validation error
- `default`: Unexpected Error

## Changes

> 110 revisions in range; 1 not diffed.

- **2024-06-06** `8e82a2bd77e0`: 2 breaking, 5 info
  - the response's body type changed from no type to `object` for status `200`
  - the response's body type changed from no type to `object` for status `default`
  - added the optional property `code` to the response with the `default` status
  - added the optional property `is_system` to the response with the `200` status
  - …3 more
- **2024-06-05** `e61df65649e2`: 1 breaking, 2 warning
  - the response's body type changed from `object` to no type for status `default`
  - removed the optional property `code` from the response with the `default` status
  - removed the optional property `message` from the response with the `default` status
- **2024-06-05** `4ca478d85068`: 1 breaking, 3 warning
  - the response's body type changed from `object` to no type for status `200`
  - removed the optional property `is_system` from the response with the `200` status
  - removed the optional property `name` from the response with the `200` status
  - removed the optional property `token` from the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/changes/api/v1/tokens/:id/put.md)

---

[API](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference.md) - [All operations](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/invoiceninja/apis/invoice-ninja-api-reference/revisions/bcda1f823746?raw)
