Skip to main content
POST
/
records
/
bulk
Bulk create records
curl --request POST \
  --url https://api.endclose.com/v1/records/bulk \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "records": [
    {
      "date": "2023-12-25",
      "data_stream_key": "<string>",
      "amount": 123,
      "currency": "USD",
      "description": "<string>",
      "external_id": "<string>",
      "metadata": {}
    }
  ],
  "on_conflict": "skip"
}
'
{
  "id": 123,
  "total_items": 123,
  "processed_items": 123,
  "successful_items": 123,
  "failed_items": 123,
  "skipped_items": 123,
  "url": "<string>"
}

Authorizations

X-API-KEY
string
header
required

Headers

Idempotency-Key
string

Optional idempotency key. If a bulk request with this key already exists for your environment, the existing request is returned instead of creating a new one.

Body

application/json
records
object[]
required
Required array length: 1 - 1000 elements
on_conflict
enum<string>
default:skip

How to handle records whose external_id already exists in the target stream. skip (default) silently skips duplicates and counts them in skipped_items. error surfaces duplicates as per-row failures. Only applies to records with external_id set.

Available options:
skip,
error

Response

Bulk request accepted for processing

Summary returned when a bulk request is created or retrieved via idempotency key

id
integer

Unique identifier for the bulk request

status
enum<string>

Current processing status

Available options:
pending,
processing,
completed,
failed,
cancelled
total_items
integer

Number of records submitted

processed_items
integer

Number of records processed so far

successful_items
integer

Number of records successfully created

failed_items
integer

Number of records that failed

skipped_items
integer

Number of records skipped due to on_conflict: skip matching an existing external_id

url
string

Polling URL to check progress (e.g. /v1/bulk_requests/123)