Update a secret set

Updated

Adds, changes, or removes several keys in a secret set in one change.

Preview documentation

You're reading the Conversational AI Platform (Preview) docs. Switch to Main.
PATCH
https://preview.ai.agora.io/conversational-ai/v1/projects/{appid}/secrets/{name}

Use this endpoint to rotate keys that must change together. Pass a string to add or replace a key, or null to remove it. Keys you omit don't change. To change one key, set the key instead. To replace the whole set, use Replace a secret set.

Running sessions keep the values they resolved when they started. New sessions use the new values.

Path Parameters

appidstring
Required

The App ID of your project.

namestring
Required

The name of the secret set.

Header Parameters

If-Matchstring

The ETag value from the most recent response for this resource. When you include it, the request fails with 412 and reason PreconditionFailed if the resource has changed since then. Use it to avoid overwriting a concurrent change.

Request Body

secretsobject
Required

The keys to change. A string value adds the key, or replaces its value if the key exists. A null value removes the key. Keys you omit don't change.

[key: string]string | null

Response Body

The secret set was updated. The response body lists its keys.

Response Headers

Agora-Request-Idstring

A unique ID for the request. Include it when you contact Agora support.

ETagstring

The current version of the resource. Pass this value in the If-Match header of your next update or delete request for this resource.

namestring
Required

The name of the secret set.

keysarray<string>
Required

The names of the keys in the set. Values are never returned.

create_tsinteger
Required

The time the set was created, as a Unix timestamp in seconds.

update_tsinteger
Required

The time the set was last updated, as a Unix timestamp in seconds.

Authorization

This endpoint requires authentication.

Request examples

Example Request
curl -X PATCH 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/secrets/string' \  -H 'Content-Type: application/json' \  -d '{  "secrets": {    "llm": "<your_new_llm_api_key>",    "tts": "<your_new_tts_api_key>",    "asr": null  }}'

Response example

Example Response
{  "name": "string",  "keys": [    "string"  ],  "create_ts": 0,  "update_ts": 0}