Quick start: your first extraction in 10 minutes.In this guide, you generate a token, send a document to the Content Extraction endpoint and read the result: the document type, the extracted fields and the confidence score of each field.Choose your path#
| I want to... | Path |
|---|
| See the result without writing code | Upload a document in the Demo Portal |
| Integrate through the API | Follow the steps below |
Before you start#
POC client key. It has limited usage and is meant for testing. Already a customer? Request one at comercial@most.com.br. Calls from your backend. The API must be called from your server, never directly from an app or browser. Any communication with apps and devices goes through your backend before reaching mostQI.
A test document. A photo or PDF of a CNH, RG or another document from the catalog, with up to 5 pages. Not a customer yet?
Register on the portal. After you sign up, one of our representatives will contact you to help. Store the client key in an environment variable:How it works#
The diagram shows the calls you will make in the steps below. Everything happens from your backend.Step 1 – Generate the token#
You must call the authentication endpoint before any request to the APIs.
Authentication uses the JWT standard, with single-use, temporary tokens generated by the Authenticate (Get JWT) endpoint from your client key. The token is valid for 10 minutes and can be used only once: generate a new one for each call.Request: POST https://mostqiapi.com/user/authenticate{ "token": "<your client key>" }
{ "token": "eyJhbGciOi..." }
Step 2 – Send the document#
Send the file encoded in base64 in the fileBase64 field. If the file is available at a public URL, use fileUrl instead.On Linux. On macOS, replace
base64 -w0 document.jpg with
base64 -i document.jpg.
Step 3 – Read the result#
The response contains a result list with one item per document found in the file. A single file can contain several documents, such as the front and back of an ID.Short response example, with illustrative values:{
"result": [
{
"type": "documento-pessoal",
"stdType": "personal-document",
"score": 0.98,
"pageNumber": 1,
"tags": ["country=bra", "subtype=rg", "region=verso"],
"fields": [
{ "name": "nome", "stdName": null, "value": "MARIA DA SILVA", "score": 0.99 },
{ "name": "cpf", "stdName": null, "value": "00000000000", "score": 0.99 },
{ "name": "data_nascimento", "stdName": null, "value": "1986-05-16", "score": 1 }
],
"tables": [],
"crops": []
}
],
"requestId": "6ERWpivDfUmhEoqnXeDHi",
"elapsedMilliseconds": 1089,
"status": { "code": "200", "message": "Ok", "errors": null }
}
| Field | What it is | How to use it |
|---|
result | List with one item per document found in the file | Loop through all items; a file may contain front and back |
type / stdType | Document type, in the original language and in standardized form | Check that it is the document you expected |
tags | Document characteristics (country, subtype, side) | Use them to separate front and back or filter subtypes |
score (document) | Overall rating, from 0 to 1, of the image and reading quality | Documents with a low score are candidates for a new capture |
fields[].name | Name of the extracted field | Always locate fields by name |
fields[].value | Value read | Store it in your system if the field score meets your threshold |
fields[].score | Confidence of the field reading, from 0 to 1 | Decide whether it flows automatically or goes to review |
requestId | Request identifier | Share it with support if you have questions |
Field order is not guaranteed. Always locate a field by its name, never by its position.
Step 4 – Decide based on the score#
Each field has a score from 0 to 1, and the document also has an overall score. The higher the score, the more reliable the reading. Use the score to decide the path of each document:Score at or above your threshold: the data flows automatically into your system.
Score below the threshold: the document goes to human review, by your team or in mostValid.
In the POC, treat fields scoring below 0.5 as candidates for human review. Test with real documents from your operation and track how many items fall below that value. 0.5 is a starting point, not an accuracy guarantee: adjust the threshold to the risk of each field. A higher threshold reduces errors and increases review; a lower one does the opposite.If the review volume is significant, or if your operation already requires a controlled process, plan to use mostValid. With mostValid, you send documents through its own endpoints, and review tasks are opened automatically according to the rules defined for your operation.If something goes wrong#
| Code | HTTP | What it means | What to do |
|---|
| R117 | 401 | Invalid, expired or already used token | Generate a new token for each request |
| R101 | 400 | Incorrect parameter | Check the field names and send fileBase64 or fileUrl |
| R103 or R115 | 400 | Invalid base64 | Encode the entire file in base64 (RFC 4648) |
| R113 or R130 | 400 | Unsupported file format | Use a format from the list of supported extensions |
| E400 | 400 | File too large | Up to 50 MB for PDF and 20 MB for images |
| R120 | 408 | Processing timed out | For PDFs with more than 5 pages, use the asynchronous endpoint |
| R110 | 429 | Request limit reached | Wait a few seconds and resend |
| S101 or S103 | 400 | Account without the service or without credits | Contact comercial@most.com.br |
Before going to production#
Replace the POC client key with your production client key.
Use the production domain with a whitelist and register your backend IPs (see the table below).
Files: up to 50 MB for PDF and 20 MB for images.
Domains#
| Domain | Use | Access |
|---|
production-mostqiapi.com | Production | Only for IPs registered in the mostQI whitelist |
mostqiapi.com | Staging and POC | From any IP |
Both domains point to the same production environment. Do not use mostqiapi.com in production: it may be interrupted by security triggers.All requests must use the HTTPS protocol.
Security and responsible use#
Tests run directly in this documentation must use only the POC client key, which is meant for demonstration and has limited usage. The production client key must be used exclusively in the direct integration from your backend.
Client key security: the customer is responsible for keeping the client key safe and confidential, with appropriate measures against unauthorized access. The customer is responsible for the costs of all queries made with their client key.
Responsible use: use of the API and client keys must follow the terms of the service agreements and your organization's security policies.
Next steps#