---
title: "Token regenerate"
method: POST
path: "/api/projects/{projectId}/environments/{environmentId}/regenerate-token"
tags: ["Environment"]
---

# Token regenerate

`POST /api/projects/{projectId}/environments/{environmentId}/regenerate-token`

Generates a new access token for the environment, invalidating the previous token.

## Path parameters

- `environmentId` string, uuid, required
- `projectId` string, uuid, required

## Response `200`

The environment with the new access token

- object — The environment with the new access token
  - `id` string, uuid, required — Unique identifier of the environment
  - `name` string, required — Name of the environment
  - `accessToken` string, required — Newly generated access token
  - `type` 'brms' | 'deployment', required — Type of environment
  - `key` string, nullable — Unique key for BRMS type environments
  - `releaseId` string, uuid, nullable — ID of the currently deployed release
  - `deploymentId` string, uuid, nullable — ID of the associated deployment
  - `projectId` string, uuid, required — ID of the project
  - `addToWorkflow` boolean, required — Whether the environment is part of the deployment workflow
  - `workflowOrder` number, nullable — Order position in the deployment workflow
  - `requiredReviewers` boolean, required — Whether reviewers are required
  - `approvalMode` 'require_one_per_team' | 'none_create_request' | 'require_any' | 'none' | 'null', nullable — Approval mode for deployments
  - `createdAt` string, required — Timestamp when the environment was created
  - `updatedAt` string, required — Timestamp when the environment was last updated
  - `deletedAt` string, nullable — Timestamp when the environment was deleted

---

[API](https://skmtc.dev/gorules/apis/gorules-agent-api.md) · [All operations](https://skmtc.dev/gorules/apis/gorules-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gorules/gorules-agent-api/revisions/52c0773fcd80/schema)
