---
title: "Generate a secret"
method: POST
path: "/webhooks/{subscriptionId}/secrets"
tags: ["Webhooks"]
---

# Generate a secret

`POST /webhooks/{subscriptionId}/secrets`

## Request

- Base URL: `https://api.dojo.tech`
- URL: `https://api.dojo.tech/webhooks/{subscriptionId}/secrets`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/dojo/apis/dojo-api/docs/webhooks/:subscriptionId/secrets/post.ts> (a function with typed inputs; its response is checked against the schema)

Generates a new secret.

## Path parameters

- `subscriptionId` string, required

## Headers

- `version` string, date, required

## Response `200`

OK

- SecretsResponse
  - `id` string: The unique identifier for the subscription.
  - `secrets` SubscriptionSecret[]: The list of secrets associated with the subscription. Used to generate signatures.
    - `id` string: The unique identifier for the secret.
    - `value` string: The secret value.
    - `createdAt` string, date-time: The timestamp of the created date, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) UTC format.
    - `isActive` boolean: The status of the secret. It can be activated or deactivated.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict

---

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