---
title: "Create a new secret"
method: POST
path: "/v2/sites/{site_id}/live/broadcast/secrets/"
tags: ["broadcast live"]
---

# Create a new secret

`POST /v2/sites/{site_id}/live/broadcast/secrets/`

Create a new secret for a site

Each secret represents a passphrase or key used for securing live streams.

## Path parameters

- `site_id` string, required — Unique identifier for a resource

## Request body

- CreateSecretParameters — Request model for creating a new secret
  - `name` string — Friendly name for the secret
  - `content` string — The secret content (write-only, never returned in responses)
  - `lifespan` 'persistent' | 'single_use', nullable — The lifespan of the secret determining deletion behavior (optional, defaults to "persistent")

## Response `201`

Secret created successfully

- SecretObjectSchema — Schema object for a secret
  - `schema` string
  - `id` string — Unique identifier for a resource
  - `created` string — Date and time at which the resource was created
  - `last_modified` string — Date and time at which the resource was most recently modified
  - `type` string — Name of the type of resource.
  - `relationships` object — Ancilliary resources associated to the primary resource being read
  - `name` string — The friendly name for the secret
  - `lifespan` 'persistent' | 'single_use' — The lifespan of the secret determining deletion behavior

## Other responses

- `400` — Bad Request The request either lacks certain attributes or contains malformed/invalid attributes.
- `500` — Internal server error

---

[API](https://skmtc.net/jwplayer/apis/management-api-v2.md) · [All operations](https://skmtc.net/jwplayer/apis/management-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/jwplayer/management-api-v2/revisions/180db7cada27/schema)
