> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # Algolia search credentials GET https://docs.example.com/api/fern-docs/search/v2/key Get Algolia search credentials for querying documentation. Reference: https://buildwithfern.com/learn/docs/fern-api-reference/get-search-key ## Authentication - `FERN_API_KEY` header (required) — Fern API key, from `fern token`. - `FERN_TOKEN` header (required) — JWT token for this user. ## Request ### Headers - `ROLES` (string, optional) — 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` (string, optional) — Documentation domain (required on preview URLs) ## Response ### 200 Successfully retrieved search credentials - `appId` (string, required) — Algolia application ID - `apiKey` (string, required) — Short-lived Algolia search API key - `roles` (list of string, optional) — Roles included in the search key (only with FERN_API_KEY auth) ## Errors ### 400 Bad Request Error Bad request (local preview or unsupported preview URL) - `any` ### 401 Unauthorized Error Unauthorized (invalid Fern API key) - `any` ### 403 Forbidden Error Forbidden (API key does not belong to this domain's Fern organization) - `any` ## Examples **Response** ```json { "appId": "string", "apiKey": "string", "roles": [ "string" ] } ```