Your application can retrieve mail records and available scans, create internal tasks, and request supported handling actions without manually copying data from a mailbox dashboard.
PostScan Mail provides endpoints to retrieve items, manage automation rules, and request actions such as opening, rescanning, discarding, or shredding mail.
Build the integration around two separate processes: synchronizing records and controlling physical actions.
What You Need Before Making API Requests
Start with an active PostScan Mail account, Developer API access, and an API key. The PostScan Mail Developer API page explains how to set up your account and generate, rotate, and revoke keys.
Store the key in a secret manager or protected backend configuration. Make authenticated requests from your server, and keep the key out of browser code, public repositories, and logs.
Complete the receiving location’s authorization and identity-verification requirements before requesting mail handling.
Choose a test item that you are authorized to open, and decide who can approve later actions.
Retrieve Mail Items With the API
The documented base URL is https://api.postscanmail.com/api/account-docs/v2/. Authentication uses the x-api-key request header.
The following Bash example retrieves the first page in descending order. Set PSM_API_KEY through your runtime configuration first. The –include option displays response headers so you can inspect the HTTP status along with the body.
PSM_API_BASE=’https://api.postscanmail.com/api/account-docs/v2′
curl –silent –show-error –include \
–get “${PSM_API_BASE}/items” \
–data-urlencode ‘sort_order=desc’ \
–data-urlencode ‘page=1’ \
–header “x-api-key: ${PSM_API_KEY}” \
–header ‘Content-Type: application/json’
Use the official API documentation and its endpoint reference to confirm request parameters, response fields, and action requirements before deployment.
How to Use the API Response
The documented response includes data collection plus the current_page, per_page, and total pagination fields. Map available values explicitly rather than passing the whole response into downstream systems.
| Field or path | Integration use |
| mail_id and address_id | Link the item to its mailbox address and your own records. |
| cover_image and pdf_content | Use available exterior-image and content-PDF references. |
| pdf_metadata.current_status | Track the returned processing state. |
| pdf_metadata.assigned_user | Map the assigned user to your internal routing. |
| ai_summary | Handle available summaries and the empty-array case. |
Handle the documented empty-mailbox case before iterating over records. Its total is 0, and data contains a message string rather than an item object. Validate each entry’s type before reading mail_id.
The first page does not represent the whole account. Use the pagination metadata to retrieve the required pages. Keep existing records eligible for later synchronization because a scan or processing status may change after you first retrieve an item.
Request an Open Action for an Authorized Item
The open endpoint uses an address ID in its path and a mail_ids array in its JSON body. In the same shell as the retrieval example, set PSM_ADDRESS_ID to the item’s authorized address and replace the Mail ID placeholder.
curl –silent –show-error –include \
–request POST \
–url “${PSM_API_BASE}/addresses/${PSM_ADDRESS_ID}/items/actions/open” \
–header “x-api-key: ${PSM_API_KEY}” \
–header ‘Content-Type: application/json’ \
–data ‘{“mail_ids”:[“REPLACE_WITH_AUTHORIZED_MAIL_ID”]}’
Validate that the item belongs to that account and address before submitting the request. Record the intended action, approval, and response in your own system.
A successful submission acknowledges the request. It does not establish that staff has finished opening and scanning the mail. Check later item data for the completed result before starting a document-dependent workflow.
Use Each Action’s Own Payload
The public catalog also lists rescan, discard, shred, and cancellation endpoints. Their bodies differ. For example, opening uses mail_ids, while discard and shred requests use mail_id and include a delete_digital_copy option. Copy the schema for the specific action you implement.
A cancellation request also needs a valid item state. Treat cancellation as a request to stop eligible pending work, not as a way to reverse handling that has already occurred.
Build a Synchronization Process That Can Resume
Keep retrieval separate from the worker that submits physical actions. This lets you recover from a failed CRM update without repeating an open or shred request.
- Fetch the pages needed for synchronization and validate their records.
- Upsert each item using a reference that includes the connected account and Mail ID.
- Compare relevant state and document references with your stored version.
- Create or update the downstream task using a stable deduplication key.
- Save progress only after the corresponding database work succeeds.
These are application design recommendations, not additional API endpoints. A database uniqueness constraint can help prevent duplicate tasks when two workers process the same item.
Page-number pagination can shift when new mail arrives. Revisit an overlapping range and run periodic reconciliation rather than assuming yesterday’s page boundary remains fixed. Deduplication makes that overlap manageable.
Example Workflow for Invoice Intake
Suppose your application finds an item associated with a supplier. It creates an accounting review task that contains the Mail ID and a link to the internal record. An authorized reviewer approves opening the letter.
Your action worker submits the open request once. The synchronization process later finds an available content scan and attaches it to the existing task. An extraction system can suggest invoice details, and the reviewer can check them against the document before approving payment.
Keep sender matching separate from identity verification. A displayed sender name can help route a record, but it should not authorize payment or document destruction.
Handle HTTP Status and API Error Codes Separately
Read both the HTTP response status and the JSON body’s code and message. PostScan Mail’s application error codes are a separate numbering system.
For example, the error reference uses body code 429 for an incorrect API key and body code 434 for excessive requests. A JSON code of 429 therefore does not carry the same meaning as HTTP status 429. Do not build retry rules by treating those values as interchangeable.
- Correct authentication or access problems before retrying.
- Validate address IDs, item IDs, and action parameters when a request fails validation.
- Review the item’s state when an action is no longer permitted.
- Back off after usage-limit responses and follow retry instructions when supplied.
- Escalate uncertain action outcomes for reconciliation.
A timeout after submitting an action leaves an important question: did the service accept it before the connection failed? Store the attempt and inspect the item’s current state before resubmitting. Maintain an internal action ledger; do not assume the API supports an undocumented idempotency header.
Confirm production rate limits and retry behavior with PostScan Mail. The examples here do not define a requests-per-minute allowance or a polling interval.
Manage Automation Rules With Their Account-Wide Scope
The rule endpoints retrieve system settings and update a named automation using automation name and is active. The endpoint documentation lists auto scan, auto shred, auto discard, and auto ai summary. The update applies across users on the account.
Treat rule changes as administrative operations. Read the existing settings, record who approved the change, and verify the returned settings afterward. Review retention requirements before enabling disposal rules.
For item-specific business decisions, use your own approval logic and the relevant supported action. A broad account rule should match the policy you intend for all affected users.
Choosing the Right Integration Method
Use the API when you need a database-backed integration, custom routing, reconciliation, or control over how requests run. Use the dashboard when someone needs to review items and take action directly.
For app-to-app workflows, the PostScan Mail Zapier integration provides documented triggers for events such as new mail and completed scans. Compare the available triggers and data with your workflow before maintaining custom code.
Keep Mail Data Within Your Access and Retention Rules
Limit who can retrieve documents and who can request physical handling. Redact credentials and document URLs from routine logs, protect stored copies, and keep an audit record of approvals and action attempts.
When adding OCR or AI, send only approved content to the selected processor. Preserve the source document and review extracted dates, amounts, and instructions before they drive business decisions.
Retrieved document text should not gain authority to change your application’s permissions or handling policies.
Track downloaded copies in your own retention process. Changing or deleting an item in one system does not automatically remove copies held by your CRM, storage provider, or processing service.
How to Get Started with Mail Automation
Begin by synchronizing records into a review queue. Test empty results, pagination, missing scans, revoked credentials, rejected actions, and interrupted requests. Add one approved handling action after the record synchronization works.
Use the current endpoint documentation as the implementation reference. For access or unresolved contract details, contact api@postscanmail.com. Expand the workflow after you can trace each item from receipt through its requested action and downstream record.
Access & Manage Your Postal Mail
Anywhere Anytime!
Receive mail anywhere, on any device.
We offer 1000+ mailing addresses for both personal and business use.

