Skip to main content

Create a secret

POST 
/ai/secrets

Create a new secret with a name associated to it which can be used as a reference to the secret in other API calls.

Request

Body

required

    name Name (string)required

    The name of the secret.

    value Value (string)required

    The value of the secret.

Responses

201: Successful Response

422: Validation Error

Request samples


curl -L 'https://api.telnyx.com/v2/ai/secrets' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"name": "my_secret",
"value": "my_secret_value"
}'

Response samples


{
"data": {
"id": "string",
"name": "string",
"value": "*****",
"created_at": "2024-07-29T15:51:28.071Z"
}
}