---
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 OT_BORDER_AGENT_DEFAULT_EPHEMERAL_KEY_TIMEOUT (2 minutes) when omitted or zero. Maximum value is OT_BORDER_AGENT_MAX_EPHEMERAL_KEY_TIMEOUT (10 minutes); values above the maximum are rejected with 400.
  - `port` integer — The UDP port to use. Defaults to the device's own default 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` — The client sent an invalid request. The client SHOULD perform action(s) to provide valid syntax before retrying the request.
- `404` — The client requested a target resource that does not exist. The client SHOULD perform action(s) to re-align with the API or re-synchronize application state before retrying the request.
- `409` — The request conflicts with the current state of the target resource; either the request body cannot be applied to the resource state or the resource state cannot satisfy the request. The client SHOULD perform action(s) to re-synchronize application state before retrying the request.
- `500` — The server encountered an unexpected error. The client SHOULD retry after a longer period of time.

---

[API](https://skmtc.net/openthread/apis/swagger-openthread-rest-api.md) · [All operations](https://skmtc.net/openthread/apis/swagger-openthread-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openthread/swagger-openthread-rest-api/revisions/7996e8479177/schema)
