curl --request POST \
--url https://bc-correios.sandbox.lerian.net/api/v1/correios/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency: <x-idempotency>' \
--data '
{
"aiApiKey": "<string>",
"aiEndpoint": "<string>",
"aiModel": "gpt-4o-mini",
"aiProvider": "openai",
"aiSystemPrompt": "<string>",
"bcbPassword": "<string>",
"bcbUsername": "<string>",
"defaultDestination": "DEINF",
"pollingIntervalMinutes": 15,
"retentionDays": 1825
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bc-correios.sandbox.lerian.net/api/v1/correios/settings"
payload := strings.NewReader("{\n \"aiApiKey\": \"<string>\",\n \"aiEndpoint\": \"<string>\",\n \"aiModel\": \"gpt-4o-mini\",\n \"aiProvider\": \"openai\",\n \"aiSystemPrompt\": \"<string>\",\n \"bcbPassword\": \"<string>\",\n \"bcbUsername\": \"<string>\",\n \"defaultDestination\": \"DEINF\",\n \"pollingIntervalMinutes\": 15,\n \"retentionDays\": 1825\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency", "<x-idempotency>")
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: {
'X-Idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
aiApiKey: '<string>',
aiEndpoint: '<string>',
aiModel: 'gpt-4o-mini',
aiProvider: 'openai',
aiSystemPrompt: '<string>',
bcbPassword: '<string>',
bcbUsername: '<string>',
defaultDestination: 'DEINF',
pollingIntervalMinutes: 15,
retentionDays: 1825
})
};
fetch('https://bc-correios.sandbox.lerian.net/api/v1/correios/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://bc-correios.sandbox.lerian.net/api/v1/correios/settings"
payload = {
"aiApiKey": "<string>",
"aiEndpoint": "<string>",
"aiModel": "gpt-4o-mini",
"aiProvider": "openai",
"aiSystemPrompt": "<string>",
"bcbPassword": "<string>",
"bcbUsername": "<string>",
"defaultDestination": "DEINF",
"pollingIntervalMinutes": 15,
"retentionDays": 1825
}
headers = {
"X-Idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"hasAiApiKey": true,
"hasBcbCredentials": true,
"pollingIntervalMinutes": 15,
"retentionDays": 1825,
"tenantId": "c7aab4e8-1234-5678-9abc-def012345678",
"updatedAt": "<string>",
"aiEndpoint": "<string>",
"aiModel": "<string>",
"aiProvider": "<string>",
"aiSystemPrompt": "<string>",
"defaultDestination": "DEINF"
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}Create tenant settings
Creates initial tenant settings. Returns 409 Conflict (BCC-0006) if settings already exist — use PATCH to update.
curl --request POST \
--url https://bc-correios.sandbox.lerian.net/api/v1/correios/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency: <x-idempotency>' \
--data '
{
"aiApiKey": "<string>",
"aiEndpoint": "<string>",
"aiModel": "gpt-4o-mini",
"aiProvider": "openai",
"aiSystemPrompt": "<string>",
"bcbPassword": "<string>",
"bcbUsername": "<string>",
"defaultDestination": "DEINF",
"pollingIntervalMinutes": 15,
"retentionDays": 1825
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bc-correios.sandbox.lerian.net/api/v1/correios/settings"
payload := strings.NewReader("{\n \"aiApiKey\": \"<string>\",\n \"aiEndpoint\": \"<string>\",\n \"aiModel\": \"gpt-4o-mini\",\n \"aiProvider\": \"openai\",\n \"aiSystemPrompt\": \"<string>\",\n \"bcbPassword\": \"<string>\",\n \"bcbUsername\": \"<string>\",\n \"defaultDestination\": \"DEINF\",\n \"pollingIntervalMinutes\": 15,\n \"retentionDays\": 1825\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency", "<x-idempotency>")
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: {
'X-Idempotency': '<x-idempotency>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
aiApiKey: '<string>',
aiEndpoint: '<string>',
aiModel: 'gpt-4o-mini',
aiProvider: 'openai',
aiSystemPrompt: '<string>',
bcbPassword: '<string>',
bcbUsername: '<string>',
defaultDestination: 'DEINF',
pollingIntervalMinutes: 15,
retentionDays: 1825
})
};
fetch('https://bc-correios.sandbox.lerian.net/api/v1/correios/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://bc-correios.sandbox.lerian.net/api/v1/correios/settings"
payload = {
"aiApiKey": "<string>",
"aiEndpoint": "<string>",
"aiModel": "gpt-4o-mini",
"aiProvider": "openai",
"aiSystemPrompt": "<string>",
"bcbPassword": "<string>",
"bcbUsername": "<string>",
"defaultDestination": "DEINF",
"pollingIntervalMinutes": 15,
"retentionDays": 1825
}
headers = {
"X-Idempotency": "<x-idempotency>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"hasAiApiKey": true,
"hasBcbCredentials": true,
"pollingIntervalMinutes": 15,
"retentionDays": 1825,
"tenantId": "c7aab4e8-1234-5678-9abc-def012345678",
"updatedAt": "<string>",
"aiEndpoint": "<string>",
"aiModel": "<string>",
"aiProvider": "<string>",
"aiSystemPrompt": "<string>",
"defaultDestination": "DEINF"
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}{
"correlationId": "req-7a3f9c2e",
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"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"
}
}Autorizaciones
JWT bearer token issued by the identity provider.
Encabezados
Idempotency key for safe retries
Cuerpo
AI provider API key (encrypted at rest). At most 500 characters.
500AI API endpoint URL, at most 500 characters. Must be HTTPS and must not resolve to a private or loopback address; "" clears it. Those two rules need DNS, so the service applies them and answers 400 BCC-0001.
500AI model identifier. At most 100 characters.
100"gpt-4o-mini"
AI provider. One of openai, anthropic, gemini, or "" to clear it (AI not configured). Brand names such as ChatGPT are refused.
openai, anthropic, gemini, "openai"
Per-tenant AI system prompt. At most 2000 characters.
2000BCB Sisbacen password (encrypted at rest). At most 255 characters.
255BCB Sisbacen username (encrypted at rest). At most 255 characters.
255Default BCB destination code. At most 50 characters.
50"DEINF"
BCB polling interval in minutes.
5, 15, 30, 60 15
Mail retention in days (min 1825 = 5y, max 36500 = 100y).
1825 <= x <= 365001825
Respuesta
Created
15
1825
"c7aab4e8-1234-5678-9abc-def012345678"
"DEINF"
¿Esta página le ayudó?

