Pular para o conteúdo principal
POST
/
v1
/
imports
/
contexts
/
{contextId}
/
sources
/
{sourceId}
/
preview
Preview a transaction file
curl --request POST \
  --url https://matcher.sandbox.lerian.net/v1/imports/contexts/{contextId}/sources/{sourceId}/preview \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form format=csv \
  --form max_rows=5
{
  "columns": [
    "date",
    "amount",
    "reference",
    "description"
  ],
  "sampleRows": [
    [
      "<string>"
    ]
  ],
  "rowCount": 5,
  "format": "csv"
}

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication (format: "Bearer {token}")

Cabeçalhos

X-Request-Id
string

A unique identifier for tracing the request across services.

X-Idempotency-Key
string

Optional idempotency key for safe retries. Also accepts Idempotency-Key as an alternative header name. If the same key is sent again and the original request was already processed, the cached response is returned with X-Idempotency-Replayed: true.

See Retries and idempotency for details.

Parâmetros de caminho

contextId
string
obrigatório

The unique identifier of the reconciliation context.

sourceId
string
obrigatório

The unique identifier of the reconciliation source.

Corpo

multipart/form-data
file
file
obrigatório

Transaction file to preview (CSV, JSON, or XML)

format
enum<string>

File format (auto-detected from filename if omitted)

Opções disponíveis:
csv,
json,
xml
max_rows
integer
padrão:5

Maximum number of sample rows to return

Intervalo obrigatório: 1 <= x <= 20

Resposta

File preview with detected columns and sample rows.

The response includes the X-Idempotency-Replayed header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See Retries and idempotency for more details.

Preview of a transaction file showing detected columns and sample data

columns
string[]

Detected column names

Exemplo:
[
  "date",
  "amount",
  "reference",
  "description"
]
sampleRows
string[][]

Sample data rows

rowCount
integer

Number of sample rows returned

Exemplo:

5

format
string

Detected file format

Exemplo:

"csv"