---
title: "Create environment access secret"
method: POST
path: "/environments/{environment_key}/access_secrets"
tags: ["access_secrets"]
---

# Create environment access secret

`POST /environments/{environment_key}/access_secrets`

Create an access secret in an environment. Authentication should be done using the environment where you want to create the secret and an Organization Access Secret.

## Request body

- AccessSecret
  - `access_secret` object
    - `name` string, required — The human readable name of the access secret. There is a 100 character limit and it cannot contain the following characters: ``\ | ` # $ % { } ; " < >``

## Response `201`

Created

- AccessSecretResponse
  - `access_secret` AccessSecretProperties
    - `key` string — The key identifying the environment at Spreedly.
    - `environment` string — The name of the environment that the access_secret belongs to.
    - `name` string — The human readable name of the access secret.
    - `access_secret` string — The access secret value.
    - `created_at` string — The access secret's created_at date.

## Other responses

- `401` — Unauthorized
- `422` — Unprocessable entity

---

[API](https://skmtc.net/spreedly/apis/spreedly-api-v1.md) · [All operations](https://skmtc.net/spreedly/apis/spreedly-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spreedly/spreedly-api-v1/versions/72ba4e23e65c/schema)
