> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IUserApiTokensService

- Package: [@gooddata/sdk-backend-spi](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/index.md)
- Kind: interface
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-backend-spi/src/user/apiTokens/index.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Service for managing API tokens of the current user.

**Signature:**

```typescript
export interface IUserApiTokensService 
```

## Methods

| Method | Description |
| --- | --- |
| [create(id)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iuserapitokensservice/index.md#iuserapitokensservicecreate) | **_(ALPHA)_** Create an API token. |
| [delete(id)](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iuserapitokensservice/index.md#iuserapitokensservicedelete) | **_(ALPHA)_** Delete an API token. |
| [getAll()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-backend-spi/sdk-backend-spi.iuserapitokensservice/index.md#iuserapitokensservicegetall) | **_(ALPHA)_** Get all API tokens of the user. The result does not contain the token secrets. |

## Method details

### IUserApiTokensService.create()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Create an API token.

**Signature:**

```typescript
create(id: string): Promise<IApiTokenWithSecret>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| id | string | identifier of the new token |

**Returns:**

Promise&lt;[IApiTokenWithSecret](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iapitokenwithsecret/index.md)&gt;

the token with its secret; the secret cannot be read again later

### IUserApiTokensService.delete()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Delete an API token.

**Signature:**

```typescript
delete(id: string): Promise<void>;
```

#### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| id | string | identifier of the token |

**Returns:**

Promise&lt;void&gt;

### IUserApiTokensService.getAll()

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Get all API tokens of the user. The result does not contain the token secrets.

**Signature:**

```typescript
getAll(): Promise<IApiToken[]>;
```
**Returns:**

Promise&lt;[IApiToken](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iapitoken/index.md)[]&gt;
