# 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://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-c5ea8ef32d53e5d0fcb95246868344852dc6a807%2Fimage%20(164).png?alt=media" alt=""><figcaption></figcaption></figure>

Click the **Generate and API token** button

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

Add some small description to the token and the duration

<figure><img src="https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-9cd0c6056351b0c8bb69c7bf05b2a1b7ceac59c9%2Fimage%20(234).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://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-f9f1807ef21c9b251849e1c782521a5782f116d3%2Fimage%20(210).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://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-898ea893316853a4a07702b63a48d8498a227c17%2Fimage%20(345).png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

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

<figure><img src="https://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-bd52d18c1d92f3c0a767080dfad36dd74fb15cb1%2Fimage%20(347).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://2194998553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR6VsmuTZWhfdwP7uD6e0%2Fuploads%2Fgit-blob-484c0dff725323705295b0054c3a574ddcd6a1fb%2Fimage%20(348).png?alt=media" alt=""><figcaption></figcaption></figure>
