Skip to main content
POST
/
reports
cURL
curl --request POST \
  --url https://api.base39.com.br/v2/reports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target": {
    "document": "12345678901"
  },
  "template": "tpl_abc123def456"
}
'
{
  "id": "rep_xyz789",
  "uploadUrl": "https://s3.amazonaws.com/bucket/file.pdf?signature=...",
  "status": "pending",
  "target": {
    "document": "12345678901",
    "name": "Empresa Exemplo LTDA",
    "alternativeName": "Exemplo Corp"
  },
  "template": "tpl_abc123def456",
  "sections": [
    {
      "id": "sec_abc123",
      "title": "Resumo Executivo",
      "status": "queued",
      "order": 1,
      "content": null
    },
    {
      "id": "sec_def456",
      "title": "Análise Detalhada",
      "status": "queued",
      "order": 2,
      "content": null
    }
  ],
  "createdAt": "2025-01-15T10:30:00Z",
  "updatedAt": "2025-01-15T10:30:00Z",
  "createdBy": "usr_123",
  "updatedBy": "usr_123"
}

Documentation Index

Fetch the complete documentation index at: https://docs.base39.com.br/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Dados do relatório a ser criado

target
object
required
template
string
required

ID do template no formato tpl_$nanoid

Pattern: ^tpl_[a-zA-Z0-9_-]+$
Example:

"tpl_abc123def456"

Response

200 - application/json

Relatório criado com sucesso

id
string

ID do relatório

uploadUrl
string

URL S3 assinada para upload

status
enum<string>

Status do relatório

Available options:
pending,
processing,
completed,
error
target
object
template
string
sections
object[]

Seções do relatório com conteúdo estruturado

Example:
[
{
"id": "sec_abc123",
"title": "Resumo Executivo",
"status": "done",
"order": 1,
"content": "Este relatório apresenta uma análise completa..."
},
{
"id": "sec_def456",
"title": "Análise Detalhada",
"status": "processing",
"order": 2,
"content": null
}
]
createdAt
string<date-time>
updatedAt
string<date-time>
createdBy
string
updatedBy
string