Skip to main content
POST
/
1
/
secret-keys
curl
curl --request POST \
  --url https://example.algolia.net/agent-studio/1/secret-keys \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
  --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
  --data '
{
  "name": "lorem",
  "agentIds": [
    "lorem"
  ]
}
'
{
  "agentIds": [
    "<string>"
  ],
  "createdAt": "<string>",
  "id": "<string>",
  "lastUsedAt": "<string>",
  "name": "<string>",
  "updatedAt": "<string>",
  "value": "<string>",
  "isDefault": false
}
Requires Admin API key

Authorizations

x-algolia-application-id
string
header
required

Your Algolia application ID.

x-algolia-api-key
string
header
required

Your Algolia API key with the necessary permissions to make the request. Permissions are controlled through access control lists (ACL) and access restrictions. The required ACL to make a request is listed in each endpoint's reference.

Body

application/json

Secret key creation payload.

name
string
required

The name of the secret key.

Required string length: 1 - 128
agentIds
string[]

List of agent IDs this secret key is associated with.

Response

Successful Response.

agentIds
string[]
required
createdAt
string
required
id
string
required
lastUsedAt
string | null
required
name
string
required
updatedAt
string
required
value
string
required
isDefault
boolean
default:false
Last modified on June 11, 2026