{
  "openapi": "3.1.0",
  "info": {
    "title": "Reimply API",
    "version": "1.0.0",
    "description": "Convert, compress, ingest, optimize, merge, split and OCR files over HTTP. 1 file, 1 call. No credit maths. Files are deleted 60 minutes after a job finishes (inputs as soon as the job ends). Ingest and optimize run in memory and are not written to disk during processing.\n\nConversions: 1 file = 1 conversion. Video and audio jobs count as 3. File size and processing time do not add conversions. Failed jobs cost nothing.\nFree: 250 conversions a month, 25 MB, no card. Plans: Starter £12/mo for 3,000 conversions, 100 MB, 3 concurrent jobs; Growth £39/mo for 15,000 conversions, 250 MB, 10 concurrent jobs; Scale £99/mo for 50,000 conversions, 500 MB, 25 concurrent jobs.\n\nAuthenticated responses include Reimply-Quota-Limit (monthly allowance), Reimply-Quota-Remaining (conversions left in this period) and Reimply-Quota-Reset (Unix time of the next monthly reset).",
    "contact": {
      "name": "Reimply",
      "url": "https://reimply.com/contact"
    },
    "termsOfService": "https://reimply.com/legal/terms"
  },
  "servers": [
    {
      "url": "https://reimply.com"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Jobs"
    },
    {
      "name": "Files"
    },
    {
      "name": "Account"
    }
  ],
  "paths": {
    "/v1/convert": {
      "post": {
        "operationId": "convert",
        "summary": "Convert a file",
        "description": "Images, audio, video, PDF pages, data files and Markdown/DOCX. GET /v1/conversions lists every pair.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "to": {
                    "type": "string",
                    "example": "jpg",
                    "description": "Target format."
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "quality": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "dpi": {
                        "type": "integer",
                        "minimum": 36,
                        "maximum": 300,
                        "description": "PDF to image."
                      },
                      "height": {
                        "type": "integer",
                        "description": "Video: scale to this height."
                      },
                      "crf": {
                        "type": "integer",
                        "minimum": 16,
                        "maximum": 40
                      },
                      "audio_bitrate": {
                        "type": "string",
                        "enum": [
                          "64k",
                          "96k",
                          "128k",
                          "160k",
                          "192k",
                          "256k",
                          "320k"
                        ]
                      },
                      "fps": {
                        "type": "integer",
                        "description": "GIF frame rate."
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "to": {
                    "type": "string"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compress": {
      "post": {
        "operationId": "compress",
        "summary": "Compress an image, PDF, video or audio file",
        "description": "Set options.target_size to get an image or PDF at or under an exact size (for example \"200kb\"). If the size cannot be reached, the smallest result is returned and listed in target_missed.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "target_size": {
                        "oneOf": [
                          {
                            "type": "integer",
                            "description": "bytes"
                          },
                          {
                            "type": "string",
                            "example": "200kb"
                          }
                        ]
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "jpg",
                          "webp",
                          "png",
                          "avif",
                          "keep"
                        ]
                      },
                      "quality": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "max_side": {
                        "type": "integer"
                      },
                      "pdf_level": {
                        "type": "string",
                        "enum": [
                          "light",
                          "strong"
                        ]
                      },
                      "crf": {
                        "type": "integer"
                      },
                      "height": {
                        "type": "integer"
                      },
                      "bitrate": {
                        "type": "string"
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/merge": {
      "post": {
        "operationId": "merge",
        "summary": "Merge PDFs (and images) into one PDF",
        "description": "Inputs are joined in order. Images become pages.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uri",
                          "description": "A public http(s) URL to download the file from."
                        },
                        {
                          "type": "object",
                          "properties": {
                            "upload_id": {
                              "type": "string",
                              "description": "From POST /v1/uploads, after you PUT the bytes."
                            },
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "filename": {
                              "type": "string",
                              "description": "Overrides the file name (the extension decides the input type)."
                            }
                          }
                        }
                      ]
                    },
                    "minItems": 2,
                    "maxItems": 20
                  },
                  "options": {
                    "type": "object",
                    "properties": {}
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/split": {
      "post": {
        "operationId": "split",
        "summary": "Split a PDF",
        "description": "One PDF per page, or per range.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "each",
                          "ranges"
                        ]
                      },
                      "ranges": {
                        "type": "string",
                        "example": "1-3,5,8-"
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/organize": {
      "post": {
        "operationId": "organize",
        "summary": "Reorder, remove and rotate PDF pages",
        "description": "options.pages is the new order (1-based); pages left out are removed.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "pages": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "example": [
                          3,
                          1,
                          2
                        ]
                      },
                      "rotate": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "integer",
                          "enum": [
                            90,
                            180,
                            270
                          ]
                        },
                        "example": {
                          "1": 90
                        }
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images-to-pdf": {
      "post": {
        "operationId": "images_to_pdf",
        "summary": "Turn images into a PDF",
        "description": "One page per image.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uri",
                          "description": "A public http(s) URL to download the file from."
                        },
                        {
                          "type": "object",
                          "properties": {
                            "upload_id": {
                              "type": "string",
                              "description": "From POST /v1/uploads, after you PUT the bytes."
                            },
                            "url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "filename": {
                              "type": "string",
                              "description": "Overrides the file name (the extension decides the input type)."
                            }
                          }
                        }
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 20
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "page_size": {
                        "type": "string",
                        "enum": [
                          "a4",
                          "fit"
                        ]
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pdf-to-images": {
      "post": {
        "operationId": "pdf_to_images",
        "summary": "Render PDF pages as images",
        "description": "One image per page.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "format": {
                        "type": "string",
                        "enum": [
                          "png",
                          "jpg",
                          "webp"
                        ]
                      },
                      "dpi": {
                        "type": "integer",
                        "minimum": 36,
                        "maximum": 300
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ocr": {
      "post": {
        "operationId": "ocr",
        "summary": "Extract text from an image or scanned PDF",
        "description": "Returns a .txt file. PDFs: up to 30 pages.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "lang": {
                        "type": "string",
                        "enum": [
                          "eng",
                          "deu",
                          "fra",
                          "spa",
                          "ita",
                          "por",
                          "nld"
                        ]
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ingest": {
      "post": {
        "operationId": "ingest",
        "summary": "Turn a digital PDF, Word document or data file into Markdown, tables and chunks",
        "description": "Growth and Scale only. Accepts a digital PDF, DOCX, CSV, TSV or JSON file. The job object includes an ingest field with markdown, tables (when they can be found), chunks of about 512 tokens (options.chunk_size, 64 to 4096) and per-page metadata for PDFs. Token counts are approximate (about 4 characters per token). Files are processed in memory, not written to disk. Scanned or image-only PDFs (no extractable text, or under about 20 characters per page on average) return 422 ocr_required_unsupported and are not charged. Costs 1 conversion. Free and Starter plans get 403 plan_upgrade_required.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "chunk_size": {
                        "type": "integer",
                        "minimum": 64,
                        "maximum": 4096,
                        "default": 512,
                        "description": "Target tokens per chunk. Counts are approximate (about 4 characters per token)."
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/optimize": {
      "post": {
        "operationId": "optimize",
        "summary": "Shrink an image or PDF to an exact byte cap",
        "description": "Set options.max_bytes (bytes, or a size like \"100kb\"). For images, options.format may be jpg, webp or png. If the file already fits, it is returned as is. If the cap cannot be reached, the job returns 422 target_unreachable with bytes_achieved and max_bytes, and nothing is charged. Costs 1 conversion.",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "description": "A public http(s) URL to download the file from."
                      },
                      {
                        "type": "object",
                        "properties": {
                          "upload_id": {
                            "type": "string",
                            "description": "From POST /v1/uploads, after you PUT the bytes."
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "filename": {
                            "type": "string",
                            "description": "Overrides the file name (the extension decides the input type)."
                          }
                        }
                      }
                    ]
                  },
                  "options": {
                    "type": "object",
                    "properties": {
                      "max_bytes": {
                        "oneOf": [
                          {
                            "type": "integer",
                            "description": "Maximum output size in bytes."
                          },
                          {
                            "type": "string",
                            "example": "100kb"
                          }
                        ],
                        "description": "Required. Between 1 KB and 500 MB."
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "jpg",
                          "webp",
                          "png"
                        ],
                        "description": "Image output format. Defaults to the source format, or jpg."
                      }
                    }
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Force an async job. Inputs over 4 MB, and any request with webhook_url, are always async."
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "https URL that receives job.succeeded or job.failed, signed with your webhook secret."
                  }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "options": {
                    "type": "string",
                    "description": "JSON-encoded options."
                  },
                  "async": {
                    "type": "string"
                  },
                  "webhook_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync job finished. Send Accept: application/octet-stream to get a single result file (up to 4 MB) as the body instead. Authenticated responses include Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Async job accepted. Poll GET /v1/jobs/{id} or wait for the webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized or invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "plan_upgrade_required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type or file_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "unsupported_conversion, conversion_failed, source_blocked, source_fetch_failed, idempotency_key_reused, ocr_required_unsupported or target_unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited or concurrency_limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads": {
      "post": {
        "operationId": "create_upload",
        "summary": "Get a presigned upload URL",
        "tags": [
          "Files"
        ],
        "description": "For files over 4 MB (up to your plan and per-type limits). PUT the bytes to url with the given headers within 15 minutes, then use {\"upload_id\": id} as a job input.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "size"
                ],
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "size": {
                    "type": "integer"
                  },
                  "content_type": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "413": {
            "description": "file_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "unsupported_file_type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs": {
      "get": {
        "operationId": "list_jobs",
        "summary": "List recent jobs",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Jobs, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Job"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "operationId": "get_job",
        "summary": "Get a job",
        "tags": [
          "Jobs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}/outputs/{index}": {
      "get": {
        "operationId": "download_output",
        "summary": "Download a result",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to a 60-second download link"
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "operationId": "get_account",
        "summary": "Conversions, plan and limits",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "Account. Also returns Reimply-Quota-Limit, Reimply-Quota-Remaining and Reimply-Quota-Reset.",
            "headers": {
              "Reimply-Quota-Limit": {
                "$ref": "#/components/headers/QuotaLimit"
              },
              "Reimply-Quota-Remaining": {
                "$ref": "#/components/headers/QuotaRemaining"
              },
              "Reimply-Quota-Reset": {
                "$ref": "#/components/headers/QuotaReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversions": {
      "get": {
        "operationId": "list_conversions",
        "summary": "Every supported conversion pair",
        "tags": [
          "Jobs"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Pairs"
          }
        }
      }
    },
    "/v1/webhooks/test": {
      "post": {
        "operationId": "test_webhook",
        "summary": "Send a signed test event to a URL",
        "tags": [
          "Account"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delivery result"
          }
        }
      }
    }
  },
  "webhooks": {
    "jobFinished": {
      "post": {
        "summary": "job.succeeded / job.failed",
        "description": "Header Reimply-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your whsec_ secret>. Reject events older than 5 minutes. Delivered up to 5 times (now, +10 s, +1 m, +5 m, +30 m) until you answer 2xx.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "job.succeeded",
                      "job.failed",
                      "webhook.test"
                    ]
                  },
                  "created": {
                    "type": "integer"
                  },
                  "data": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return any 2xx to acknowledge."
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "QuotaLimit": {
        "description": "Monthly conversion allowance on the current plan.",
        "schema": {
          "type": "integer"
        },
        "example": 3000
      },
      "QuotaRemaining": {
        "description": "Conversions still available in this period.",
        "schema": {
          "type": "integer"
        },
        "example": 2840
      },
      "QuotaReset": {
        "description": "Unix time (seconds) when the monthly allowance resets.",
        "schema": {
          "type": "integer"
        },
        "example": 1735689600
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your API key (rmk_...) from https://reimply.com/account/api"
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "description": "Retry safely: the same key and body within 24 hours returns the first response (Idempotent-Replayed: true)."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "status"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "status": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "job"
          },
          "operation": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "sync",
              "async"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "processing_seconds": {
            "type": [
              "number",
              "null"
            ]
          },
          "input_bytes": {
            "type": "integer"
          },
          "conversions": {
            "type": "object",
            "properties": {
              "reserved": {
                "type": "integer"
              },
              "charged": {
                "type": "integer"
              }
            }
          },
          "credits": {
            "type": "object",
            "description": "Same as conversions (compatibility).",
            "properties": {
              "reserved": {
                "type": "integer"
              },
              "charged": {
                "type": "integer"
              }
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "size": {
                  "type": "integer"
                },
                "content_type": {
                  "type": "string"
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Signed link, valid until expires_at."
                }
              }
            }
          },
          "target_missed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ingest": {
            "type": "object",
            "description": "Present on succeeded /v1/ingest jobs: markdown, tables, chunks and optional PDF page metadata."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "bytes_achieved": {
                "type": "integer"
              },
              "max_bytes": {
                "type": "integer"
              },
              "upgrade_url": {
                "type": "string"
              }
            }
          },
          "webhook": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "attempts": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Upload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "method": {
            "const": "PUT"
          },
          "url": {
            "type": "string"
          },
          "headers": {
            "type": "object"
          },
          "max_bytes": {
            "type": "integer"
          },
          "expires_at": {
            "type": "string"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string"
          },
          "conversions": {
            "type": "object",
            "properties": {
              "allowance": {
                "type": "integer"
              },
              "purchased": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              }
            }
          },
          "credits": {
            "type": "object",
            "description": "Same as conversions (compatibility).",
            "properties": {
              "allowance": {
                "type": "integer"
              },
              "purchased": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              }
            }
          },
          "allowance": {
            "type": "object"
          },
          "limits": {
            "type": "object"
          }
        }
      }
    }
  }
}