Skip to content

Authentication

Most of the API endpoints for Searchcraft Cloud require authentication. For self-hosted instances of Searchcraft, authentication is optional and may be configured in the CLI options.

These endpoints are only available to self-hosted instances of Searchcraft, Searhcraft Cloud customers only interact with these via the Vektron application. Requires an admin level authentication key to access. See the CLI documentation for more information.

  • GET /auth/application/:application_id Returns a list of all keys for the application.

  • GET /auth/federation/:federation_name Returns a list of all keys associated with a federation entity.

  • GET /auth/index/:index_name Returns a list of all keys associated with a specific index.

  • GET /auth/organization/:organization_id Returns a list of all keys for the organization.

  • GET /auth/key Returns a list of all keys on the cluster.

  • GET /auth/key/check/:permission Checks whether the provided key has the specified permission. The :permission path parameter is the numeric value of the permission bit(s) to check (e.g. 1 for SEARCH, 32 for MODIFY_AUTH). Returns 200 with "Key has sufficient permissions." when the key holds all requested bits, or 403 with "Key has insufficient permissions." otherwise. Unlike other auth endpoints, this route always requires a valid Authorization header even when the server runs without auth enabled.

  • POST /auth/key Create a key.

    • Payload format:

      {
      "allowed_indexes": ["index_name_1", "index_name_2"], // may contain one to several index names
      "permissions": 1, // 1 = read, 15 = ingest, 511 = admin. See Permissions below.
      "name": "Name Of This Key",
      "organization_id": 0,
      "organization_name": "My Org Name",
      "application_id": 1,
      "application_name": "My App Name",
      "status": "active | inactive",
      "federation_name": "1_rest_name", // * optional and only needed for read keys associated with a federation
      }
  • DELETE /auth/key Delete all keys.

  • GET /auth/key/:key Get an individual key.

  • DELETE /auth/key/:key Delete an individual key.

  • POST /auth/key/:key Update an individual key.

A key’s permissions value is the sum of the permissions it holds. For example, 15 is SEARCH, MODIFY_SYNONYMS, MODIFY_STOP_WORDS and MODIFY_DOCUMENTS. If a key has allowed_indexes, its index permissions only apply to those indexes. Without allowed_indexes, they apply to every index.

ValuePermissionAllows
1SEARCHSearch, facets, and reading index and federation configuration.
2MODIFY_SYNONYMSAdding and removing synonyms.
4MODIFY_STOP_WORDSAdding and removing stop words.
8MODIFY_DOCUMENTSAdding and deleting documents, and updating an existing index with PUT or PATCH /index/:index_name, except its AI settings.
16MODIFY_INDEXDeleting indexes, changing index AI settings (ai_enabled and ai), and reading ai.llm_api_key.
32MODIFY_AUTHManaging access keys.
64LLM_RAG_SUMMARIESSearch result summaries and semantic search.
128RESERVEDNot currently used.
256READ_ANALYTICSMeasure analytics dashboards.

Creating an index requires a key that holds every permission (511). See Index Management for the full index rules.

AI agents connecting through the MCP endpoint authenticate with the same access keys described above. When an OAuth authorization server issues tokens for your instance, Searchcraft also advertises it to agents using OAuth 2.0 Protected Resource Metadata (RFC 9728), so spec-conformant MCP clients can discover where to obtain a token without manual configuration. See OAuth authorization server discovery for setup.

  • Organization and application IDs are used within Searchcraft cloud but are available for use in self-hosted instances at the customer’s discretion.
  • The permissions identifiers may change in future releases of Searchcraft as more capabilities are added to the API.