Update settings
curl --request PATCH \
--url https://api.example.com/api/v1/correios/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedVersion": 3,
"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://api.example.com/api/v1/correios/settings"
payload := strings.NewReader("{\n \"expectedVersion\": 3,\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("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: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedVersion: 3,
aiApiKey: '<string>',
aiEndpoint: '<string>',
aiModel: 'gpt-4o-mini',
aiProvider: 'openai',
aiSystemPrompt: '<string>',
bcbPassword: '<string>',
bcbUsername: '<string>',
defaultDestination: 'DEINF',
pollingIntervalMinutes: 15,
retentionDays: 1825
})
};
fetch('https://api.example.com/api/v1/correios/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/api/v1/correios/settings"
payload = {
"expectedVersion": 3,
"aiApiKey": "<string>",
"aiEndpoint": "<string>",
"aiModel": "gpt-4o-mini",
"aiProvider": "openai",
"aiSystemPrompt": "<string>",
"bcbPassword": "<string>",
"bcbUsername": "<string>",
"defaultDestination": "DEINF",
"pollingIntervalMinutes": 15,
"retentionDays": 1825
}
headers = {
"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,
"updatedAt": "<string>",
"version": 3,
"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"
}
}{
"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 settings
Partially updates the settings at expectedVersion, the version the operator edited; a stale version answers 409 BCC-0013. Only provided fields are updated; send an empty string to clear an encrypted credential field.
PATCH
/
api
/
v1
/
correios
/
settings
Update settings
curl --request PATCH \
--url https://api.example.com/api/v1/correios/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedVersion": 3,
"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://api.example.com/api/v1/correios/settings"
payload := strings.NewReader("{\n \"expectedVersion\": 3,\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("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: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expectedVersion: 3,
aiApiKey: '<string>',
aiEndpoint: '<string>',
aiModel: 'gpt-4o-mini',
aiProvider: 'openai',
aiSystemPrompt: '<string>',
bcbPassword: '<string>',
bcbUsername: '<string>',
defaultDestination: 'DEINF',
pollingIntervalMinutes: 15,
retentionDays: 1825
})
};
fetch('https://api.example.com/api/v1/correios/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.example.com/api/v1/correios/settings"
payload = {
"expectedVersion": 3,
"aiApiKey": "<string>",
"aiEndpoint": "<string>",
"aiModel": "gpt-4o-mini",
"aiProvider": "openai",
"aiSystemPrompt": "<string>",
"bcbPassword": "<string>",
"bcbUsername": "<string>",
"defaultDestination": "DEINF",
"pollingIntervalMinutes": 15,
"retentionDays": 1825
}
headers = {
"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,
"updatedAt": "<string>",
"version": 3,
"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"
}
}{
"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"
}
}Cuerpo
application/json
AI 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. A changed endpoint needs aiApiKey in the same request, else 400 BCC-0002.
Maximum string length:
500Respuesta
OK
¿Esta página le ayudó?

