---
title: "Mint a secret for a token"
method: POST
path: "/secret/{secretId}/mint"
tags: ["Secret"]
---

# Mint a secret for a token

`POST /secret/{secretId}/mint`

## Request

- Base URL: `https://api.chatbotkit.com/api/v1`
- URL: `https://api.chatbotkit.com/api/v1/secret/{secretId}/mint`
- Auth: HTTP bearer

Returns a usable token minted from the secret (a refreshed OAuth access
token, a freshly signed JWT, or a stored bearer token). This is the one
endpoint where the credential leaves the server, for use when a proxy
cannot serve the request (provider SDKs, non-HTTP, or targets not
reachable from the platform). Owner-only. `basic`/`plain` and
platform-managed secrets are not mintable - use the proxy instead.

## Path parameters

- `secretId` string, required: The ID of the secret to mint

## Response `200`

The minted token

- object
  - `token` string, required: The usable token to send to the provider
  - `expiresAt` number: Token expiry as a unix timestamp in ms, or null

## Other responses

- `default`: An error response

---

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