DaletGuard supports civilians affected by armed conflict through Families Beyond War. All sides, no political affiliation. About our humanitarian work

Choosing Among DaletParse Document Intake Routes

Document intake routes are the ways a file can reach DaletParse, and the code offers four of them in practice. Each route fits a different caller, because a person, a script and a system need different answers and different limits. Four questions separate the routes, so a team can pick one before it writes any integration code. It also lists the file rules that all routes share, and it names the limits of the tenant job routes. Everything comes from the repository, so your own careful tests must confirm each behavior on your own deployment before launch.

The wider workflow sits in the document intake workflow guide.

Illustration of server, traffic, lock for document intake routes
Key takeaway

Pick the route from four questions, who submits, how long the caller can wait, what must come back, and how long the data may stay. A person uses the workspace, a script can use the analyze route or the command line, and a system that needs extracted records uses tenant jobs.

Which four questions decide the intake route for your team

Document intake routes differ on four points. First, who submits the file: a person, a script or a system. Second, how long the caller can wait for an answer.

Third, ask what must come back. Some teams need only a verdict about the pack. Others, in contrast, need every extracted field. Finally, ask how long the data may stay on the service.

Write the four answers down for your document intake routes before you read the rest. Then each route below either fits or does not fit. A clear choice among document intake routes saves weeks of rework later. The extraction API and command line page lists the routes in full.

When a person uploads a pack by hand in the workspace

The web workspace is built for people. Specifically, a person uploads a file and gets a run identifier. Next, the job joins a single worker queue.

Progress streams to the screen as server events. In addition, the status shows the queue position, the estimated wait and the phase. Moreover, the workspace offers a first-page preview, a validation panel, a ZIP of results and CSV reports.

Of the document intake routes, this one suits a reviewer who wants to see the pack and the flags. For automation, the API routes take over. Web runs follow the retention period your administrators set. The review workspace page shows what a reviewer sees.

When a script needs a quick verdict from the analyze route

The analyze route is a sync call. For example, a script sends one file in a field named file, and the call blocks until the whole pipeline ends. Then the answer arrives in the same HTTP reply. However, other document intake routes answer later.

First, the reply holds a success flag, a document count, a page total and an error list. Each document entry holds its type, its type confidence, its outcome, its rejections, its flags and its pages. Notably, the list is capped at one hundred documents.

The reply is also free of any file paths. Likewise, it carries no extracted values. As a result, it fits triage that asks what a pack contains. Among document intake routes, it is the one for quick triage.

A long pack means a long request. Therefore, set a generous client timeout, and run the call from a background worker. Moreover, the working folder is removed before the reply is sent, so nothing waits for a cleanup pass.

The route sits behind your API gateway. Therefore, put a gateway in front of it, as you would for any internal service.

Illustration for Choosing Among DaletParse Document Intake Routes

When a system needs the extracted records from tenant jobs

Tenant job routes are the async path for systems. A caller sends a statement file with a bearer token and a tenant header. The service then answers with a 202 reply and a run identifier.

Next, the caller uses the poll route until the job ends. The tenant job routes also offer a jobs list and a results route. The queue behavior in a batch shows how those calls read a whole batch.

What a tenant call must prove before a job can run

These tenant job routes check two values per call. The token must be 32 to 512 printable ASCII characters, and the tenant must be a canonical UUID. In addition, tokens are compared in constant time. However, if no token registry exists, the routes answer 503.

An accounting evidence route also needs the tenant token. Specifically, it takes up to twenty documents and returns a closed schema within 8 MiB. Meanwhile, results are filtered by owner, so one tenant cannot read the runs of another.

Tenant runs expire after a set window. The default window is 168 hours, and the uploaded file is deleted when the job ends. For the full rules, see the retention and expiry rules.

How the command line fits into scripts and test runs

The command line wraps the shared core. A command line analyze call looks like cli.py analyze, followed by a file path. For instance, a json flag prints the machine-readable result. Also, an output directory flag keeps the run files.

Because command line analyze uses the same core as the analyze route, the answer has the same shape. The exit code is 1 when the run fails, so a shell script can branch on it. In contrast to the HTTP routes, the command line runs on the machine that holds the files. Among document intake routes, it is the only local one.

Command line analyze suits two jobs well, as the next lines show. First, it helps engineers check a single file before they wire an integration. Second, it supports a regression run over a reference pack after each upgrade. A command line analyze loop over a folder is easy to script.

The command line analyze step still needs the same model and OCR services as the server.

DaletParse Checklist: Analyze route screen

What the same file rules mean for every intake route

All document intake routes take the same accepted file types. They are PDF, JPG, JPEG, PNG, TIFF, TIF and WEBP files. A file may not be empty, and it may not exceed 50 MiB. Therefore, check the accepted file types before you call any route.

Also, the name is cleaned before it is saved, and it must stay within 255 bytes after the cleanup. Similarly, a file above the size limit is refused with a 413 answer. Every error comes back in one shape, and the accepted file types are the same for every caller.

  • Send one document family per file when you can, because splitting then has less to guess.
  • Prefer native PDFs to image files, because the reader finds text without OCR. Nevertheless, the accepted file types allow both.
  • Keep scans sharp, because poor pages lead to flags and requests for a new copy.

Also, the accepted file types are part of the route choice too. A route cannot fix a bad file, because each one passes the same pipeline. The pipeline overview lists the stages.

How to test each route on your own real packs first

Use your own files, not clean examples. For example, pick ten or so real packs, including your worst scans. Then send them through each of the document intake routes you plan to use.

  1. Time each route with your own packs, and write down the range.
  2. Check what comes back, and compare it with what your system needs.
  3. Break a call on purpose, with a bad token or a huge file, to see the error shape.
  4. Restart the service during a job, to see how your caller reacts.

Record the answers for each of the document intake routes beside the four questions. As a result, that record becomes your intake design note, and it makes the next review quick. The job status and recovery article covers the restart test in greater depth.

Match each route to a person, a script or a system

A person belongs in the web workspace. Meanwhile, a script can use the analyze route or the command line. Finally, a system that needs records belongs on the tenant job routes. All document intake routes share one set of file rules.

Choose among document intake routes by the four questions, then run your own packs. For the daily routine around any route, return to the full intake guide.

For background on the reply codes, see the HTTP semantics standard (opens in new tab). The OpenAPI Initiative (opens in new tab) describes the format of the service contract.

A diagram of 3 connected steps, each with a small drawing: Tenant job routes, Command line analyze.

Questions and answers on this topic from the product team

Which route should a person use to upload files?

A person should use the web workspace, which shows progress, a queue position and the results for each run. It also offers downloads such as a ZIP file and CSV reports. Web runs follow the retention period your administrators set.

What does the analyze route return?

It returns a verdict for each document in the file, with its type, confidence, outcome, rejections, flags and pages. It returns no extracted values and no file paths. The call blocks until the whole pipeline ends, so clients need a long timeout.

When should a system use tenant job routes?

Use them when a system needs extracted records, not only a verdict. A call returns a 202 reply with a run identifier, and the caller polls until the job ends. These routes need a bearer token and a tenant header.

What are the accepted file types and size limit?

Every route takes PDF, JPG, JPEG, PNG, TIFF, TIF and WEBP files. A file may not be empty or larger than 50 MiB. The name must also stay within 255 bytes after cleanup.

Does the command line behave differently from the API?

No, because the command line is a thin wrapper over the same core action as the analyze route. It prints a readable summary or JSON and exits with code 1 when the run fails. It needs the same model and OCR services as the server.

See how DaletParse fits the providers your team uses today

Book a short meeting for a walkthrough with your own providers in mind, or join an in-person class to learn the method first.