---
updatedAt: 2026-04-24T18:36:38.000Z
agentTools:
  projectIndex: https://docs.docupipe.ai/llms.txt
---

# Submit a Document for Processing

Use this endpoint to submit a document to DocuPipe for processing. You can upload a local file or provide a URL to a remote file. Upon submission, receive a unique `documentId` which you may use to retrieve the document's results, or apply subsequent workflows on it.

Max document size is 3000 pages and 3000 MB. Max metadata size is 10KB.

<Accordion title="Advanced Options" icon="fa-info-circle">You may also provide a `workflowId` to apply a pre-defined workflow to the document.</Accordion>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "DocuPipe",
    "version": "1.0"
  },
  "paths": {
    "/document": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Submit a Document for Processing",
        "description": "Use this endpoint to submit a document to DocuPipe for processing. You can upload a local file or provide a URL to a remote file. Upon submission, receive a unique `documentId` which you may use to retrieve the document's results, or apply subsequent workflows on it.\n\nMax document size is 3000 pages and 3000 MB. Max metadata size is 10KB.\n\n<Accordion title=\"Advanced Options\" icon=\"fa-info-circle\">You may also provide a `workflowId` to apply a pre-defined workflow to the document.</Accordion>",
        "operationId": "post_document",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Request Entity Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ClassifyStandardizeStepOutput": {
        "properties": {
          "classificationJobId": {
            "type": "string",
            "title": "Classification Job ID",
            "description": "Job ID for the classification job."
          },
          "classToStandardizationIds": {
            "additionalProperties": true,
            "type": "object",
            "title": "Class to Standardization IDs",
            "description": "Dictionary mapping class IDs to the standardization IDs that will be created for that class if the document is classified as that class."
          },
          "classToStandardizationJobIds": {
            "additionalProperties": true,
            "type": "object",
            "title": "Class to Standardization Job IDs",
            "description": "Dictionary mapping class IDs to the job IDs for the standardization jobs that will run for that class if the document is classified as that class."
          }
        },
        "type": "object",
        "required": [
          "classificationJobId",
          "classToStandardizationIds",
          "classToStandardizationJobIds"
        ],
        "title": "ClassifyStandardizeStepOutput"
      },
      "ErrorResponse": {
        "properties": {
          "detail": {
            "type": "string",
            "title": "Detail",
            "description": "Details about the error"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "ErrorResponse"
      },
      "File": {
        "properties": {
          "contents": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File Contents",
            "description": "Binary string representing the content of the file in base64 encoding."
          }
        },
        "type": "object",
        "required": [
          "contents"
        ],
        "title": "File"
      },
      "FileExtension": {
        "type": "string",
        "enum": [
          "pdf",
          "png",
          "jpeg",
          "webp",
          "tiff",
          "jp2",
          "txt",
          "json",
          "xml",
          "html",
          "doc",
          "docx",
          "csv",
          "xlsx",
          "xls",
          "eml"
        ],
        "title": "FileExtension"
      },
      "FileType": {
        "type": "string",
        "enum": [
          "pdf",
          "image",
          "text",
          "json",
          "html",
          "word",
          "table"
        ],
        "title": "FileType"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InputDocument": {
        "properties": {
          "file": {
            "$ref": "#/components/schemas/File",
            "description": "File object containing the input document in base64 encoding."
          },
          "url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Document URL",
            "description": "URL pointing to the location of the input file.",
            "examples": [
              "https://example.com/document.pdf"
            ]
          },
          "filename": {
            "type": "string",
            "title": "Filename",
            "description": "Name of the file, not including the file extension."
          },
          "fileExtension": {
            "$ref": "#/components/schemas/FileExtension",
            "title": "File Extension",
            "description": "Extension of the file."
          },
          "fileType": {
            "$ref": "#/components/schemas/FileType",
            "title": "File Type",
            "description": "Type of the file. If not provided, it will be determined from the file contents."
          }
        },
        "type": "object",
        "title": "Input Document"
      },
      "InsufficientCreditsError": {
        "properties": {
          "detail": {
            "type": "string",
            "title": "Detail",
            "description": "Explanation about the exhausted credits"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "InsufficientCreditsError"
      },
      "PostDocumentRequest": {
        "properties": {
          "document": {
            "$ref": "#/components/schemas/InputDocument",
            "description": "The document to be analyzed, provided either as a file or via a URL.",
            "examples": [
              {
                "document": {
                  "file": {
                    "contents": "SGVsbG8sIFdvcmxkIQ=="
                  },
                  "url": "https://example.com/document.pdf"
                }
              }
            ]
          },
          "pages": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Pages",
            "description": "List of zero indexed page numbers to parse. If omitted or empty, all pages are parsed. Page selection applies to PDFs and files converted to PDF during upload, such as DOC/DOCX, HTML, and multi-page TIFF files. It is ignored for single-page images and data or text files (CSV, XLS/XLSX, TXT, XML, JSON), which are processed in full.",
            "default": []
          },
          "dataset": {
            "type": "string",
            "title": "Dataset",
            "description": "Name of the dataset to which you want to assign this document. It can be any string. This is useful to group your documents",
            "default": "unassigned"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Optional metadata to associate with the document."
          },
          "parseVersion": {
            "type": "number",
            "title": "Version",
            "description": "Version of parsing. Available versions are 1.2 (default, improved results on right-to-left languages such as Hebrew and Arabic), 1.1, and the legacy 1, 2, 3",
            "default": 1.2
          },
          "processingMethod": {
            "$ref": "#/components/schemas/ProcessingMethod",
            "title": "Processing Method",
            "description": "Method to use for processing the document. The options are: asImage (treats native PDFs as images), or removeWatermark (removes watermarks from PDFs before processing). Note that removeWatermark is experimental."
          },
          "timeout": {
            "type": "integer",
            "title": "Timeout",
            "description": "The timeout in seconds for the job for webhook error reporting"
          },
          "workflowId": {
            "type": "string",
            "title": "Workflow ID",
            "description": "*Advanced Feature*\nUnique identifier of the workflow to be applied to the doucment once it is processed. See `POST /workflow/onSubmitDocument` for more details."
          }
        },
        "type": "object",
        "required": [
          "document"
        ],
        "title": "PostDocumentRequest"
      },
      "PostDocumentResponse": {
        "properties": {
          "documentId": {
            "type": "string",
            "title": "Document ID",
            "description": "Unique identifier for the submitted document."
          },
          "jobId": {
            "type": "string",
            "title": "Job ID",
            "description": "Unique identifier for the Document Upload Job."
          },
          "status": {
            "$ref": "#/components/schemas/ProcessingStatus",
            "title": "Processing Status",
            "description": "Current status of the document processing."
          },
          "workflowResponse": {
            "$ref": "#/components/schemas/WorkflowResponse",
            "title": "Workflow Response",
            "description": "*Advanced Feature*\nIf you supplied a workfld In the input, the response will contain all the information to retrieve the outcome of the workflow."
          },
          "workflowV2RunJobId": {
            "type": "string",
            "title": "Workflow V2 Run Job ID",
            "description": "*Advanced Feature*\nIf the supplied workflowId is a single-input v2 (Architect) workflow, this is the WorkflowV2Job id for the run kicked off on the uploaded document. Poll GET /job/{job_id} for outputs."
          }
        },
        "type": "object",
        "required": [
          "documentId",
          "jobId",
          "status"
        ],
        "title": "PostDocumentResponse"
      },
      "ProcessingMethod": {
        "type": "string",
        "enum": [
          "asImage",
          "removeWatermark"
        ],
        "title": "ProcessingMethod"
      },
      "ProcessingStatus": {
        "type": "string",
        "enum": [
          "processing",
          "completed",
          "error"
        ],
        "title": "ProcessingStatus"
      },
      "SplitClassifyStandardizeStepOutput": {
        "properties": {
          "splitJobId": {
            "type": "string",
            "title": "Split Job ID",
            "description": "Job ID for the split job that runs before classification and standardization."
          },
          "classificationJobIdsByDocument": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Classification Job IDs by Document",
            "description": "Mapping of document IDs to the classification job IDs created for each document."
          },
          "classToStandardizationJobIdsByDocument": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "object",
            "title": "Class to Standardization Job IDs by Document",
            "description": "Mapping of document IDs to class-to-job-ID dictionaries for the standardization jobs that may run for each class."
          },
          "classToStandardizationIdsByDocument": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "type": "object",
            "title": "Class to Standardization IDs by Document",
            "description": "Mapping of document IDs to class-to-standardization-ID dictionaries for the standardizations that may run for each class."
          },
          "classToStandardizeBatchJobId": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Class to Standardize Batch Job ID",
            "description": "Mapping of class IDs to their corresponding batch job IDs for polling."
          }
        },
        "type": "object",
        "required": [
          "splitJobId"
        ],
        "title": "SplitClassifyStandardizeStepOutput"
      },
      "SplitStandardizeStepOutput": {
        "properties": {
          "splitJobId": {
            "type": "string",
            "title": "Split Job ID",
            "description": "Job ID for the split job that runs before standardization."
          },
          "standardizationJobIdsByDocument": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Standardization Job IDs by Document",
            "description": "Mapping of new document IDs to the standardization job IDs created for each document."
          },
          "standardizationIdsByDocument": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Standardization IDs by Document",
            "description": "Mapping of new document IDs to the standardization IDs created for each document."
          },
          "standardizeBatchJobIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Standardize Batch Job IDs",
            "description": "List of batch job IDs (one per schema) that wrap the standardization jobs for polling."
          }
        },
        "type": "object",
        "required": [
          "splitJobId"
        ],
        "title": "SplitStandardizeStepOutput"
      },
      "StandardizeReviewStepOutput": {
        "properties": {
          "standardizationIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Standardization IDs",
            "description": "List of standardization IDs that result from the standardize and review step."
          },
          "standardizationJobIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Standardization Job IDs",
            "description": "List of job IDs for the standardization jobs that will run."
          },
          "reviewIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Review IDs",
            "description": "List of review IDs that will be created for each standardization."
          },
          "reviewJobIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Review Job IDs",
            "description": "List of job IDs for the review jobs that will run."
          }
        },
        "type": "object",
        "required": [
          "standardizationIds",
          "standardizationJobIds",
          "reviewIds",
          "reviewJobIds"
        ],
        "title": "StandardizeReviewStepOutput"
      },
      "StandardizeStepOutput": {
        "properties": {
          "standardizationIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Standardization IDs",
            "description": "List of standardization IDs that result from the standardize step."
          },
          "standardizationJobIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Job IDs",
            "description": "List of job IDs for the standardization jobs that will run."
          }
        },
        "type": "object",
        "required": [
          "standardizationIds",
          "standardizationJobIds"
        ],
        "title": "StandardizeStepOutput"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WorkflowResponse": {
        "properties": {
          "workflowId": {
            "type": "string",
            "title": "Workflow ID",
            "description": "Unique identifier of the workflow."
          },
          "standardizeStep": {
            "$ref": "#/components/schemas/StandardizeStepOutput",
            "title": "Standardize Step Output",
            "description": "Output of the standardize step, if applicable."
          },
          "splitStandardizeStep": {
            "$ref": "#/components/schemas/SplitStandardizeStepOutput",
            "title": "Split and Standardize Step Output",
            "description": "Output of the split and standardize step, if applicable."
          },
          "splitClassifyStandardizeStep": {
            "$ref": "#/components/schemas/SplitClassifyStandardizeStepOutput",
            "title": "Split, Classify, and Standardize Step Output",
            "description": "Output of the split, classify, and standardize step, if applicable."
          },
          "standardizeReviewStep": {
            "$ref": "#/components/schemas/StandardizeReviewStepOutput",
            "title": "Standardize and Review Step Output",
            "description": "Output of the standardize and review step, if applicable."
          },
          "classifyStandardizeStep": {
            "$ref": "#/components/schemas/ClassifyStandardizeStepOutput",
            "title": "Classify and Standardize Step Output",
            "description": "Output of the classify and standardize step, if applicable."
          },
          "errorMessage": {
            "type": "string",
            "title": "Error Message",
            "description": "Error message if the workflow failed."
          }
        },
        "type": "object",
        "required": [
          "workflowId"
        ],
        "title": "WorkflowResponse"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://app.docupipe.ai"
    }
  ]
}
```