> Markdown version of https://tuna.am/en/docs/api/secrets-service-token-add/. Documentation index: [llms.txt](https://tuna.am/en/llms.txt), full text in one file: [llms-full.txt](https://tuna.am/en/llms-full.txt). Any page is available as Markdown: append `.md` to its URL without the trailing slash.

# Create a configuration service token

post`/v1/secrets/configs/config/service_tokens`

The token grants access to the secrets of a single configuration and is passed as `Authorization: Bearer <token>`. Access `access`: `read` (default) or `write`. The `duration` lifetime uses the Go format (`24h`, `720h`); without it, the token never expires. The full token value is returned only in this response. The token is accepted only by configuration secret routes. Requires `editor` access to the environment.

## Request

### Authorization

* **Authorization**stringheaderrequired

  Key in the format `Bearer <API-key>`. Create a key on the [API keys](https://my.tuna.am/api_keys) page.

### Query Parameters

* **project** stringrequired

  Project alias

* **config** stringrequired

  Configuration alias: `<environment>` is the root configuration, `<environment>/<name>` is a branch or a personal configuration (`<environment>/personal`), for example `dev/local`

### Request body

application/json

* **access**string

  Access

  **Possible values:** \[`read`, `write`]

  **description**string

  Description

  **duration**string

  Lifetime

### Response

201

application/json

* **access**string

  Access

  **Possible values:** \[`read`, `write`]

  **created_at**string\<date-time>

  Creation date

  **description**string

  Description

  **expire_at**string\<date-time>

  Expiration date

  **id**integer\<int64>

  Identifier

  **last_used_at**string\<date-time>

  Last used date

  **owner** object

  Owner

  **active**boolean

  Active flag

  **avatar_url**string

  Avatar

  **Example:&#x20;**`https://www.gravatar.com/avatar/00000000000000000000000000000000`

  **email**string

  Email

  **Example:&#x20;**`jane@example.com`

  **id**integer\<int64>

  Identifier

  **Example:&#x20;**`42`

  **name**string

  Name

  **Example:&#x20;**`Jane Doe`

  **role**string

  Role

  **Possible values:** \[`primary_owner`, `owner`, `admin`, `member`]

  **Example:&#x20;**`member`

  **token**string

  Token

  **type**string

  Type

  **Possible values:** \[`secrets`]
