Record Processing API (1.0.5)
API for receiving individual records for processing in batches.
All POST requests with a body must be sent as valid JSON with the Content-Type: application/json header.
Clients can send records to the API through the /records/send endpoint. Records are grouped into a "batch" and processed based on the chosen batchDuration strategy.
- short (default): Records are collected in a temporary batch. If no new records are received for that batch within a 60-second window, the batch is closed and processed into a CSV file.
- long: Records are collected persistently over a longer period and processed at a fixed, scheduled time (e.g., daily, weekly, or monthly).
https://pioneer-api-v1.redocly.app/_mock/openapi/
https://api.pioneerdm.com/
https://api.v1.pioneerdm.com/
Request
Submits a single record as a JSON object to be added to a batch. The request body must be valid JSON and you must include the Content-Type: application/json header.
The batchId and batchDuration fields are required within the JSON object. This endpoint also requires x-api-key and idempotency-key headers.
The record object to be submitted.
Explicit identifier for the batch this record belongs to.
Important. Determines the batching strategy. 'short' uses a time-based inactivity window (e.g., 60 seconds) to close and process the batch. 'long' collects records over a longer period to be processed at a fixed, scheduled time (e.g., daily, weekly, or monthly). It is very important to select a long batch duration if your company plans to send less than 50 records a minute.
An optional, desired mail date in YYYY-MM-DD format. This is not a guaranteed mailing date but is used as a hint for grouping records with similar desired timelines.
The main body text or message for the mail piece. Can contain merge variables (e.g., {{to.name}} or {{offer_code}}).
Optional metadata associated with the record. This field is no longer used for deriving a batch identifier.
An object containing key-value pairs for dynamic data insertion. Each key in this object can be used as a placeholder in string fields like 'message' (e.g., {{offer_code}}). The system will replace the placeholder with the corresponding value. This is useful for custom data not available in other top-level fields like 'to' or 'from'.
- Mock server
https://pioneer-api-v1.redocly.app/_mock/openapi/records/send
- Testing Server
https://api.pioneerdm.com/records/send
- Production Server
https://api.v1.pioneerdm.com/records/send
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://pioneer-api-v1.redocly.app/_mock/openapi/records/send \
-H 'Content-Type: application/json' \
-H 'idempotency-key: a7b2c9d8-e1f2-3456-7890-1k2l3m4n5o6p' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"description": "Demo postcard with merge variables",
"batchId": "daily_lead_upload_20240521",
"batchDuration": "long",
"mail_date": "2024-06-20",
"to": {
"name": "Alex Ray",
"address_line1": "123 Main St",
"city": "Anytown",
"state": "CA",
"address_zip": "90210"
},
"from": {
"name": "Pioneer Corp",
"address_line1": "456 Sender Ave",
"city": "Senderville",
"state": "NY",
"address_zip": "10001"
},
"front": "tmpl_front_abc",
"back": "tmpl_back_xyz",
"message": "Hello {{to.name}}, don'\''t miss out on our summer sale! Use code {{offer_code}} for 20% off.",
"merge_variables": {
"offer_code": "SUMMER24"
}
}'OK. Standard response for successfully receiving a record for a 'short' duration batch. This status is also returned for an idempotent replay of any previously successful request (both 'short' and 'long'), in which case the idempotency field will be populated.
The identifier for the batch the record was added to. Use this string to query processed uploads later via /records/get.
An estimated timestamp for when this batch will be processed if no more records are sent to it.
The current number of records received for this batch during its current lifecycle.
{ "message": "Record accepted for short batching.", "batchDuration": "short", "batchString": "my_crm_direct_mail_q1_promo_postcard", "compilesOn": "2024-05-21T18:13:02.123Z", "count": 15, "idempotency": { "message": "Request was already processed. Returning cached response.", "key": "a7b2c9d8-e1f2-3456-7890-1k2l3m4n5o6p" } }
Specify the batch identifier to retrieve processed upload summaries for.
- Mock server
https://pioneer-api-v1.redocly.app/_mock/openapi/records/get
- Testing Server
https://api.pioneerdm.com/records/get
- Production Server
https://api.v1.pioneerdm.com/records/get
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://pioneer-api-v1.redocly.app/_mock/openapi/records/get \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"batchString": "daily_lead_upload_20240521"
}'Successfully retrieved processed upload summaries. The 'uploads' array will be empty if no matching processed uploads are found.
An array of processed uploads matching the request. The array is empty if no matches are found.
The unique identifier of the Upload document in MongoDB.
The batch identifier associated with this upload.
Timestamp when the Upload document was first created.
Timestamp when the Upload document was last updated.
The total number of records in the processed batch.
Timestamp when the CSV file for this batch was generated.
The key of the generated CSV file in S3.
{ "uploads": [ { … } ] }