---
title: "CreateEnvironmentLogsToken"
method: POST
path: "/gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken"
tags: ["gitpod.v1.EnvironmentService"]
---

# CreateEnvironmentLogsToken

`POST /gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken`

Creates an access token for retrieving environment logs.

 Generated tokens are valid for one hour and provide read-only access
 to the environment's logs.

 ### Examples

 - Generate logs token:

   Creates a temporary access token for retrieving environment logs.

   ```yaml
   environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
   ```

## Request body

- GitpodV1CreateEnvironmentLogsTokenRequest
  - `environmentId` string, uuid — environment_id specifies the environment for which the logs token should be created. +required

## Response `200`

Success

- GitpodV1CreateEnvironmentLogsTokenResponse
  - `accessToken` string, required — access_token is the token that can be used to access the logs of the environment

## Other responses

- `default` — Error

## Changes

- **2025-02-18** `cd6a05ae99d2` — 1 warning
  - removed the optional property `detail` from the response with the `default` status
- **2025-02-18** `bef0e79f204c` — 1 info
  - the response property `accessToken` became required for the status `200`

[Change history](https://skmtc.dev/gitpod-io/apis/gitpod-v1/changes/gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken/post.md)

---

[API](https://skmtc.dev/gitpod-io/apis/gitpod-v1.md) · [All operations](https://skmtc.dev/gitpod-io/apis/gitpod-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gitpod-io/gitpod-v1/revisions/44d50c2ac284/schema)
