curl --request POST 'https://gyra-core.gyramais.com.br/v1/registry/6612a7f30000000000000001/documents/6612a7f30000000000000001/reprocess' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"stages":["VALIDATE"],"forceType":"ALTERACAO_CONTRATUAL"}'const resposta = await fetch("https://gyra-core.gyramais.com.br/v1/registry/6612a7f30000000000000001/documents/6612a7f30000000000000001/reprocess", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"stages": [
"VALIDATE"
],
"forceType": "ALTERACAO_CONTRATUAL"
}),
});
const dados = await resposta.json();
import requests
resposta = requests.post(
"https://gyra-core.gyramais.com.br/v1/registry/6612a7f30000000000000001/documents/6612a7f30000000000000001/reprocess",
headers={"Authorization": f"Bearer {token}"},
json={
"stages": [
"VALIDATE"
],
"forceType": "ALTERACAO_CONTRATUAL"
},
)
dados = resposta.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'stages' => [
'VALIDATE'
],
'forceType' => 'ALTERACAO_CONTRATUAL'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess"
payload := strings.NewReader("{\n \"stages\": [\n \"VALIDATE\"\n ],\n \"forceType\": \"ALTERACAO_CONTRATUAL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stages\": [\n \"VALIDATE\"\n ],\n \"forceType\": \"ALTERACAO_CONTRATUAL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stages\": [\n \"VALIDATE\"\n ],\n \"forceType\": \"ALTERACAO_CONTRATUAL\"\n}"
response = http.request(request)
puts response.read_body{
"documentId": "6612a7f30000000000000031",
"status": "RECEIVED",
"attempt": 2
}{
"code": 400,
"message": "each value in stages must be one of the following values: CLASSIFY, EXTRACT, VALIDATE"
}{
"code": 401,
"message": "Token de acesso inválido."
}{
"code": 403,
"message": "Você não tem permissão para acessar este recurso."
}{
"code": 404,
"message": "Documento não encontrado."
}{
"code": 409,
"message": "Este documento já foi decidido por um operador. Reprocessar vai substituir essa decisão pelo novo parecer."
}{
"code": 429,
"message": "Limite de reprocessamentos atingido."
}{
"code": 500,
"message": "Internal server error"
}{
"code": 502,
"message": "Não foi possível reprocessar o documento."
}Reprocessar Documento
A classificação errou o tipo, a régua mudou, ou a leitura merece outra tentativa.
curl --request POST 'https://gyra-core.gyramais.com.br/v1/registry/6612a7f30000000000000001/documents/6612a7f30000000000000001/reprocess' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{"stages":["VALIDATE"],"forceType":"ALTERACAO_CONTRATUAL"}'const resposta = await fetch("https://gyra-core.gyramais.com.br/v1/registry/6612a7f30000000000000001/documents/6612a7f30000000000000001/reprocess", {
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"stages": [
"VALIDATE"
],
"forceType": "ALTERACAO_CONTRATUAL"
}),
});
const dados = await resposta.json();
import requests
resposta = requests.post(
"https://gyra-core.gyramais.com.br/v1/registry/6612a7f30000000000000001/documents/6612a7f30000000000000001/reprocess",
headers={"Authorization": f"Bearer {token}"},
json={
"stages": [
"VALIDATE"
],
"forceType": "ALTERACAO_CONTRATUAL"
},
)
dados = resposta.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'stages' => [
'VALIDATE'
],
'forceType' => 'ALTERACAO_CONTRATUAL'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess"
payload := strings.NewReader("{\n \"stages\": [\n \"VALIDATE\"\n ],\n \"forceType\": \"ALTERACAO_CONTRATUAL\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stages\": [\n \"VALIDATE\"\n ],\n \"forceType\": \"ALTERACAO_CONTRATUAL\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gyra-core.gyramais.com.br/v1/registry/{id}/documents/{docId}/reprocess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stages\": [\n \"VALIDATE\"\n ],\n \"forceType\": \"ALTERACAO_CONTRATUAL\"\n}"
response = http.request(request)
puts response.read_body{
"documentId": "6612a7f30000000000000031",
"status": "RECEIVED",
"attempt": 2
}{
"code": 400,
"message": "each value in stages must be one of the following values: CLASSIFY, EXTRACT, VALIDATE"
}{
"code": 401,
"message": "Token de acesso inválido."
}{
"code": 403,
"message": "Você não tem permissão para acessar este recurso."
}{
"code": 404,
"message": "Documento não encontrado."
}{
"code": 409,
"message": "Este documento já foi decidido por um operador. Reprocessar vai substituir essa decisão pelo novo parecer."
}{
"code": 429,
"message": "Limite de reprocessamentos atingido."
}{
"code": 500,
"message": "Internal server error"
}{
"code": 502,
"message": "Não foi possível reprocessar o documento."
}Quando usar
A classificação errou o tipo, a régua mudou, ou a leitura merece outra tentativa.Reprocessar não cobra de novo
A cobrança é por documento, não por tentativa. Semstages, roda o pipeline inteiro. Com um subconjunto de CLASSIFY, EXTRACT e VALIDATE, as etapas de fora reaproveitam a tentativa anterior. Confira stages.executed e stages.reused no resultado.
forceType corrige uma classificação errada. Como ele afirma o tipo, a conferência EXPECTED_TYPE_MATCH sai SKIP naquela tentativa.
Dois limites
- Documento que um operador já decidiu responde
409. MandeoverrideFeedback: truepara substituir a decisão pelo parecer novo. - Cada documento aceita até 5 tentativas. Depois disso, a resposta é
429comLimite de reprocessamentos atingido.
202 traz documentId, status (RECEIVED) e attempt, a tentativa que acabou de começar.
Authorizations
Enter JWT token
Body
Força o tipo documental (corrige uma classificação errada) e, com isso, dispensa a etapa de classificação.
CONTRATO_SOCIAL, ALTERACAO_CONTRATUAL, ESTATUTO_SOCIAL, REQUERIMENTO_EMPRESARIO, PROCURACAO_PJ, IRPJ_ECF, DECLARACAO_FATURAMENTO, CERTIDAO_JUNTA, ATA_ASSEMBLEIA, DOC_IDENTIDADE, COMPROVANTE_RESIDENCIA, DIRPF, COMPROVANTE_RENDA, CERTIDAO_PF, PROCURACAO_PF, FORA_DE_ESCOPO, NAO_IDENTIFICADO, CERTIDAO_PGFN_PJ, CERTIDAO_FGTS, CADIN_FEDERAL, CADIN_ESTADUAL, CERTIDAO_QSA, CERTIFICADO_SIMPLES_NACIONAL, ESOCIAL_PJ, COMPROVACAO_ESTADO_CIVIL, DEMONSTRACOES_FINANCEIRAS, EXTRATO_BANCARIO Etapas a reexecutar. Omitir significa reprocessar tudo (classificar, extrair e validar). Cada etapa de fora da lista é pulada e o resultado da tentativa anterior é reaproveitado, o que aparece no resultado do documento em stages.reused. Pular EXTRACT exige tentativa anterior com extração gravada: sem ela a etapa roda normalmente, nunca devolvendo resultado vazio. Reexecutar EXTRACT força a revalidação mesmo que VALIDATE não esteja na lista: parecer antigo sobre extração nova seria mentira.
CLASSIFY, EXTRACT, VALIDATE ["VALIDATE"]
Webhook chamado quando o reprocessamento terminar.
Confirma a substituição da decisão que um operador já tomou sobre o parecer. Sem ela, documento já decidido recusa o reprocessamento com 409: a decisão humana não pode ser apagada em silêncio pelo parecer da tentativa nova.

