API Keys

Update an API key

Updates an API key. Enable or disable the key to temporarily remove access without deleting the key. This is useful for maintenance windows, or when your team no longer requires access to a specific corpus.

Users that hold none of the corpus_administrator, administrator, or owner roles can only update their own personal API key; a key that exists but belongs to another user returns a 404 error. Machine credentials — API keys, app clients, and service accounts — without one of those three roles cannot call this operation.

patch/v2/api_keys/{api_key_id}

Path parameters

api_key_idstring required

The ID of the API key.

Headers

Request-Timeoutinteger

The platform makes a best effort to complete the request in the specified seconds, or it times out.

Request-Timeout-Millisinteger

The platform makes a best effort to complete the request in the specified milliseconds, or it times out.

Request body

enabledboolean

Indicates whether to disable or enable an API key.

Response

The API key.

idstring required

The ID of the API key.

namestring required

The human-readable name of the API key.

secret_keystring required

The key used in API requests. Keep the key secure.

enabledboolean

Indicates whether the API key is enabled.

api_rolesApiRole[]

Customer-level roles for this API key.

api_key_role'serving' | 'serving_and_indexing' | 'personal'

The role of the API key. A personal key has the same permissions as its owner. A serving API key can only perform query type requests on its corpora, and a serving_and_indexing key can perform both indexing and query type requests; these two roles are deprecated for creation — assign roles with api_roles instead.

Changes

Changed in 2 of the 7 revisions of this API.116

    • the response's property type changed from string to no type for status

      response-property-type-changed

    • added the non-success response with the status

      response-non-success-status-added

    • added to the response property allOf list for the response status

      response-property-all-of-added

    • removed the personal enum value from the response property for the response status

      response-property-enum-value-removed

    • removed the serving enum value from the response property for the response status

      response-property-enum-value-removed

    • removed the serving_and_indexing enum value from the response property for the response status

      response-property-enum-value-removed

    • response property api_key_role reactivated

      response-property-reactivated

    • added the new agent_end_user enum value to the // response property for the response status

      response-property-enum-value-added