{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/orq/json-schema/orq-api-key-response-schema.json",
  "title": "ApiKeyResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orq-api-keys-api-openapi.yml#/components/schemas/ApiKeyResponse",
  "additionalProperties": false,
  "properties": {
    "access": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object"
    },
    "active": {
      "type": "boolean"
    },
    "constraints": {
      "$ref": "#/$defs/Constraints"
    },
    "created": {
      "format": "date-time",
      "type": "string"
    },
    "created_by_id": {
      "type": "string"
    },
    "expiration": {
      "type": "string"
    },
    "id": {
      "description": "Unique identifier of the key.",
      "type": "string"
    },
    "is_legacy": {
      "type": "boolean"
    },
    "last_used_at": {
      "format": "date-time",
      "type": "string"
    },
    "legacy_key_id": {
      "type": "string"
    },
    "legacy_token_family": {
      "type": "string"
    },
    "name": {
      "description": "Display name of the key.",
      "type": "string"
    },
    "owner": {
      "$ref": "#/$defs/Owner"
    },
    "permission_mode": {
      "enum": [
        "all",
        "restricted",
        "read_only"
      ],
      "type": "string"
    },
    "project_scope": {
      "$ref": "#/$defs/ProjectScope"
    },
    "projects": {
      "items": {
        "type": "string"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "source": {
      "type": "string"
    },
    "status": {
      "enum": [
        "active",
        "disabled",
        "revoked"
      ],
      "type": "string"
    },
    "token": {
      "description": "The raw secret on create only; a masked display value everywhere else.",
      "type": "string"
    },
    "token_prefix": {
      "description": "Display prefix of the secret; not usable as a credential.",
      "type": "string"
    },
    "updated": {
      "format": "date-time",
      "type": "string"
    },
    "updated_by_id": {
      "type": "string"
    },
    "workspace_id": {
      "description": "Workspace the key belongs to.",
      "type": "string"
    }
  },
  "required": [
    "id",
    "name",
    "workspace_id",
    "token"
  ],
  "type": "object",
  "$defs": {
    "Constraints": {
      "additionalProperties": false,
      "properties": {
        "expires_at": {
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Owner": {
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string"
        },
        "user_id": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    },
    "ProjectScope": {
      "additionalProperties": false,
      "properties": {
        "mode": {
          "type": "string"
        },
        "project_id": {
          "type": "string"
        }
      },
      "required": [
        "mode"
      ],
      "type": "object"
    }
  }
}