---
title: "Generate SDK Keys"
method: POST
path: "/v1/projects/{project}/environments/{environment}/sdk-keys"
tags: ["Environments"]
---

# Generate SDK Keys

`POST /v1/projects/{project}/environments/{environment}/sdk-keys`

Generate new SDK keys for an environment, for any or all of the SDK types. This is the expected and recommended way to rotate SDK keys. Adding a new SDK key will not invalidate existing SDK keys.
Generating new keys is restricted for protected environments to those with Publisher permissions

## Path parameters

- `environment` string, required
- `project` string, required

## Request body

- GenerateSdkTokensDto
  - `client` boolean
  - `server` boolean
  - `mobile` boolean

## Response `200`

- Environment
  - `name` string, required — A unique display name
  - `key` string, required — Unique Environment identifier, can be used in the SDK / API to reference by key rather than ID. Must only contain lower-case characters and `_`, `-` or `.`.
  - `description` string — Environment description.
  - `color` string — Environment display color, used to highlight different environments on the dashboard. Must use Hex color code.
  - `_id` string, required — A unique Environment ID
  - `_project` string, required — The Project owning the Environment
  - `type` 'development' | 'staging' | 'production' | 'disaster_recovery', required — The environment type
  - `_createdBy` string, required — ID of the User who created the Environment.
  - `createdAt` string, date-time, required — The date the Environment was created
  - `updatedAt` string, date-time, required — The date the Environment was last updated
  - `sdkKeys` SDKKeys
    - `mobile` APIKey[], required
    - `client` APIKey[], required
    - `server` APIKey[], required
  - `settings` EnvironmentSettings
    - `appIconURI` string — A unique App Icon URI for a given environment
  - `readonly` boolean, required — Controls whether the environment is editable for a given user

## Other responses

- `201`
- `400`
- `401`
- `403`
- `404`

---

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