curl --request GET \
--url https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachmentsimport requests
url = "https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments', 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.attachment.v2.portao3.com.br/realms/{realmId}/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3f6c2a1e-8b4d-4f7a-9c2e-5d1b7a9e4c60",
"realmId": "f495ff0c-ab54-4f99-8e92-ca8682e4de9b",
"organizationId": "c4bd3f21-dfbd-44e8-8055-68ba15bed410",
"status": "AVAILABLE",
"name": "cupom-fiscal-posto.jpg",
"contentType": "image/jpeg",
"ai": {
"status": "DONE",
"executedAt": "2026-10-15T14:32:41.000Z",
"modelId": "doc-analysis-2026-09",
"error": "<string>"
},
"thumbnail": {
"status": "DONE",
"data": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/",
"contentType": "image/jpeg",
"width": 96,
"height": 96,
"sizeBytes": 3104,
"generatedAt": "2026-10-15T14:32:20.000Z",
"error": "<string>"
},
"fiscal": {
"status": "DONE",
"executedAt": "2026-10-15T14:32:58.000Z",
"modelId": "doc-analysis-2026-09",
"error": "<string>"
},
"createdBy": "e3553bc1-5e20-4e17-b22a-a796fda0aa99",
"sizeBytes": 2457600,
"image": {
"width": 3024,
"height": 4032,
"format": "jpg",
"pageCount": 123
},
"summary": "Cupom fiscal eletrônico (NFC-e) do Posto Exemplo Ltda., de 15/10/2026: 40 litros de gasolina comum, total de R$ 250,00, pago com cartão de crédito.",
"contents": [
"Emitente: Posto Exemplo Ltda., CNPJ 11.222.333/0001-81"
],
"extractedReceipt": {
"type": "NFCE",
"accessKey": "35261011222333000181650010000042131384617292",
"model": "65",
"number": "4213",
"series": "1",
"environment": "LIVE",
"currency": "986",
"status": "UNKNOWN",
"issuedAt": "2026-10-15T08:47:12-03:00",
"issuer": {
"type": "COMPANY",
"name": "Posto Exemplo Ltda.",
"tradeName": "Posto Exemplo Centro",
"federalDocument": "11222333000181",
"stateDocument": "123456789110",
"address": {
"street": "Avenida Exemplo",
"number": "1000",
"neighbourhood": "Bela Vista",
"city": "São Paulo",
"cityCode": 3550308,
"state": "SP",
"stateCode": 35,
"postalCode": "01310100",
"country": "Brasil",
"countryCode": "1058"
}
},
"recipientRole": "CONSUMER",
"isFinalConsumer": true,
"amounts": {
"totalValue": 25000,
"productsValue": 25000,
"discounts": 0,
"approximateTax": 8130
},
"taxes": {
"approximateFederal": 2950,
"approximateState": 5180
},
"items": [
{
"sequence": 1,
"code": "1",
"description": "GASOLINA COMUM",
"ncm": "27101259",
"cfop": "5656",
"unit": "L",
"quantity": 40,
"unitPrice": "6.25",
"total": 25000
}
],
"itemCount": 1,
"payments": [
{
"method": "CREDIT_CARD",
"label": "Cartão de crédito",
"amount": 25000,
"cardBrand": "Visa"
}
],
"source": {
"provider": "AI_EXTRACTION",
"retrievedAt": "2026-10-15T14:32:58.000Z",
"completeness": "FULL",
"confidence": 0.93,
"modelId": "doc-analysis-2026-09"
}
},
"createdAt": "2026-10-15T14:31:05.000Z",
"updatedAt": "2026-10-15T14:32:58.000Z",
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": "<string>"
}
],
"next": "NjcxMWI0YzBkOGUxYTMwMDEyYjdjOWYy"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "ATTACHMENT_REALM_ADMIN_REQUIRED",
"origin": "ATTACHMENT",
"message": "Realm admin required"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "ATTACHMENT",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "ids",
"message": "Too big: expected array to have <=100 items",
"code": "IDS_MAX"
}
]
}List realm attachments
Lists the attachments of every organization in your realm, newest first.
curl --request GET \
--url https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachmentsimport requests
url = "https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments', 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.attachment.v2.portao3.com.br/realms/{realmId}/attachments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attachment.v2.portao3.com.br/realms/{realmId}/attachments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3f6c2a1e-8b4d-4f7a-9c2e-5d1b7a9e4c60",
"realmId": "f495ff0c-ab54-4f99-8e92-ca8682e4de9b",
"organizationId": "c4bd3f21-dfbd-44e8-8055-68ba15bed410",
"status": "AVAILABLE",
"name": "cupom-fiscal-posto.jpg",
"contentType": "image/jpeg",
"ai": {
"status": "DONE",
"executedAt": "2026-10-15T14:32:41.000Z",
"modelId": "doc-analysis-2026-09",
"error": "<string>"
},
"thumbnail": {
"status": "DONE",
"data": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/",
"contentType": "image/jpeg",
"width": 96,
"height": 96,
"sizeBytes": 3104,
"generatedAt": "2026-10-15T14:32:20.000Z",
"error": "<string>"
},
"fiscal": {
"status": "DONE",
"executedAt": "2026-10-15T14:32:58.000Z",
"modelId": "doc-analysis-2026-09",
"error": "<string>"
},
"createdBy": "e3553bc1-5e20-4e17-b22a-a796fda0aa99",
"sizeBytes": 2457600,
"image": {
"width": 3024,
"height": 4032,
"format": "jpg",
"pageCount": 123
},
"summary": "Cupom fiscal eletrônico (NFC-e) do Posto Exemplo Ltda., de 15/10/2026: 40 litros de gasolina comum, total de R$ 250,00, pago com cartão de crédito.",
"contents": [
"Emitente: Posto Exemplo Ltda., CNPJ 11.222.333/0001-81"
],
"extractedReceipt": {
"type": "NFCE",
"accessKey": "35261011222333000181650010000042131384617292",
"model": "65",
"number": "4213",
"series": "1",
"environment": "LIVE",
"currency": "986",
"status": "UNKNOWN",
"issuedAt": "2026-10-15T08:47:12-03:00",
"issuer": {
"type": "COMPANY",
"name": "Posto Exemplo Ltda.",
"tradeName": "Posto Exemplo Centro",
"federalDocument": "11222333000181",
"stateDocument": "123456789110",
"address": {
"street": "Avenida Exemplo",
"number": "1000",
"neighbourhood": "Bela Vista",
"city": "São Paulo",
"cityCode": 3550308,
"state": "SP",
"stateCode": 35,
"postalCode": "01310100",
"country": "Brasil",
"countryCode": "1058"
}
},
"recipientRole": "CONSUMER",
"isFinalConsumer": true,
"amounts": {
"totalValue": 25000,
"productsValue": 25000,
"discounts": 0,
"approximateTax": 8130
},
"taxes": {
"approximateFederal": 2950,
"approximateState": 5180
},
"items": [
{
"sequence": 1,
"code": "1",
"description": "GASOLINA COMUM",
"ncm": "27101259",
"cfop": "5656",
"unit": "L",
"quantity": 40,
"unitPrice": "6.25",
"total": 25000
}
],
"itemCount": 1,
"payments": [
{
"method": "CREDIT_CARD",
"label": "Cartão de crédito",
"amount": 25000,
"cardBrand": "Visa"
}
],
"source": {
"provider": "AI_EXTRACTION",
"retrievedAt": "2026-10-15T14:32:58.000Z",
"completeness": "FULL",
"confidence": 0.93,
"modelId": "doc-analysis-2026-09"
}
},
"createdAt": "2026-10-15T14:31:05.000Z",
"updatedAt": "2026-10-15T14:32:58.000Z",
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": "<string>"
}
],
"next": "NjcxMWI0YzBkOGUxYTMwMDEyYjdjOWYy"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "ATTACHMENT_REALM_ADMIN_REQUIRED",
"origin": "ATTACHMENT",
"message": "Realm admin required"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "ATTACHMENT",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "ids",
"message": "Too big: expected array to have <=100 items",
"code": "IDS_MAX"
}
]
}organizationId it belongs to.
Deleted attachments are left out unless status asks for them. Filter by ID, by name or by the automatic summary; a list parameter takes comma-separated values (?status=AVAILABLE,DELETED). Paginated — see Pagination.Path Parameters
ID of your realm.
Format: UUID
Query Parameters
Only the attachments with these IDs. Sent but empty, it matches no attachment.
Example (comma-separated list): ?ids=3f6c2a1e-8b4d-4f7a-9c2e-5d1b7a9e4c60,4bb31747-6c7f-44d2-8e7d-21b1ef129ea6
100Only attachments whose name contains this text (case-insensitive).
256Only attachments whose summary contains this text (case-insensitive).
256Only attachments whose name or summary contains this text (case-insensitive).
256Only attachments in one of these statuses. Without it, every attachment except the DELETED ones is listed.
Example (comma-separated list): ?status=AVAILABLE,PENDING_UPLOAD
PENDING_UPLOAD, AVAILABLE, DELETED Cursor returned as next by the previous page. Omit for the first page.
Page size, 1–100. Defaults to 15 — or, when you send more than 15 distinct ids, to their number, so one page holds every match.
1 <= x <= 100