---
title: "Create short-lived TURN credentials for a project"
method: POST
path: "/api/projects/tunnels/{projectId}/turn-server/credentials"
tags: ["turn"]
---

# Create short-lived TURN credentials for a project

`POST /api/projects/tunnels/{projectId}/turn-server/credentials`

## Request

- Base URL: `https://rstream.io`
- URL: `https://rstream.io/api/projects/tunnels/{projectId}/turn-server/credentials`
- Auth: HTTP bearer

Requires turn.credentials.create and access to the active project. Accepts an empty body or at most 4096 bytes of strict JSON with optional ttlSeconds (integer 1–3600, default 600). Returns the same username, credential, urls and ttl contract as the Engine issuer. The returned lifetime is clipped to the authenticated identity and credential expiry.

## Path parameters

- `projectId` string, required

## Request body

- CreateTURNServerCredentialParams
  - `ttlSeconds` integer

## Response `200`

Successful response.

- CreateTURNServerCredentialResponse
  - `username` string, required
  - `credential` string, required
  - `urls` string[], required
  - `ttl` integer, required

## Other responses

- `400`: Request validation failed.
- `401`: Authentication is required.
- `403`: The token is not authorized.
- `404`: Project was not found.
- `409`: Project or serving scope is inactive.
- `429`: Rate limit exceeded.
- `503`: TURN serving metadata or signing keys are unavailable.

---

[API](https://skmtc.dev/rstream/apis/rstream-api.md) · [All operations](https://skmtc.dev/rstream/apis/rstream-api/llms.txt) · [OpenAPI document](https://skmtc.dev/rstream/apis/rstream-api/revisions/a840a2c91f22?raw)
