Secrets

Proxy Secret

Proxy a request with a secret

post
/v1/secret/{secretId}/proxy

Description

Performs an outbound HTTP request with the secret injected into the request headers at egress. The secret value never leaves the server. Reference the secret in any header value using ${SECRET_DEFAULT}; if no header references the secret, it is injected into Authorization. The upstream response is returned verbatim.

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Path Parameters

secretIdstring* Required

The ID of the secret to inject

Request Body * Required

Request Body Schema: application/json

methodstring

The HTTP method

urlstring

The destination URL

headersobject

The request headers (may reference the secret)

bodystring

The request body

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

secret: process.env.CHATBOTKIT_API_KEY!

})

const response = await cbk.secret.proxy(

secretId,
{
"method":"string",
"url":"string",
"headers":"object",
"body":"string"
}
)