The 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

This endpoint does not require any parameters.

Example

GET /es/api/v1/credentials/api_keys/

Response

Successful Response [200]

[
  {
    "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

POST /es/api/v1/credentials/api_keys/

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

Response

Successful Response [200]

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

Validation Error [422]

{
  "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

PUT /es/api/v1/credentials/api_keys/{api_key}

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

Response

Successful Response [200]

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

Validation Error [422]

{
  "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

DELETE /es/api/v1/credentials/api_keys/delete/{api_key}

Response

Successful Response [200]

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

Validation Error [422]

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