{
  "swagger": "2.0",
  "info": {
    "title": "Pdfless API",
    "description": "Pdfless allows you to quickly and easily generate PDF documents using templates designed with HTML/CSS and conditional formatting.",
    "contact": {
      "name": "Pdfless support team",
      "email": "contact@pdfless.com"
    },
    "version": "v1"
  },
  "paths": {
    "/v{version}/document-templates": {
      "get": {
        "tags": [
          "DocumentTemplates"
        ],
        "summary": "List document templates",
        "description": "List document templates of current workspace",
        "operationId": "ListDocumentTemplates",
        "produces": [
          "text/plain",
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "Page",
            "type": "integer",
            "format": "int32"
          },
          {
            "in": "query",
            "name": "PageSize",
            "type": "integer",
            "format": "int32"
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/DocumentTemplateDto"
              }
            }
          },
          "500": {
            "description": "Server Error",
            "schema": {
              "$ref": "#/definitions/ApiExceptionDetailsResult"
            }
          }
        }
      }
    },
    "/v{version}/pdfs": {
      "post": {
        "tags": [
          "PDFs"
        ],
        "summary": "Create PDF",
        "description": "Generate document based on template ID and payload data",
        "operationId": "Generate",
        "consumes": [
          "application/json",
          "text/json",
          "application/*+json"
        ],
        "produces": [
          "text/plain",
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "version",
            "required": true,
            "type": "string"
          },
          {
            "in": "body",
            "name": "body",
            "schema": {
              "$ref": "#/definitions/GeneratePDFCommand"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/PDFDtoApiResult"
            }
          },
          "500": {
            "description": "Server Error",
            "schema": {
              "$ref": "#/definitions/ApiExceptionDetailsResult"
            }
          }
        }
      }
    },
    "/v{version}/workspaces": {
      "get": {
        "tags": [
          "Workspaces"
        ],
        "summary": "Get workspace",
        "description": "Get workspace detail",
        "operationId": "GetWorkspace",
        "produces": [
          "text/plain",
          "application/json",
          "text/json"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "version",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "$ref": "#/definitions/WorkspaceDto"
            }
          },
          "500": {
            "description": "Server Error",
            "schema": {
              "$ref": "#/definitions/ApiExceptionDetailsResult"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "ApiExceptionDetailsResult": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "error_code": {
          "type": "string"
        },
        "documentation_url": {
          "type": "string"
        },
        "correlation_id": {
          "format": "uuid",
          "type": "string"
        }
      }
    },
    "DocumentTemplateDto": {
      "type": "object",
      "properties": {
        "id": {
          "format": "uuid",
          "description": "Template identifier",
          "type": "string"
        },
        "name": {
          "description": "Template name",
          "type": "string"
        },
        "imagePreviewUrl": {
          "description": "Image preview of document template",
          "type": "string"
        },
        "pdfPreviewUrl": {
          "description": "PDF preview of document template",
          "type": "string"
        },
        "created": {
          "format": "date-time",
          "description": "Creation date",
          "type": "string"
        },
        "modified": {
          "format": "date-time",
          "description": "Modification date",
          "type": "string"
        }
      }
    },
    "GeneratePDFCommand": {
      "type": "object",
      "properties": {
        "template_id": {
          "format": "uuid",
          "type": "string"
        },
        "payload": { },
        "reference_id": {
          "type": "string"
        },
        "encryption_user_password": {
          "type": "string"
        },
        "encryption_owner_password": {
          "type": "string"
        },
        "encryption_allow_printing": {
          "type": "boolean"
        },
        "encryption_allow_modifying": {
          "type": "boolean"
        },
        "encryption_allow_modify_annotations": {
          "type": "boolean"
        },
        "encryption_allow_content_copying": {
          "type": "boolean"
        },
        "encryption_allow_screenreaders": {
          "type": "boolean"
        },
        "encryption_allow_form_filling": {
          "type": "boolean"
        },
        "encryption_allow_document_assembly": {
          "type": "boolean"
        }
      }
    },
    "PDFDto": {
      "type": "object",
      "properties": {
        "reference_id": {
          "description": "Internal reference identifier",
          "type": "string"
        },
        "template_id": {
          "format": "uuid",
          "description": "Targeting template identifier",
          "type": "string"
        },
        "download_url": {
          "description": "URL of generated document",
          "type": "string"
        },
        "expires": {
          "format": "date-time",
          "description": "Expiration date",
          "type": "string"
        },
        "created_at": {
          "format": "date-time",
          "description": "Creation date",
          "type": "string"
        }
      }
    },
    "PDFDtoApiResult": {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/definitions/PDFDto"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "WorkspaceDto": {
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of workspace",
          "type": "string"
        },
        "active": {
          "description": "Active status of workspace",
          "type": "boolean"
        },
        "created": {
          "format": "date-time",
          "description": "Creation date",
          "type": "string"
        },
        "modified": {
          "format": "date-time",
          "description": "Modification date",
          "type": "string"
        },
        "quota": {
          "format": "int32",
          "description": "Quota limit",
          "type": "integer"
        },
        "remainingQuota": {
          "format": "int32",
          "description": "Remaining quota",
          "type": "integer"
        }
      }
    }
  },
  "securityDefinitions": {
    "PdflessApiKey": {
      "type": "apiKey",
      "name": "apikey",
      "in": "header"
    }
  },
  "security": [
    {
      "PdflessApiKey": [ ]
    }
  ]
}