1. Generate an API key
- Sign in to tinypostcard.
- Open Integrations.
- Click Generate token.
- Save the key immediately.
2. Verify auth
curl "https://tinypostcard.com/api/v1/me" \
-H "Authorization: Bearer $TINYPOSTCARD_API_KEY"3. Find a template
curl "https://tinypostcard.com/api/v1/templates?scope=shared&side=front&search=travel&limit=5" \
-H "Authorization: Bearer $TINYPOSTCARD_API_KEY"Grab a template.id, then render printable HTML:
curl "https://tinypostcard.com/api/v1/templates/123/html?message=Wish+you+were+here" \
-H "Authorization: Bearer $TINYPOSTCARD_API_KEY"4. Send postcards with HTML
curl -X POST "https://tinypostcard.com/api/v1/postcards/send" \
-H "Authorization: Bearer $TINYPOSTCARD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": {
"firstName": "Avery",
"lastName": "Lane",
"line1": "123 Main St",
"city": "Denver",
"stateProvince": "CO",
"postalCode": "80202",
"country": "US"
},
"to": [
{
"firstName": "Jordan",
"lastName": "Parker",
"line1": "456 Ocean Ave",
"city": "San Francisco",
"stateProvince": "CA",
"postalCode": "94105",
"country": "US"
}
],
"frontHtml": "<!doctype html><html><body><div style=\"width:6in;height:4in\">Front</div></body></html>",
"backHtml": "<!doctype html><html><body><div style=\"width:6in;height:4in\">Back</div></body></html>"
}'5. Monitor balance
curl "https://tinypostcard.com/api/v1/balance" \
-H "Authorization: Bearer $TINYPOSTCARD_API_KEY"Last updated on