Skip to main content

Submitting a Document

Submitting a Document for Standard Analysis​

To start document analysis, send a POST request to the /document endpoint using the multipart/form-data format.

Endpoint: https://api.caas.qitech.app/document_analysis/document

Request Format

The request must be sent as multipart/form-data and include data fields and a file field. The required fields for an analysis are id, document_analysis_type, and document_bytes.

Request example:

curl -X POST "https://api.caas.qitech.app/document_analysis/document" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "id=request-abc-12345" \
-F "document_analysis_type=proof_of_address_default" \
-F "document_bytes=@/path/to/your/proof.pdf"

Submission Attributes Description​

AttributeDescription
id (required)A unique identifier for the request, provided by you. This ID can be used later to retrieve the analysis results.
document_analysis_type (required)A string that specifies the type of analysis to be performed on the document. See the table below for supported types.
document_bytes (required)The document file to be analyzed. Must be sent as a file in the multipart request body. Note: Do not send this field as a base64-encoded string.
async (optional, default=false)A boolean (true or false) that defines the processing mode.
- false (synchronous): The API will attempt to process the document and return the result in the same request.
- true (asynchronous): The API will acknowledge receipt and process in the background. The result will be sent via webhook to a previously configured URL (see more in the webhooks section).
Attention

The async field must be used to indicate an asynchronous request. Synchronous requests should only be used for small documents and quick analyses where an immediate response is critical. If the analysis does not finish within the synchronous request time limit, the return status will be 202 Accepted and the result must be retrieved with a GET request, as described below. No webhook is sent in this case: the webhook is exclusive to asynchronous analyses.

Supported Analysis Types​

The document_analysis_type field determines which data extraction model will be applied to your document. Below are the types currently supported.

Analysis TypeDocument TypeDescription
proof_of_address_defaultProof of address (utility, gas and internet bills, government letters, declarations)Extracts and validates name, structured address, raw address, issue date and document type.
company_statute_defaultArticles of association or company statuteBasic extraction and validation: company data, share capital, registration office and partnership structure.
company_statute_credit_right_assignmentArticles of association or company statuteAdvanced extraction with validation of signing authority for credit rights assignment: signer groups, financial limits and whether human review is required.
power_of_attorney_defaultPower of attorneyExtracts grantors, grantees, powers granted, scope, expiration, irrevocability and notary data.
invoice_defaultInvoices and DANFEsExtracts issuer, contracting party, invoice type and taxation, number, dates, line items and amounts.
bankslip_defaultBank slipsExtracts payee, payee CNPJ, barcode, amount and due date.
ccb_defaultBank Credit Notes (CCB)Extracts contract number, issuer data, guarantees, financed amount, interest rate, installments and due dates.
portability_retention_evidence_analysisPortability retention evidenceValidates the evidence: contract number, issuer document and phone, portability number, presence of a signature and whether it is a valid confirmation.

Expand each type below to see the fields the analysis returns in analysis_result, with the type and meaning of each one. Nested fields are shown with their full path (address.street) and lists are marked with [].

proof_of_address_default — fields returned in analysis_result
FieldTypeDescription
namestringThe full name of the individual as extracted from the document.
addressobjectThe structured residential address as extracted from the document. If some information is not found, indicate with empty string.
address.streetstringThe name of the street as extracted from the document.
address.numberstringThe building or house number as extracted from the document.
address.complementstringAdditional address details like apartment, suite, or floor, if any.
address.neighborhoodstringThe neighborhood or district as extracted from the document.
address.citystringThe city of the address as extracted from the document.
address.statestringThe state or federal district of the address.
address.cepstringThe postal code (CEP) of the address.
raw_addressstringThe complete residential address as extracted from the document.
issue_datestringThe issue date of the document in YYYY-MM-DD format.
document_typeenum: utility_bill, bank_statement, address_declaration, rental_agreement, government_letter …The type of document provided (e.g., 'utility_bill', 'address_declaration', 'other').
company_statute_default — fields returned in analysis_result
FieldTypeDescription
company_name_officialstringFull Official Company Name
company_name_tradestringTrade Name
cnpjstringBrazilian Company Tax ID in XX.XXX.XXX/XXXX-XX format
nirestringCompany Registry Identification Number
headquarters_address_fullstringFull headquarters address
incorporation_datestringCompany incorporation date
last_consolidated_amendment_datestringDate of the last consolidated amendment
corporate_purpose_summarystringMain corporate purpose
share_capital_valuenumberTOTAL value of the Share Capital
share_capital_currencystringCurrency of the share capital (e.g., 'BRL')
registration_office_namestringName of the registration office (e.g., JUCESP)
registration_office_numberstringRegistration number at the competent authority
registration_office_datestringDate of registration/filing at the competent authority
requires_power_of_attorney_checkbooleanTrue if signing powers are unclear or if 'procuração' is mentioned, indicating a need to check for an additional document
partners_data[]objectA model representing a single partner's data extracted from the Articles of Incorporation.
partners_data[].namestringPartner's full name
partners_data[].cpfstringPartner's CPF in XXX.XXX.XXX-XX format
partners_data[].is_administratorbooleanTrue if the partner is explicitly named as an administrator
partners_data[].role_powersstringPosition or powers, ONLY IF the partner is an administrator
partners_data[].share_quantityintegerNumber of shares/quotas held by the partner
partners_data[].share_valuenumberTotal value in BRL of the shares/quotas
partners_data[].participation_percentagenumberPartner's participation percentage in the company
clauses_of_interestobjectA model for specific clauses of interest from the document.
clauses_of_interest.administration_clause_summarystringSummary of the clause defining who represents and signs for the company
company_statute_credit_right_assignment — fields returned in analysis_result
FieldTypeDescription
requires_reviewbooleanWhether the document is complex, contains many clauses or sub-clauses about administration, or requires other documents alongside it (such as meeting or election minutes).
company_dataobjectComplete registration and ownership data of the analysed entity.
company_data.company_name_officialstringFull official company name
company_data.company_name_tradestringTrade name
company_data.cnpjstringCNPJ in XX.XXX.XXX/XXXX-XX format
company_data.nirestringNIRE — company registry identification number
company_data.headquarters_address_fullstringFull headquarters address
company_data.incorporation_datestringCompany incorporation date
company_data.last_consolidated_amendment_datestringDate of these articles of association or of the amendment
company_data.corporate_purpose_summarystringMain corporate purpose
company_data.share_capital_valuenumberTOTAL value of the share capital
company_data.share_capital_currencystringCurrency of the share capital (e.g. 'BRL')
company_data.registration_office_namestringName of the registration office (e.g. JUCESP)
company_data.partners_data[]objectData of a single partner extracted from the articles of association.
company_data.partners_data[].namestringPartner's full name
company_data.partners_data[].cpfstringPartner's CPF in XXX.XXX.XXX-XX format
company_data.partners_data[].cnpjstringCNPJ of the partner company, when the partner is a legal entity, in XX.XXX.XXX/XXXX-XX format
company_data.partners_data[].is_representativebooleanTrue when the partner may represent the company.
company_data.partners_data[].role_powersenum: president, partner, administrator, director, manager …Position or powers. Use 'other' when it refers to a company, organisation or similar.
company_data.partners_data[].share_quantityintegerNumber of shares or quotas held by the partner
company_data.partners_data[].share_valuenumberTotal value of the shares or quotas
company_data.partners_data[].participation_percentagenumberPartner's participation percentage in the company
analyzed_operationstringThe specific legal act or transaction whose representation is being analysed.
source_documents[]stringCorporate documents underpinning the analysis (e.g. 'Articles of Association', 'Election Minutes').
allows_proxiesbooleanWhether the entity's articles allow representation through attorneys-in-fact.
signer_groups[]objectThe different signing groups and rules valid for the entity.
signer_groups[].group_idintegerA unique numeric identifier for the signing group.
signer_groups[].descriptionstringA clear summary of the business rule this group represents.
signer_groups[].source_clausestringThe full text of the clause or article establishing this rule.
signer_groups[].representation_typeenum: Conjunta, Individual, Conforme MandatoWhether representation is joint or individual. When both are allowed, use individual.
signer_groups[].minimum_signersintegerThe minimum number of members of this group who must sign. For joint signing this value must be greater than 1.
signer_groups[].limitationsobjectThe conditions and restrictions applicable to this signing rule.
signer_groups[].limitations.financial_limitobjectThe financial authority limit of the rule, in structured form.
signer_groups[].limitations.financial_limit.operatorenum: MENOR_IGUAL, MAIOR_QUE, MAIOR, MENOR, IGUAL …The comparison operator for the financial limit.
signer_groups[].limitations.financial_limit.valuenumberThe monetary value of the limit.
signer_groups[].limitations.financial_limit.currencystringThe currency code of the value (e.g. BRL, USD).
signer_groups[].limitations.observationsstringAdditional notes or comments on the interpretation or application of the rule.
signer_groups[].members[]objectThe positions that may make up the signing group.
signer_groups[].members[].positionenum: president, partner, administrator, director, manager …Position or powers. Use 'other' when it refers to a company, organisation or similar.
signer_groups[].members[].full_namestringThe full name of the individual holding the position, when identified.
signer_groups[].members[].cpfstringThe individual's CPF, when available.
signer_groups[].members[].mandate_end_datestringThe expiration date of the mandate (e.g. 'YYYY-MM-DD').
signer_groups[].members[].is_qualifiedbooleanWhether the person holding the position is identified in the document.
signer_groups[].members[].is_requiredbooleanWhether this member's presence is mandatory.
power_of_attorney_default — fields returned in analysis_result
FieldTypeDescription
grantors[]objectList of grantors (Outorgantes) — at least one required
grantors[].namestringGrantor's full name (Outorgante)
grantors[].cpfstringGrantor's CPF in XXX.XXX.XXX-XX format (for individuals)
grantors[].cnpjstringGrantor's CNPJ in XX.XXX.XXX/XXXX-XX format (for legal entities)
grantees[]objectList of grantees (Outorgados) — at least one required
grantees[].namestringGrantee's full name (Outorgado)
grantees[].cpfstringGrantee's CPF in XXX.XXX.XXX-XX format (for individuals)
grantees[].cnpjstringGrantee's CNPJ in XX.XXX.XXX/XXXX-XX format (for legal entities)
powers_grantedstringDescription of powers being granted by this Power of Attorney
power_scopestringScope or limitations of the granted powers, if specified
expiration_datestringDate when the powers expire; null means indefinite validity
is_irrevocablebooleanTrue if the Power of Attorney is explicitly stated as irrevocable
revocation_clausestringText of the revocation clause, if present
notary_namestringName of the notary office (cartório) where the document was registered
notary_registration_numberstringRegistration or book number at the notary office
notary_datestringDate of notarization at the cartório
document_datestringDate the Power of Attorney was signed
purposestringStated purpose of the Power of Attorney (e.g., represent in court, manage bank accounts)
invoice_default — fields returned in analysis_result
FieldTypeDescription
company_namestringCompany's legal name
cnpjstringBrazilian National Register of Legal Entities (CNPJ)
invoice_typeenum: Documento fiscal eletrônico de serviços, Documento fiscal eletrônico de produtoType of Nota Fiscal (Invoice) - Product or Service
taxation_typestringType of Taxation
invoice_issue_datestringDate of Invoice Issuance
invoice_numberstringInvoice Number
contracting_companystringContracting Company
invoice_descriptionstringDescription of the Invoice
invoice_valuenumberValue of the Invoice
items[]objectList of items on the invoice
items[].codestringItem Code (NCM/SH).
items[].descriptionstringItem Description
items[].quantityintegerQuantity of Item
items[].valuenumberValue of Item
rps_codestringRPS Code (Receipt for Services)
access_keystringAccess Key (chave de acesso) for invoices of products
bankslip_default — fields returned in analysis_result
FieldTypeDescription
beneficiary_cnpjstringBeneficiary's CNPJ
beneficiary_company_namestringBeneficiary's Legal Name
boleto_barcodestringBarcode of the Boleto (Payment Slip)
due_datestringDue Date
valuenumberValue of the Bill
ccb_default — fields returned in analysis_result
FieldTypeDescription
contract_numberstringCCB number
issuer_documentstringIssuer's CPF or CNPJ
issuer_cepstringIssuer's postal code (CEP)
guarantee_chassisstringChassis of the vehicle given as collateral, when applicable
invoice_total_valuenumberTotal invoice amount, when applicable
annual_interest_ratenumberFixed annual interest rate, as a percentage
financed_amountnumberTotal amount financed in the CCB
total_installmentsintegerTotal number of installments
first_due_datestringDue date of the first installment
last_due_datestringDue date of the last installment (see the payment schedule)
has_signaturebooleanWhether the document carries a valid signature, physical or digital
is_valid_contractbooleanWhether the document sent is in fact a Bank Credit Note (CCB)
portability_retention_evidence_analysis — fields returned in analysis_result
FieldTypeDescription
contract_numberstringContract number
issuer_document_numberstringBorrower's CPF
issuer_phone_numberstringBorrower's phone number
portability_numbernumberPortability number
has_signaturebooleanWhether the document, especially a CCB, contains electronic signature elements such as a hash, verification code, QR code or an authentication page.
is_valid_evidencebooleanWhether the document is an acceptable type of evidence, such as a text conversation or a Bank Credit Note (CCB).
is_confirmationbooleanWhether the evidence confirms cancellation of the portability. TRUE when the customer explicitly states cancellation or does not recognise the portability request, OR when the evidence is a signed CCB (has_signature: true). FALSE when it is not a conversation, OR the conversation does not indicate cancellation or non-recognition. This value is always TRUE or FALSE.

For analysis types not listed here, contact our support team at suporte.caas@qitech.com.br to inquire about custom implementations.

File Formats and Limits​

The document_bytes field accepts the formats below. The real file type is verified from its content, not from the extension or the declared Content-Type — sending a .jpg labelled as application/pdf results in DOC00202.

FormatMaximum sizeNotes
PDF30 MBUp to 350 pages (DOC00203). Password-protected PDFs are rejected (DOC00305).
JPEG30 MB
PNG10 MB

Responses​

Success Response (200 OK)​

For a synchronous analysis completed successfully, the API returns HTTP 200 OK with the body below. The envelope fields are always the same; what varies per document_analysis_type is the content of analysis_result.

{
"id": "request-abc-12345",
"document_analysis_type": "proof_of_address_default",
"validation_status": "valid",
"file_metadata": { "file_type": "pdf" },
"analysis_result": { "...": "extracted fields, vary per analysis type" },
"feedback_data": null
}
FieldDescription
idThe same identifier you sent in the request.
document_analysis_typeThe analysis type applied.
validation_statusValidation outcome. See the possible values below.
file_metadataMetadata of the received file, such as the detected type.
analysis_resultThe extracted data. Empty ({}) when the analysis was not completed.
feedback_dataFeedback you have registered for this document, if any.

validation_status values​

ValueMeaning
validAnalysis completed successfully.
pendingStill processing.
missing_informationThe document is missing required information.
bad_qualityDocument quality is insufficient for analysis.
invalid_dataThe document contains invalid or inconsistent data.
incorrect_document_typeThe content does not match the requested analysis type.
parsing_errorThe analysis result could not be parsed.
analysis_failedThe analysis could not be completed by the model.

Accepted Response (202 Accepted)​

If the document is processed asynchronously, the API will return an HTTP 202 Accepted status and the request will be processed asynchronously. After a short time you can retrieve the document analysis using a GET request, as described below.

Error Response (4xx)​

If there is a problem with the request or the document, the API will return a 4xx status code with a JSON body describing the error.

Error Code Reference​

The following tables list all possible error codes returned by the API. You can use these codes to implement robust error handling in your application.

Category 1: Request Errors (DOC001xx)​

CodeTitleDescription
DOC00100Missing required fieldThe request does not contain a required field in the multipart/form-data body.
DOC00101Invalid field lengthThe length of a value in a form-data field is invalid.
DOC00102Invalid content type at requestThe request Content-Type header is not multipart/form-data.
DOC00103Invalid field at requestThe request contains an unexpected or invalid field in the form-data body.

Category 2: File Processing Errors (DOC002xx)​

These errors occur when the file itself has issues that prevent its processing.

CodeTitleDescription
DOC00200Invalid Document Analysis TypeThe document_analysis_type is not valid for the document sent. (e.g. a company_statute_default analysis from a utility bill.)
DOC00201Invalid File SizeThe size of the document sent exceeds the maximum allowed limit.
DOC00202Invalid File TypeThe file could not be processed due to inconsistencies in its type or format (e.g. a .jpg file was sent with type application/pdf).
DOC00203PDF exceeds page limitThe provided PDF file contains more pages than the maximum limit allowed for processing (the current limit is 350 pages).

Category 3: Document Analysis Errors (DOC003xx)​

These errors occur during the data extraction and analysis phase, after the file has been successfully opened.

CodeTitleDescription
DOC00300Missing InformationThe document does not contain the essential information required for the analysis to be completed.
DOC00301Bad QualityThe document quality (e.g. resolution, legibility, sharpness) is too low to be analyzed accurately.
DOC00302Invalid DataThe document contains inconsistent or invalid data (e.g. incorrect checksums, contradictory fields).
DOC00303Incorrect Document TypeThe document content does not match the expected document type for the selected document_analysis_type.
DOC00304Invalid PDF FileThe provided file is not a valid or well-formed PDF and could not be opened.
DOC00305Password Protected PDFThe submitted PDF is encrypted with a password and cannot be processed.
DOC00306Parsing ErrorThe document analysis could not be processed.

Category 4: Service Failures (DOC005xx)​

These errors indicate a failure on our side, not with your document or your request. They are returned with an HTTP 5xx status and the recommended action is to retry the request.

CodeTitleHTTP StatusDescription
DOC00500Analysis Failed503The analysis could not be completed. Please try again; if the problem persists, contact support.

Retrieve a Document Analysis

You can retrieve the results of a previously submitted document analysis at any time using its unique id.

https://api.caas.qitech.app/document_analysis/document/{document_id}

Replace document_id with the same value you used for the POST request.

Register feedback for an analysis

You can register feedback about the quality of an analysis, which helps us improve the models. Send a POST to the endpoint below using the same id from the original request.

POST https://api.caas.qitech.app/document_analysis/document/{document_id}/feedback

curl -X POST "https://api.caas.qitech.app/document_analysis/document/request-abc-12345/feedback" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_date": "2026-09-02T14:30:00",
"feedback_data": { "incorrect_field": "issue_date", "correct_value": "2026-07-20" }
}'
AttributeDescription
event_date (required)Date and time of the feedback.
feedback_data (required)Free-form object with the feedback content.

The registered feedback is then returned in the feedback_data field when you retrieve the analysis. It can also be read with a GET on the same endpoint.