## CreateEnvironmentLogsToken `environments.create_logs_token(EnvironmentCreateLogsTokenParams**kwargs) -> EnvironmentCreateLogsTokenResponse` **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" ``` ### Parameters - `environment_id: Optional[str]` environment_id specifies the environment for which the logs token should be created. +required ### Returns - `class EnvironmentCreateLogsTokenResponse: …` - `access_token: str` access_token is the token that can be used to access the logs of the environment ### Example ```python import os from gitpod import Gitpod client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) response = client.environments.create_logs_token( environment_id="07e03a28-65a5-4d98-b532-8ea67b188048", ) print(response.access_token) ``` #### Response ```json { "accessToken": "accessToken" } ```