---
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

## Changes

> 18 revisions in range; 1 could not be searched.

- **2025-12-15** `d62ef4b9187c` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/gitpod-io/apis/gitpod-v1/changes/gitpod.v1.PrebuildService/CreatePrebuildLogsToken/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)
