Pular para o conteúdo principal
POST
/
v1
/
management
/
connections
/
validate-schema
Validate schema
curl --request POST \
  --url https://reporter.sandbox.lerian.net/v1/management/connections/validate-schema \
  --header 'Content-Type: application/json' \
  --data '
{
  "mappedFields": {
    "midaz_onboarding": {
      "organization": [
        "id",
        "legal_name",
        "status",
        "created_at"
      ],
      "ledger": [
        "id",
        "organization_id",
        "name"
      ]
    },
    "midaz_transaction": {
      "transaction": [
        "id",
        "ledger_id",
        "amount",
        "status"
      ],
      "account": [
        "id",
        "name",
        "balance"
      ]
    }
  }
}
'
{
  "status": "success",
  "message": "All fields validated successfully",
  "errors": []
}

Cabeçalhos

Authorization
string

The authorization token in the Bearer <token> format.

Important: This header is required if your environment has Access Manager enabled. For more information, refer to the Access Manager documentation.

Exemplo:

"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Corpo

application/json

Request body for validating schema mappings against configured data sources. Use configName (not the connection UUID) as the key in mappedFields.

mappedFields
object
obrigatório

Object containing the field mapping configuration. The structure is: { configName: { tableName: [field1, field2, ...] } }. Use the connection's configName as the top-level key.

Exemplo:
{
"midaz_onboarding": {
"organization": ["id", "legal_name", "status"],
"ledger": ["id", "organization_id", "name"]
}
}

Resposta

The result of the schema validation.

Response object containing the result of schema validation.

status
enum<string>
obrigatório

The validation result status. Returns success when all fields are valid, or failure when validation errors are found.

Opções disponíveis:
success,
failure
Exemplo:

"success"

message
string
obrigatório

A human-readable summary of the validation result.

Exemplo:

"All fields validated successfully"

errors
object[]
obrigatório

A list of validation errors found during schema validation. Empty when status is success.