{
  "openapi": "3.1.1",
  "info": {
    "title": "PDF Generator (Open Source)",
    "description": "A PDF generation and merging API by eCom Learning Solutions.",
    "version": "2.0.241"
  },
  "servers": [
    {
      "url": "https://pdf.enetreports.co.uk/"
    }
  ],
  "paths": {
    "/releases/index.json": {
      "get": {
        "tags": [
          "PdfGenerator.Api"
        ],
        "operationId": "ReleaseMetadata",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/downloads/application.zip": {
      "get": {
        "tags": [
          "PdfGenerator.Api"
        ],
        "operationId": "DownloadApplicationArchive",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/downloads/examples.zip": {
      "get": {
        "tags": [
          "PdfGenerator.Api"
        ],
        "operationId": "DownloadExamples",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/source/archive.zip": {
      "get": {
        "tags": [
          "PdfGenerator.Api"
        ],
        "operationId": "DownloadSourceArchive",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "PdfGenerator.Api"
        ],
        "operationId": "Health",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/security": {
      "get": {
        "tags": [
          "PdfGenerator.Api"
        ],
        "operationId": "SecurityRequirements",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/pdfs/merge": {
      "post": {
        "tags": [
          "PdfOperations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergePdfRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/MergePdfRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          },
          "401": {
            "description": "A valid X-Api-Key header is required."
          },
          "413": {
            "description": "The request exceeds the 20 MiB body limit."
          },
          "429": {
            "description": "Rate or concurrency limit reached. Check Retry-After."
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/api/v1/pdfs/page-numbers": {
      "post": {
        "tags": [
          "PdfOperations"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumberPdfRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/NumberPdfRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": { }
            }
          },
          "401": {
            "description": "A valid X-Api-Key header is required."
          },
          "413": {
            "description": "The request exceeds the 20 MiB body limit."
          },
          "429": {
            "description": "Rate or concurrency limit reached. Check Retry-After."
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/api/v1/templates": {
      "get": {
        "tags": [
          "Pdfs"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/templates/{templateId}": {
      "get": {
        "tags": [
          "Pdfs"
        ],
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/pdfs/{templateId}": {
      "post": {
        "tags": [
          "Pdfs"
        ],
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonElement"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/JsonElement"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "A valid X-Api-Key header is required."
          },
          "413": {
            "description": "The request exceeds the 20 MiB body limit."
          },
          "429": {
            "description": "Rate or concurrency limit reached. Check Retry-After."
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/api/v1/pdfs/custom-template": {
      "post": {
        "tags": [
          "Pdfs"
        ],
        "summary": "Generate a PDF from a caller-supplied template definition",
        "description": "Provide a complete supported LegacyPdfRequest layout under template, with printable labels and data in separate maps. Unknown fields and unsupported schema shapes return 400.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonElement"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/JsonElement"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "A valid X-Api-Key header is required."
          },
          "413": {
            "description": "The request exceeds the 20 MiB body limit."
          },
          "429": {
            "description": "Rate or concurrency limit reached. Check Retry-After."
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "EntityTagHeaderValue": {
        "type": "object",
        "properties": {
          "tag": {
            "$ref": "#/components/schemas/StringSegment"
          },
          "isWeak": {
            "type": "boolean"
          }
        }
      },
      "FileContentResult": {
        "type": "object",
        "properties": {
          "fileContents": {
            "type": "string",
            "format": "byte"
          },
          "contentType": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileDownloadName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastModified": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "entityTag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EntityTagHeaderValue"
              }
            ]
          },
          "enableRangeProcessing": {
            "type": "boolean"
          }
        }
      },
      "JsonElement": { },
      "MergePdfDocument": {
        "type": "object",
        "properties": {
          "pdfBase64": {
            "type": [
              "null",
              "string"
            ]
          },
          "pages": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            },
            "description": "Omit or use null for every page. Repeated pages are permitted."
          }
        }
      },
      "MergePdfRequest": {
        "type": "object",
        "properties": {
          "documents": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/MergePdfDocument"
            },
            "description": "PDFs in output order, with optional ordered, one-based page selections."
          },
          "documentsBase64": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            },
            "description": "Compatibility format: include every page of each supplied PDF."
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageNumbers": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PageNumberSettings"
              }
            ]
          }
        }
      },
      "NumberPdfRequest": {
        "type": "object",
        "properties": {
          "pdfBase64": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileName": {
            "type": [
              "null",
              "string"
            ]
          },
          "pageNumbers": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PageNumberSettings"
              }
            ]
          }
        }
      },
      "PageNumberSettings": {
        "type": "object",
        "properties": {
          "format": {
            "type": [
              "null",
              "string"
            ]
          },
          "fontSize": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "rightMargin": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          },
          "y": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "float"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StringSegment": {
        "type": "object",
        "properties": {
          "buffer": {
            "type": [
              "null",
              "string"
            ]
          },
          "offset": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "length": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "value": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasValue": {
            "type": "boolean"
          }
        }
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "Required for PDF generation when this deployment enables API key authentication.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "PdfGenerator.Api"
    },
    {
      "name": "PdfOperations"
    },
    {
      "name": "Pdfs"
    }
  ]
}