Send certified mail programmatically. Simple, RESTful, and designed for developers.
All API requests require authentication using an API key. Include your key in theAuthorization header:
Authorization: Bearer 321m_live_xxxxxxxxxxxxOr use the X-API-Key header:
X-API-Key: 321m_live_xxxxxxxxxxxxSecurity: Keep your API key secret. Never expose it in client-side code or public repositories.
https://api.321certified.com/api/v1Errors return a consistent JSON structure:
{
"error": {
"message": "Invalid API key",
"code": "unauthorized",
"status": 401
}
}| Status | Code | Description |
|---|---|---|
| 400 | bad_request | Invalid request parameters |
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | Insufficient permissions |
| 404 | not_found | Resource not found |
| 422 | unprocessable_entity | Validation error (e.g., invalid address) |
| 500 | internal_error | Server error |
/api/v1/api-keysSessionCreate a new API key
/api/v1/api-keysSessionList your API keys
/api/v1/api-keys/:idSessionRevoke an API key
/api/v1/mailingsAPI KeyCreate a new certified mailing
/api/v1/mailingsAPI KeyList your mailings
/api/v1/mailings/:idAPI KeyGet mailing details
/api/v1/mailings/:id/labelAPI KeyDownload label PDF
/api/v1/tracking/:trackingNumberAPI KeyGet tracking status and events
/api/v1/addresses/validateAPI KeyValidate an address with USPS
/api/v1/pricingAPI KeyGet pricing table
/api/v1/pricing/calculateAPI KeyCalculate price for a mailing
curl -X POST https://api.321certified.com/api/v1/mailings \
-H "Authorization: Bearer 321m_live_xxxx" \
-H "Content-Type: application/json" \
-d '{
"from": {
"name": "John Smith",
"street1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zip": "94105"
},
"to": {
"name": "Jane Doe",
"street1": "456 Oak Ave",
"city": "Los Angeles",
"state": "CA",
"zip": "90001"
},
"mail_class": "certified_return_receipt",
"reference": "CASE-2024-001"
}'{
"id": "clx123abc",
"tracking_number": "9400111899223456789012",
"status": "label_generated",
"mail_class": "certified_return_receipt",
"cost": {
"postage": 8.12,
"service_fee": 1.64,
"total": 9.76
},
"label_url": "/api/v1/mailings/clx123abc/label",
"from": { ... },
"to": { ... },
"created_at": "2024-01-15T10:30:00Z"
}curl -X POST https://api.321certified.com/api/v1/addresses/validate \
-H "Authorization: Bearer 321m_live_xxxx" \
-H "Content-Type: application/json" \
-d '{
"street1": "1600 Pennsylvania Ave",
"city": "Washington",
"state": "DC",
"zip": "20500"
}'curl https://api.321certified.com/api/v1/tracking/9400111899223456789012 \
-H "Authorization: Bearer 321m_live_xxxx"curl "https://api.321certified.com/api/v1/mailings?status=delivered&limit=10" \
-H "Authorization: Bearer 321m_live_xxxx"API keys can be scoped with specific permissions:
| Permission | Description |
|---|---|
| * | Full access (default) |
| mailings:read | Read mailings and tracking |
| mailings:write | Create new mailings |
| addresses:read | Validate addresses |
| pricing:read | View pricing information |
API requests are limited to ensure fair usage:
Rate limit headers are included in all responses:
X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 998 X-RateLimit-Reset: 1642521600