Replace a secret set

Updated

Replaces all the keys in a secret set in one change.

Preview documentation

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

After the request, the set contains only the keys you pass. Keys you omit are removed. Agents keep referencing the set by name, so you don't need to change them.

Path Parameters

appidstring
Required

The App ID of your project.

namestring
Required

The name of the secret set.

Header Parameters

If-Matchstring
Required

The ETag value from the most recent response for this resource. If the resource has changed since then, the request fails with 412 and reason PreconditionFailed. Retrieve the resource, apply your change again, and retry with the new ETag.

Request Body

secretsobject
Required

The secrets, as key-value pairs. Each key is 1 to 64 characters from A-Z, a-z, 0-9, and _, and must be unique within the set. Values are write-only and are never returned. A set can hold at most 64 KiB, measured as the UTF-8 size of its keys and values encoded as a JSON object. A larger set is rejected with 400.

[key: string]string

Response Body

The secret set was replaced. 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 PUT 'https://preview.ai.agora.io/conversational-ai/v1/projects/string/secrets/string' \  -H 'If-Match: string' \  -H 'Content-Type: application/json' \  -d '{  "secrets": {    "asr": "<your_asr_api_key>",    "llm": "<your_llm_api_key>"  }}'

Response example

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