curl --request GET 'https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000?type=REPORT&exportFormat=pdf' \
--header 'Authorization: Bearer SEU_TOKEN'
curl --request GET 'https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000?type=REPORT§ionOrder=LOCATION§ionOrder=SUMMARY§ionOrder=PEFIN' \
--header 'Authorization: Bearer SEU_TOKEN'
const url = new URL("https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000");
url.searchParams.set("type", "REPORT");
url.searchParams.set("exportFormat", "pdf");
const resposta = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
const { url: link } = await resposta.json();
import requests
resposta = requests.get(
"https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000",
headers={"Authorization": f"Bearer {token}"},
params={"type": "REPORT", "exportFormat": "pdf"},
timeout=360,
)
link = resposta.json()["url"]
{
"id": "6612a7f32b77480800000000",
"createdAt": "2026-07-31T18:03:37.465Z",
"updatedAt": "2026-07-31T18:03:37.465Z",
"userId": "6612a7f3615ff3f200000000",
"organizationId": "6612a7f3fa9e086b00000000",
"typeId": "6612a7f371f08b3400000000",
"url": "https://exemplo.gyramais.com.br/relatorio.pdf",
"payload": {
"reportId": "6612a7f3a19b467000000000",
"type": "PDFMAKE",
"generatedAt": "2026-07-31T18:03:37.464Z"
}
}
{
"code": 400,
"message": "type must be one of the following values: REPORT, REPORT_MINIFIED,type should not be empty"
}
Referência da API
Exportar Relatório (Síncrono)
Gera o PDF ou o Excel do relatório e devolve o link na mesma resposta.
GET
/
report
/
export-sync
/
{id}
curl --request GET 'https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000?type=REPORT&exportFormat=pdf' \
--header 'Authorization: Bearer SEU_TOKEN'
curl --request GET 'https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000?type=REPORT§ionOrder=LOCATION§ionOrder=SUMMARY§ionOrder=PEFIN' \
--header 'Authorization: Bearer SEU_TOKEN'
const url = new URL("https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000");
url.searchParams.set("type", "REPORT");
url.searchParams.set("exportFormat", "pdf");
const resposta = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
const { url: link } = await resposta.json();
import requests
resposta = requests.get(
"https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000",
headers={"Authorization": f"Bearer {token}"},
params={"type": "REPORT", "exportFormat": "pdf"},
timeout=360,
)
link = resposta.json()["url"]
{
"id": "6612a7f32b77480800000000",
"createdAt": "2026-07-31T18:03:37.465Z",
"updatedAt": "2026-07-31T18:03:37.465Z",
"userId": "6612a7f3615ff3f200000000",
"organizationId": "6612a7f3fa9e086b00000000",
"typeId": "6612a7f371f08b3400000000",
"url": "https://exemplo.gyramais.com.br/relatorio.pdf",
"payload": {
"reportId": "6612a7f3a19b467000000000",
"type": "PDFMAKE",
"generatedAt": "2026-07-31T18:03:37.464Z"
}
}
{
"code": 400,
"message": "type must be one of the following values: REPORT, REPORT_MINIFIED,type should not be empty"
}
Quando usar
Use esta rota quando você quer o link do arquivo na própria resposta. A chamada só volta depois que o arquivo está pronto, então use um timeout generoso no seu cliente HTTP. Para não segurar a conexão, ou para gerar PDF e Excel juntos, use Exportar Relatório (Assíncrono).Autenticação
Bearer JWT no headerAuthorization.
Parâmetros
| Nome | Local | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
id | path | string | sim | ID do relatório. |
type | query | string | sim | REPORT ou REPORT_MINIFIED. Use REPORT. Sem o parâmetro, a resposta é 400. |
exportFormat | query | string | não | pdf (padrão) ou excel. Nesta rota, both não gera arquivo e responde erro: use a rota assíncrona. |
sectionOrder | query | string[] | não | Seções do arquivo, na ordem desejada. Repita o parâmetro para cada seção. Só as seções listadas entram. |
templateId | query | string | não | ID de um modelo de exportação da organização. |
systemTemplate | query | string | não | Modelo nativo: COMPLETE ou COMPACT. |
sectionOrder, valem as seções e a ordem do modelo (o escolhido, senão o padrão da organização, senão o do sistema).
Resposta
A resposta é o registro da exportação. O link está emurl.
| Campo | Descrição |
|---|---|
url | Link do arquivo gerado. |
payload.reportId | Relatório exportado. |
payload.type | PDFMAKE para PDF, EXCEL para Excel. |
payload.generatedAt | Quando o arquivo foi gerado. |
id, userId, organizationId, typeId, createdAt, updatedAt | Metadados do registro. |
exportUrl (PDF) ou exportExcelUrl (Excel). O link do Excel expira em 7 dias.
curl --request GET 'https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000?type=REPORT&exportFormat=pdf' \
--header 'Authorization: Bearer SEU_TOKEN'
curl --request GET 'https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000?type=REPORT§ionOrder=LOCATION§ionOrder=SUMMARY§ionOrder=PEFIN' \
--header 'Authorization: Bearer SEU_TOKEN'
const url = new URL("https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000");
url.searchParams.set("type", "REPORT");
url.searchParams.set("exportFormat", "pdf");
const resposta = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
const { url: link } = await resposta.json();
import requests
resposta = requests.get(
"https://gyra-core.gyramais.com.br/report/export-sync/6612a7f3a19b467000000000",
headers={"Authorization": f"Bearer {token}"},
params={"type": "REPORT", "exportFormat": "pdf"},
timeout=360,
)
link = resposta.json()["url"]
{
"id": "6612a7f32b77480800000000",
"createdAt": "2026-07-31T18:03:37.465Z",
"updatedAt": "2026-07-31T18:03:37.465Z",
"userId": "6612a7f3615ff3f200000000",
"organizationId": "6612a7f3fa9e086b00000000",
"typeId": "6612a7f371f08b3400000000",
"url": "https://exemplo.gyramais.com.br/relatorio.pdf",
"payload": {
"reportId": "6612a7f3a19b467000000000",
"type": "PDFMAKE",
"generatedAt": "2026-07-31T18:03:37.464Z"
}
}
{
"code": 400,
"message": "type must be one of the following values: REPORT, REPORT_MINIFIED,type should not be empty"
}
A rota responde
202 mesmo no sucesso, com o arquivo já pronto. Trate 202 com url preenchida como sucesso. Um relatório inexistente ou de outra organização não gera arquivo e responde erro.Query Parameters
Response
Registro da exportacao, com o arquivo ja pronto. O link esta em url.

