# API Tokens

Terrakube has two kinds of API tokens: user and team. Each token type has a different access level and creation process, which are explained below.

API tokens are only shown once when you create them, and then they are hidden. You have to make a new token if you lose the old one.

### User API Tokens <a href="#user-api-tokens" id="user-api-tokens"></a>

API tokens may belong directly to a user. User tokens inherit permissions from the user they are associated with.

User API tokens can be generated inside the **User Settings**.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-c5ea8ef32d53e5d0fcb95246868344852dc6a807%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Click the **Generate and API token** button

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-927c215022b53c989eeac48ecb1c6c193c6f09b9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Add some small description to the token and the duration

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-9cd0c6056351b0c8bb69c7bf05b2a1b7ceac59c9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The new token will be showed and you can copy it to star calling the Terrakube API using Postman or some other tool.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-f9f1807ef21c9b251849e1c782521a5782f116d3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Delete API Tokens <a href="#user-api-tokens" id="user-api-tokens"></a>

To delete an API token, navigate to the list of tokens, click the **Delete** button next to the token you wish to remove, and confirm the deletion.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-dc2bf86ca001e02bc690a99c142cdf69351e250b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Team API Tokens <a href="#user-api-tokens" id="user-api-tokens"></a>

API tokens may belong to a specific team. Team API tokens allow access Terrakube, without being tied to any specific user.

{% hint style="warning" %}
A team token can only be generated if you are member of the specified team.
{% endhint %}

To manage the API token for a team, go to **Settings > Teams > Edit button on the desired team**.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-898ea893316853a4a07702b63a48d8498a227c17%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Click the **Create a Team Token** button in the Team API Tokens section.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-0c7c234f07d7bfc27d275c00d047873643a99e4f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Add the token description and duration and click the **Generate token** button

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-bd52d18c1d92f3c0a767080dfad36dd74fb15cb1%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The new token will be showed and you can copy it to star calling the Terrakube API using Postman or some other tool.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-484c0dff725323705295b0054c3a574ddcd6a1fb%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Delete Team API Tokens <a href="#user-api-tokens" id="user-api-tokens"></a>

To delete an API token, navigate to the list of tokens, click the **Delete** button next to the token you wish to remove, and confirm the deletion.

<figure><img src="https://4014930676-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfAN3V983Y82_trlbcu%2Fuploads%2Fgit-blob-6cfe75b5ad4799920e6e9e8522276173072f06af%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.terrakube.io/user-guide/organizations/api-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
