{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coralogix/json-schema/coralogix-get-api-keys-response-schema.json",
  "title": "Get Api Keys Response",
  "description": "This data structure is the response obtained when retrieving all API keys.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coralogix-api-keys-service-api-openapi.yml#/components/schemas/GetApiKeysResponse",
  "type": "object",
  "properties": {
    "keys": {
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/KeyInfo"
      },
      "description": "The keys."
    }
  },
  "$defs": {
    "KeyInfo": {
      "title": "Key Info",
      "type": "object",
      "properties": {
        "accessPolicy": {
          "description": "JSON string representing the access policy for this API key. Defines granular permissions for users and groups.",
          "minLength": 0,
          "type": "string",
          "x-coralogix-presence": true
        },
        "active": {
          "type": "boolean",
          "description": "Whether this resource is active."
        },
        "hashed": {
          "type": "boolean",
          "description": "Whether the value is stored as a one-way hash."
        },
        "id": {
          "minLength": 0,
          "type": "string",
          "description": "Unique identifier."
        },
        "keyPermissions": {
          "$ref": "#/$defs/KeyInfo.KeyPermissions"
        },
        "name": {
          "minLength": 0,
          "type": "string",
          "description": "Display name."
        },
        "owner": {
          "allOf": [
            {
              "$ref": "#/$defs/Owner"
            }
          ]
        },
        "value": {
          "description": "The value.",
          "minLength": 0,
          "type": "string",
          "x-coralogix-presence": true
        }
      }
    },
    "KeyInfo.KeyPermissions": {
      "title": "Key Permissions",
      "type": "object",
      "properties": {
        "permissions": {
          "minItems": 0,
          "type": "array",
          "items": {
            "minLength": 0,
            "type": "string",
            "description": "Permissions."
          },
          "description": "Permissions."
        },
        "presets": {
          "minItems": 0,
          "type": "array",
          "items": {
            "$ref": "#/$defs/PresetInfo"
          },
          "description": "Presets."
        }
      }
    },
    "Owner": {
      "type": "object",
      "oneOf": [
        {
          "required": [
            "userId"
          ],
          "type": "object"
        },
        {
          "required": [
            "teamId"
          ],
          "type": "object"
        },
        {
          "required": [
            "organisationId"
          ],
          "type": "object"
        },
        {
          "type": "object",
          "not": {
            "anyOf": [
              {
                "required": [
                  "userId"
                ],
                "type": "object"
              },
              {
                "required": [
                  "teamId"
                ],
                "type": "object"
              },
              {
                "required": [
                  "organisationId"
                ],
                "type": "object"
              }
            ]
          }
        }
      ],
      "properties": {
        "organisationId": {
          "minLength": 0,
          "type": "string",
          "description": "Organisation identifier of the API key owner."
        },
        "teamId": {
          "minimum": 0,
          "type": "integer",
          "description": "The team id.",
          "format": "int64"
        },
        "userId": {
          "minLength": 0,
          "type": "string",
          "description": "User identifier of the API key owner."
        }
      },
      "description": "Owner."
    },
    "PresetInfo": {
      "title": "Preset Info",
      "type": "object",
      "properties": {
        "name": {
          "minLength": 0,
          "type": "string",
          "description": "Display name."
        },
        "permissions": {
          "minItems": 0,
          "type": "array",
          "items": {
            "minLength": 0,
            "type": "string",
            "description": "List of permissions."
          },
          "description": "List of permissions."
        }
      }
    }
  }
}