# Mint environment workload token

`POST /v1/projects/{project}/environments/{environment}/workloadToken`, operation `environments.MintEnvironmentWorkloadToken`

Mints a short-lived workload identity token for a running local sandbox environment.

Returns a 15-minute environment-scoped workload identity token that kosem sbx mounts at /run/kosem/identity/token so kosem-envd inside the local container can open its tunnel and issue granted credentials without exposing the user's sign-in token. Only the creator of a running local sandbox can mint its workload token.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | Yes | `string` | The project's ID. |
| `environment` | path | Yes | `string` | The environment's ID. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `environment` | `string` | Yes | Resource name of the local environment. |
| `expireTime` | `string (date-time)` | Yes | When the workload identity token expires. |
| `token` | `string` | Yes | Short-lived workload identity token written to /run/kosem/identity/token inside the local sandbox. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.