---
title: "Mint an additional token"
method: POST
path: "/workspaces/{workspaceId}/service-accounts/{id}/tokens"
tags: ["Service accounts"]
---

# Mint an additional token

`POST /workspaces/{workspaceId}/service-accounts/{id}/tokens`

## Request

- Base URL: `https://tasg.app/api/v1`
- URL: `https://tasg.app/api/v1/workspaces/{workspaceId}/service-accounts/{id}/tokens`
- Auth: HTTP bearer

Workspace owner only, max 5 tokens per service account (rotate by minting then revoking). The `tf_` plaintext is returned ONCE and never again; store it.

## Path parameters

- `workspaceId` string, uuid, required
- `id` string, uuid, required

## Request body

- object
  - `name` string
  - `scopes` TokenScope[]: Default `["read","write"]`.

## Response `201`

Minted.

- object
  - `token` object, required: Token metadata (camelCase keys). The tf_ plaintext appears only in the mint response.
    - `id` string, uuid, required
    - `name` string, required
    - `scopes` TokenScope[], required
    - `lastUsedAt` string, date-time, nullable
    - `createdAt` string, date-time, required
    - `plain` string, required: The `tf_` secret. Shown once.

## Other responses

- `400`: Validation failed: the body or query did not match the schema, or a business rule was violated. `error` says which.
- `401`: Missing, invalid, expired or revoked credentials.
- `403`: Authenticated, but not allowed: not a member, insufficient project role or the API token lacks the required scope.
- `404`: Not found, or not visible to the caller (tenancy is enforced: foreign resources look identical to missing ones).
- `429`: Rate limited. Back off and retry after the window in the `RateLimit-*` headers.

---

[API](https://skmtc.dev/tasg/apis/tasg-api.md) · [All operations](https://skmtc.dev/tasg/apis/tasg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tasg/apis/tasg-api/revisions/cd2a1dbaf5cf?raw)
