Algolia search credentials
Get Algolia search credentials for querying documentation.
Authentication is optional. Without credentials, the returned key searches only public pages, which is how the search widget calls this endpoint. Pass FERN_TOKEN to search with a logged-in user’s roles, or FERN_API_KEY from a server to also search pages that require login, with roles set by the ROLES header. Don’t send FERN_API_KEY from a browser.
身份验证
FERN_API_KEYstring
Fern API key, from fern token.
OR
FERN_TOKENstring
JWT token for this user.
请求头
ROLES
Comma-separated list of roles (only with FERN_API_KEY). Sets roles for returned search key if provided, otherwise, roles are empty.
x-fern-host
Documentation domain (required on preview URLs)
X-User-Token
Your own identifier for the end user, used to group search analytics by user. Works with or without credentials.
响应
Successfully retrieved search credentials
appId
Algolia application ID
apiKey
Short-lived Algolia search API key
roles
Roles included in the search key (only with FERN_API_KEY auth)
错误
400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error