---
title: "CreatePrebuildLogsToken"
method: POST
path: "/gitpod.v1.PrebuildService/CreatePrebuildLogsToken"
tags: ["gitpod.v1.PrebuildService"]
---

# CreatePrebuildLogsToken

`POST /gitpod.v1.PrebuildService/CreatePrebuildLogsToken`

Creates a logs access token for a prebuild.

 Use this method to:
 - Stream logs from a running prebuild
 - Access archived logs from completed prebuilds

 Generated tokens are valid for one hour.

 ### Examples

 - Create prebuild logs token:

   Generates a token for accessing prebuild logs.

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

## Request body

- GitpodV1CreatePrebuildLogsTokenRequest
  - `prebuildId` string, uuid, required — prebuild_id specifies the prebuild for which the logs token should be created. +required

## Response `200`

Success

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

## Other responses

- `default` — Error

---

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