+++
title = "Creating an API Token"
weight = 40
updated = 2023-06-16
aliases = ["/docs/creating-an-api-token.html", "/docs/account-and-organization-management/organization-account/api-tokens/"]

[extra]
nav_title = "API Tokens"
weight = 50
+++

An API Token is required in order to access the API.

<div class="note warning">
  <strong>Alpha Stage:</strong> We are currently releasing our API in its Alpha phase. This means it may not be feature-complete, and is subject to change without notice.
</div>

Navigate to <a href="https://bonsai.io/account">your account</a> and click on the <a href="https://app.bonsai.io/api_tokens">API Tokens</a> tab. Then click on the "Generate Token" button.

Every time a token is used to submit to the API, we create a log of which token was used, the auth method and owner of the token, and the IP address of the requester.

To revoke a token, click on the Revoke button. A confirmation dialog will appear. Once revoked, the token can no longer be used to access the API and will result in a HTTP 401 Authorization error.

We associate the token with a specific user that belongs to the account. You should treat your token like a password. Do not hard-code it into applications, check it into source control, or share it.