{
  "openapi": "3.1.0",
  "info": {
    "title": "doqs.dev | PDF filling API",
    "version": "1.0",
    "x-jentic-source-url": "https://api.doqs.dev/v1/openapi.json"
  },
  "servers": [
    {
      "url": "https://api.doqs.dev/v1"
    }
  ],
  "paths": {
    "/pdf-filling/templates/{id}/fill": {
      "post": {
        "tags": [
          "PDF Filling"
        ],
        "summary": "Fill",
        "operationId": "fill",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FillTemplateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "4XX": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            },
            "description": "Client Error"
          },
          "5XX": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            },
            "description": "Server Error"
          }
        }
      }
    },
    "/pdf-filling/templates": {
      "get": {
        "tags": [
          "PDF Filling"
        ],
        "summary": "List ",
        "operationId": "list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseOk_List_Template__"
                }
              }
            }
          },
          "4XX": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            },
            "description": "Client Error"
          },
          "5XX": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            },
            "description": "Server Error"
          }
        }
      }
    },
    "/pdf-generator/render": {
      "post": {
        "tags": [
          "PDF Generator"
        ],
        "summary": "Render Pdf",
        "description": "Pass a html template, optionally a header and footer template, and pdf options to retrieve a rendered PDF.",
        "operationId": "render_pdf_pdf_generator_render_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenderPDFRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Retrieve the rendered PDF.",
            "headers": {
              "x-submission-id": {
                "description": "Unique identifier of the submission."
              }
            },
            "content": {
              "application/json": {
                "schema": {}
              },
              "application/pdf": {}
            }
          },
          "408": {
            "description": "Timeout while rendering the PDF",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            }
          },
          "426": {
            "description": "Free tier quota exceeded for the month",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            }
          },
          "4XX": {
            "description": "Client Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            }
          },
          "5XX": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            }
          }
        }
      }
    },
    "/pdf-generator/submissions": {
      "get": {
        "tags": [
          "PDF Generator"
        ],
        "summary": "Get Submissions",
        "operationId": "get_submissions_pdf_generator_submissions_get",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseOk_List_Submission__"
                }
              }
            }
          },
          "4XX": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            },
            "description": "Client Error"
          },
          "5XX": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                }
              }
            },
            "description": "Server Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AllowedHTTPMethods": {
        "type": "string",
        "enum": [
          "PUT",
          "POST"
        ],
        "title": "AllowedHTTPMethods"
      },
      "FillTemplateRequest": {
        "properties": {
          "data": {
            "type": "object",
            "title": "Data",
            "default": {}
          }
        },
        "type": "object",
        "title": "FillTemplateRequest"
      },
      "Format": {
        "type": "string",
        "enum": [
          "a0",
          "a1",
          "a2",
          "a3",
          "a4",
          "a5",
          "a6"
        ],
        "title": "Format"
      },
      "Margin": {
        "properties": {
          "top": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top"
          },
          "bottom": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bottom"
          },
          "left": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Left"
          },
          "right": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Right"
          }
        },
        "type": "object",
        "title": "Margin"
      },
      "Orientation": {
        "type": "string",
        "enum": [
          "landscape",
          "portrait"
        ],
        "title": "Orientation"
      },
      "PDFOptions": {
        "properties": {
          "format": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Format"
              }
            ],
            "default": "a4"
          },
          "orientation": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Orientation"
              }
            ],
            "default": "portrait"
          },
          "scale": {
            "type": "number",
            "maximum": 2,
            "minimum": 0.1,
            "title": "Scale",
            "default": 1
          },
          "margin": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Margin"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "PDFOptions"
      },
      "PresignedUploadRequest": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Url"
          },
          "method": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AllowedHTTPMethods"
              }
            ],
            "default": "PUT"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "PresignedUploadRequest"
      },
      "RenderPDFRequest": {
        "properties": {
          "template_html": {
            "type": "string",
            "title": "Template Html"
          },
          "header_template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Template"
          },
          "footer_template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Footer Template"
          },
          "pdf": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PDFOptions"
              }
            ],
            "default": {
              "format": "a4",
              "orientation": "portrait",
              "scale": 1
            }
          },
          "presigned_upload": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PresignedUploadRequest"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "template_html"
        ],
        "title": "RenderPDFRequest"
      },
      "ResponseError": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "ResponseError"
      },
      "ResponseOk_List_Submission__": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/Submission"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "ResponseOk[List[Submission]]"
      },
      "ResponseOk_List_Template__": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/Template"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "ResponseOk[List[Template]]"
      },
      "Submission": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "status": {
            "$ref": "#/components/schemas/_Status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "status"
        ],
        "title": "Submission"
      },
      "Template": {
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "pages": {
            "type": "integer",
            "title": "Pages"
          }
        },
        "type": "object",
        "required": [
          "created_at",
          "id",
          "pages"
        ],
        "title": "Template"
      },
      "_Status": {
        "type": "string",
        "enum": [
          "success",
          "error",
          "timeout"
        ],
        "title": "_Status"
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ]
}