API Keys

Regenerate an API key

Regenerates an API key for the specified project. This invalidates the previous key. Use key_number to specify which key to regenerate (0 for both, 1 for primary, 2 for secondary).

post/v1/projects/{projectId}/api-keys

Request

  • Base URL
    https://api.spice.ai
  • Auth
    HTTP bearer

Path parameters

projectIdinteger required

The ID of the project

Headers

X-Org-Namestring

The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own. A portal session token is bound to none, so it must send this header on every route but GET /v1/orgs (400 org_assertion_required otherwise).

Request body

key_number0 | 1 | 2

Which API key to regenerate (0 = both, 1 = primary, 2 = secondary)

Response

API key regenerated successfully

api_keystring nullable

Primary API key

api_key_2string nullable

Secondary API key

regenerated_key0 | 1 | 2

Which key was regenerated (0 = both, 1 = primary, 2 = secondary)

Changes

No recorded changes to this operation across all 1 revision of this API.