curl --request PATCH \
--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("PATCH", 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: 'PATCH',
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.patch(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"
}
}Update tenant settings
Partially updates tenant settings. Only provided fields are updated; send an empty string to clear an encrypted credential field.
curl --request PATCH \
--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("PATCH", 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: 'PATCH',
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.patch(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"
}
}Autorizaciones
JWT bearer token issued by the identity provider.
Encabezados
Idempotency key for safe retries
Cuerpo
AI provider API key, at most 500 characters (send "" to clear).
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, at most 255 characters (send "" to clear).
255BCB Sisbacen username, at most 255 characters (send "" to clear).
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
OK
15
1825
"c7aab4e8-1234-5678-9abc-def012345678"
"DEINF"
¿Esta página le ayudó?

