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
- application/json
Body
required
name Name (string)required
The name of the secret.
value Value (string)required
The value of the secret.
Responses
201: Successful Response
- application/json
422: Validation Error
- application/json
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"
}
}
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}