Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Search GAIA API supports API keys for secure service-to-service connections. The following endpoints are available for managing API keys.

Get API Keys

This endpoint retrieves the API keys associated with the service.

Parameters

Info

This endpoint does not require any parameters.

Example

Code Block
languagebash
GET /es/api/v1/credentials/api_keys/

Table of Contents
maxLevel2

Response

Successful Response [200]

Code Block
[
  {
    "api_key": "API_KEY_1",
    "config": {
      "permissions": "read"
    }
  },
  {
    "api_key": "API_KEY_2",
    "config": {
      "permissions": "write"
    }
  }
]

Generate API Key

This endpoint allows you to generate a new API key.

Parameters

ParameterTypeDescription
configobjectConfiguration to associate with the API key

Example

Code Block
languagebash
POST /es/api/v1/credentials/api_keys/

{
  "config": {
    "permissions": "read"
  }
}

Response

Successful Response [200]

Code Block
{
  "api_key": "NEW_API_KEY",
  "result": "created"
}

Validation Error [422]

Code Block
{
  "detail": [
    {
      "loc": ["query", "source"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Update API Key

Update API Key

Path Parameters

ParameterTypeDescription
api_keystringAPI key to update

Body Parameters

ParameterTypeDescription
configobjectConfiguration associated with the key

Example

Code Block
languagebash
PUT /es/api/v1/credentials/api_keys/{api_key}

{
  "config": {
    "permissions": "write"
  }
}

Response

Successful Response [200]

Code Block
{
  "api_key": "EXISTING_API_KEY",
  "result": "updated"
}

Validation Error [422]

Code Block
{
  "detail": [
    {
      "loc": ["query", "source"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Delete API Key

This endpoint allows you to delete an API key.

Path Parameters

ParameterTypeDescription
api_keystringAPI key to update

Example

Code Block
languagebash
DELETE /es/api/v1/credentials/api_keys/delete/{api_key}

Response

Successful Response [200]

Code Block
{
  "api_key": "EXISTING_API_KEY",
  "result": "deleted"
}

Validation Error [422]

Code Block
{
  "detail": [
    {
      "loc": ["query", "source"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}