{
  "openapi": "3.0.4",
  "info": {
    "title": "axes4 Page.Auth",
    "description": "Manages information about pages of processed documents.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.axes4.com/usage/pages"
    }
  ],
  "paths": {
    "/v1/subscription/{subscriptionId}/valid": {
      "get": {
        "tags": [
          "v1"
        ],
        "operationId": "v1_subscription_valid",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The OK response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiKeyCheckResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Invalid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. API key or subscription ID missing/invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. License disabled, not started, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": [ ]
          }
        ]
      }
    },
    "/v1/subscription/{subscriptionId}/usage": {
      "get": {
        "tags": [
          "v1"
        ],
        "description": "Returns the subscription usage info.",
        "operationId": "v1_subscription_usage",
        "parameters": [
          {
            "name": "subscriptionId",
            "in": "path",
            "description": "The subscription ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The OK response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/apiKeyUsageResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. Invalid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. API key or subscription ID missing/invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden. License disabled, not started, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errorResponseContent"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "apiKeyCheckResult": {
        "type": "object",
        "properties": {
          "isValid": {
            "type": "boolean"
          }
        }
      },
      "apiKeyUsageResult": {
        "type": "object",
        "properties": {
          "isUnlimited": {
            "type": "boolean",
            "description": "Whether the subscription has unlimited page usage"
          },
          "totalPages": {
            "type": "integer",
            "description": "Total number of pages available per subscription billing window",
            "format": "int32"
          },
          "usedPages": {
            "type": "integer",
            "description": "Number of used pages for the subscription billing window",
            "format": "int32"
          },
          "startDate": {
            "type": "string",
            "description": "Start date of the subscription billing window",
            "format": "date-time"
          },
          "expireDate": {
            "type": "string",
            "description": "Expire date of the subscription billing window",
            "format": "date-time"
          }
        }
      },
      "errorResponseContent": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      }
    }
  }
}