Scribeless Recipient Data Prep
Workflow
- Inspect the input format:
- CSV spreadsheet
- raw JSON array
- existing Scribeless API payload with
campaignId and data
- custom HTML recipient payload with
product_key, html, and data
- Map input columns to public Scribeless API fields:
title
firstName
lastName
company
address.address1
address.address2
address.address3
address.city
address.state
address.postalCode
address.country
- Preserve unrecognized business fields as
variables.
- For
POST /api/recipients/html, keep generated creative in the top-level html.front and/or html.back objects.
- Keep custom recipient values inside
data.variables.
- Validate:
- first name present
- address line 1 present
- city present
- state/region present when required for the destination country
- country present
- postcode present
- address line 1 preferably no longer than 30 characters
- HTML front/back
html values, when present, are strings no larger than 250 KB each
- Return a concise report:
- valid count
- warning/error count
- rows requiring user attention
- suggested column mapping
- Build payloads only when the user provides or confirms the campaign ID.
Scripts
Validate a CSV or JSON file:
python3 scripts/validate_recipients.py recipients.csv --report report.json
Build a Scribeless API payload:
python3 scripts/build_recipient_payload.py recipients.csv --campaign-id CAMPAIGN_ID --output payload.json
Payload Guidance
Prefer the standard campaign recipient API shape:
{
"campaignId": "CAMPAIGN_ID",
"data": [
{
"firstName": "Ada",
"lastName": "Lovelace",
"company": "Example Co",
"address": {
"address1": "123 Example St",
"city": "Bristol",
"state": "Bristol",
"postalCode": "BS1 1AA",
"country": "GB"
},
"variables": {
"plan": "VIP"
}
}
]
}
For custom HTML recipient rendering, validate the data object, top-level html object, product_key, include_envelope, and orientation used by POST /api/recipients/html.
Rules
- Do not discard unknown columns; put them under
variables unless they are empty.
- Use the public API field names in generated payloads:
firstName, lastName, and address.postalCode.
- For custom HTML recipient rendering, do not put HTML creative inside
data.variables; use the endpoint's top-level html.front and/or html.back objects.
- Do not fabricate missing addresses.
- Do not send live API requests unless explicitly asked after payload review.
- If a country, state, or postcode is ambiguous, flag it rather than guessing.
Support
- Help Center:
https://help.scribeless.co/en/
- API documentation:
https://docs.scribeless.co/
- For integration issues, ask the user to contact Scribeless through live chat or
team@scribeless.co.
References
- Use
references/recipient-fields.md for field mapping and warning rules.
1---2name: scribeless-recipient-data-prep3description: Clean and validate recipient CSV or JSON data for Scribeless uploads and API calls. Use when a user needs to map spreadsheet columns to Scribeless recipient fields, detect missing names or postal addresses, normalize country/state/postcode fields, keep personalization variables, build POST /api/recipients payloads, validate POST /api/recipients/html data, or produce a validation report before uploading recipients.4---56# Scribeless Recipient Data Prep78## Workflow9101. Inspect the input format:11 - CSV spreadsheet12 - raw JSON array13 - existing Scribeless API payload with `campaignId` and `data`14 - custom HTML recipient payload with `product_key`, `html`, and `data`152. Map input columns to public Scribeless API fields:16 - `title`17 - `firstName`18 - `lastName`19 - `company`20 - `address.address1`21 - `address.address2`22 - `address.address3`23 - `address.city`24 - `address.state`25 - `address.postalCode`26 - `address.country`273. Preserve unrecognized business fields as `variables`.28 - For `POST /api/recipients/html`, keep generated creative in the top-level `html.front` and/or `html.back` objects.29 - Keep custom recipient values inside `data.variables`.304. Validate:31 - first name present32 - address line 1 present33 - city present34 - state/region present when required for the destination country35 - country present36 - postcode present37 - address line 1 preferably no longer than 30 characters38 - HTML front/back `html` values, when present, are strings no larger than 250 KB each395. Return a concise report:40 - valid count41 - warning/error count42 - rows requiring user attention43 - suggested column mapping446. Build payloads only when the user provides or confirms the campaign ID.4546## Scripts4748Validate a CSV or JSON file:4950```bash51python3 scripts/validate_recipients.py recipients.csv --report report.json52```5354Build a Scribeless API payload:5556```bash57python3 scripts/build_recipient_payload.py recipients.csv --campaign-id CAMPAIGN_ID --output payload.json58```5960## Payload Guidance6162Prefer the standard campaign recipient API shape:6364```json65{66 "campaignId": "CAMPAIGN_ID",67 "data": [68 {69 "firstName": "Ada",70 "lastName": "Lovelace",71 "company": "Example Co",72 "address": {73 "address1": "123 Example St",74 "city": "Bristol",75 "state": "Bristol",76 "postalCode": "BS1 1AA",77 "country": "GB"78 },79 "variables": {80 "plan": "VIP"81 }82 }83 ]84}85```8687For custom HTML recipient rendering, validate the `data` object, top-level `html` object, `product_key`, `include_envelope`, and `orientation` used by `POST /api/recipients/html`.8889## Rules9091- Do not discard unknown columns; put them under `variables` unless they are empty.92- Use the public API field names in generated payloads: `firstName`, `lastName`, and `address.postalCode`.93- For custom HTML recipient rendering, do not put HTML creative inside `data.variables`; use the endpoint's top-level `html.front` and/or `html.back` objects.94- Do not fabricate missing addresses.95- Do not send live API requests unless explicitly asked after payload review.96- If a country, state, or postcode is ambiguous, flag it rather than guessing.9798## Support99100- Help Center: `https://help.scribeless.co/en/`101- API documentation: `https://docs.scribeless.co/`102- For integration issues, ask the user to contact Scribeless through live chat or `team@scribeless.co`.103104## References105106- Use `references/recipient-fields.md` for field mapping and warning rules.