curl --request POST \
--url http://localhost:4005/v1/regulatory/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"documentId": "br.bcb.cadoc-4010",
"institution": "00000000-0000-0000-0000-000000000000",
"version": "1.0.0"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:4005/v1/regulatory/subscriptions"
payload := strings.NewReader("{\n \"documentId\": \"br.bcb.cadoc-4010\",\n \"institution\": \"00000000-0000-0000-0000-000000000000\",\n \"version\": \"1.0.0\"\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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
documentId: 'br.bcb.cadoc-4010',
institution: '00000000-0000-0000-0000-000000000000',
version: '1.0.0'
})
};
fetch('http://localhost:4005/v1/regulatory/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:4005/v1/regulatory/subscriptions"
payload = {
"documentId": "br.bcb.cadoc-4010",
"institution": "00000000-0000-0000-0000-000000000000",
"version": "1.0.0"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"readiness": {
"contractVersion": "<string>",
"document": "<string>",
"queries": [
{
"columnsChecked": true,
"query": "<string>",
"status": "<string>",
"columns": [
{
"column": "<string>",
"found": true
}
],
"composedOver": "<string>",
"dataSource": "<string>",
"detail": "<string>",
"resolvedTable": "<string>",
"table": "<string>"
}
],
"gaps": [
{
"field": "saldos_cosif.valor",
"reason": "a consulta mapeada não devolve esta coluna",
"required": true
}
],
"startedFrom": "<string>",
"unsupported": [
"<string>"
]
},
"subscription": {
"adoptedVersion": "1.0.0",
"adoptionHistory": [
{
"adoptedAt": "2026-01-01T00:00:00Z",
"adoptedBy": "operator@bank.example",
"version": "1.1.0",
"supersedes": "1.0.0"
}
],
"bindingVersion": 3,
"createdAt": "2026-01-01T00:00:00Z",
"documentId": "br.bcb.cadoc-4010",
"id": "00000000-0000-0000-0000-000000000000",
"status": "active",
"updatedAt": "2026-01-01T00:00:00Z",
"version": 1,
"deactivatedAt": "2026-01-01T00:00:00Z",
"deactivatedBy": "acme/00000000-0000-0000-0000-000000000000",
"institutionId": "00000000-0000-0000-0000-000000000000",
"reactivatedAt": "2026-01-01T00:00:00Z",
"reactivatedBy": "acme/00000000-0000-0000-0000-000000000000"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Activate a regulatory document
Activates a document for this tenant, pinning the catalog version in force today, and writes the starting binding — the catalog’s reference mapping when one is published, and an empty one when none is. The answer carries the readiness of that starting point: which tables and columns it already finds, and which fields nothing fills yet. A document already activated is refused with a conflict.
curl --request POST \
--url http://localhost:4005/v1/regulatory/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"documentId": "br.bcb.cadoc-4010",
"institution": "00000000-0000-0000-0000-000000000000",
"version": "1.0.0"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:4005/v1/regulatory/subscriptions"
payload := strings.NewReader("{\n \"documentId\": \"br.bcb.cadoc-4010\",\n \"institution\": \"00000000-0000-0000-0000-000000000000\",\n \"version\": \"1.0.0\"\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))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
documentId: 'br.bcb.cadoc-4010',
institution: '00000000-0000-0000-0000-000000000000',
version: '1.0.0'
})
};
fetch('http://localhost:4005/v1/regulatory/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:4005/v1/regulatory/subscriptions"
payload = {
"documentId": "br.bcb.cadoc-4010",
"institution": "00000000-0000-0000-0000-000000000000",
"version": "1.0.0"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"readiness": {
"contractVersion": "<string>",
"document": "<string>",
"queries": [
{
"columnsChecked": true,
"query": "<string>",
"status": "<string>",
"columns": [
{
"column": "<string>",
"found": true
}
],
"composedOver": "<string>",
"dataSource": "<string>",
"detail": "<string>",
"resolvedTable": "<string>",
"table": "<string>"
}
],
"gaps": [
{
"field": "saldos_cosif.valor",
"reason": "a consulta mapeada não devolve esta coluna",
"required": true
}
],
"startedFrom": "<string>",
"unsupported": [
"<string>"
]
},
"subscription": {
"adoptedVersion": "1.0.0",
"adoptionHistory": [
{
"adoptedAt": "2026-01-01T00:00:00Z",
"adoptedBy": "operator@bank.example",
"version": "1.1.0",
"supersedes": "1.0.0"
}
],
"bindingVersion": 3,
"createdAt": "2026-01-01T00:00:00Z",
"documentId": "br.bcb.cadoc-4010",
"id": "00000000-0000-0000-0000-000000000000",
"status": "active",
"updatedAt": "2026-01-01T00:00:00Z",
"version": 1,
"deactivatedAt": "2026-01-01T00:00:00Z",
"deactivatedBy": "acme/00000000-0000-0000-0000-000000000000",
"institutionId": "00000000-0000-0000-0000-000000000000",
"reactivatedAt": "2026-01-01T00:00:00Z",
"reactivatedBy": "acme/00000000-0000-0000-0000-000000000000"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "body.templateId",
"message": "expected string to match 'uuid' format",
"value": "not-a-uuid"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}Autorizações
JWT bearer token issued by the identity provider.
Corpo
Document to activate, as the catalog publishes it.
"br.bcb.cadoc-4010"
Institution that files the document. Omitted, the tenant's only institution files it; with none or several the request is refused. "all" is refused: a filing declares one institution.
"00000000-0000-0000-0000-000000000000"
Document version to pin; omitted pins the newest the origin publishes.
"1.0.0"
Esta página foi útil?

