Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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"
}
'import requests
url = "https://api.base39.com.br/v2/reports"
payload = {
"target": { "document": "12345678901" },
"template": "tpl_abc123def456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target: {document: '12345678901'}, template: 'tpl_abc123def456'})
};
fetch('https://api.base39.com.br/v2/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.base39.com.br/v2/reports",
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([
'target' => [
'document' => '12345678901'
],
'template' => 'tpl_abc123def456'
]),
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://api.base39.com.br/v2/reports"
payload := strings.NewReader("{\n \"target\": {\n \"document\": \"12345678901\"\n },\n \"template\": \"tpl_abc123def456\"\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://api.base39.com.br/v2/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"document\": \"12345678901\"\n },\n \"template\": \"tpl_abc123def456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.base39.com.br/v2/reports")
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 \"target\": {\n \"document\": \"12345678901\"\n },\n \"template\": \"tpl_abc123def456\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}Cria um novo relatório com base em um template
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"
}
'import requests
url = "https://api.base39.com.br/v2/reports"
payload = {
"target": { "document": "12345678901" },
"template": "tpl_abc123def456"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({target: {document: '12345678901'}, template: 'tpl_abc123def456'})
};
fetch('https://api.base39.com.br/v2/reports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.base39.com.br/v2/reports",
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([
'target' => [
'document' => '12345678901'
],
'template' => 'tpl_abc123def456'
]),
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://api.base39.com.br/v2/reports"
payload := strings.NewReader("{\n \"target\": {\n \"document\": \"12345678901\"\n },\n \"template\": \"tpl_abc123def456\"\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://api.base39.com.br/v2/reports")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"document\": \"12345678901\"\n },\n \"template\": \"tpl_abc123def456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.base39.com.br/v2/reports")
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 \"target\": {\n \"document\": \"12345678901\"\n },\n \"template\": \"tpl_abc123def456\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}The access token received from the authorization server in the OAuth 2.0 flow.
Dados do relatório a ser criado
Relatório criado com sucesso
ID do relatório
URL S3 assinada para upload
Status do relatório
pending, processing, completed, error Show child attributes
Seções do relatório com conteúdo estruturado
Show child attributes
[
{
"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
}
]