---
title: "Generate and activate an ephemeral key (ePSKc)."
method: POST
path: "/node/ba-epskc/key"
tags: ["node"]
---

# Generate and activate an ephemeral key (ePSKc).

`POST /node/ba-epskc/key`

Generates a new 9-digit Thread Administration Passcode (TAP) and
starts listening for an external commissioner candidate to connect
using it. The ephemeral key feature must first be enabled with a PUT
request to `/node/ba-epskc/state`.

## Request body

- object
  - `lifetime` integer — The key lifetime in milliseconds. Defaults to 2 minutes when omitted or zero. Capped at 10 minutes.
  - `port` integer — The UDP port to use. Defaults to an ephemeral port when omitted.

## Response `200`

Successful operation

- EpskcActivateResult
  - `tap` string — The generated 9-digit Thread Administration Passcode (TAP).
  - `port` integer — The UDP port the border agent is listening on for the ePSKc session.

## Other responses

- `400` — Invalid request body.
- `409` — Ephemeral key feature disabled, or a key is already active.
- `500` — Failed to start the ephemeral key session.

## Changes

- **2026-08-17** `8e96e3b3f8d3` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/espressif/apis/swagger-esp-thread-border-router-rest-api/changes/node/ba-epskc/key/post.md)

---

[API](https://skmtc.dev/espressif/apis/swagger-esp-thread-border-router-rest-api.md) · [All operations](https://skmtc.dev/espressif/apis/swagger-esp-thread-border-router-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/espressif/swagger-esp-thread-border-router-rest-api/revisions/4c79fdfdbe53/schema)
