---
title: "POST /v1/{+workstation}:generateAccessToken"
method: POST
path: "/v1/{+workstation}:generateAccessToken"
tags: ["projects"]
---

# POST /v1/{+workstation}:generateAccessToken

`POST /v1/{+workstation}:generateAccessToken`

Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation. Once generated this token cannot be revoked and is good for the lifetime of the token.

## Path parameters

- `workstation` string, required

## Request body

- GenerateAccessTokenRequest — Request message for GenerateAccessToken.
  - `expireTime` string, google-datetime — Desired expiration time of the access token. This value must be at most 24 hours in the future. If a value is not specified, the token's expiration time will be set to a default value of 1 hour in the future.
  - `ttl` string, google-duration — Desired lifetime duration of the access token. This value must be at most 24 hours. If a value is not specified, the token's lifetime will be set to a default value of 1 hour.
  - `port` integer — Optional. Port for which the access token should be generated. If specified, the generated access token grants access only to the specified port of the workstation. If specified, values must be within the range [1 - 65535]. If not specified, the generated access token grants access to all ports of the workstation.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/workstations.md) · [All operations](https://skmtc.dev/google/apis/workstations/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/workstations/revisions/fb7c28fdc534/schema)
