API Reference
Delivery Hub exposes a REST API for cross-org synchronization. These endpoints are used internally by the sync engine but can also be called directly for custom integrations.
Base URL
Replace your-org with your Salesforce org's My Domain.
Authentication
All API calls require a valid Salesforce OAuth 2.0 access token passed in the Authorization header:
For cross-org sync, Delivery Hub manages OAuth flows automatically via the ConnectedOrg__c configuration. For custom integrations, use a Connected App with the api scope.
POST /delivery/sync
Pushes work item changes from the source org to the target org.
Request Payload
Response
Field Reference
| Field | Type | Description |
|---|---|---|
| transactionId | String | Unique ID for echo suppression. Must be globally unique per sync operation. |
| sourceOrgId | String | The Salesforce Organization ID of the sending org. |
| timestamp | ISO 8601 | When the change occurred. Used for conflict resolution (last-write-wins). |
| operation | String | upsert or delete |
| records | Array | Array of work item objects. Each must include an externalId. |
Retry Logic
The sync engine uses exponential backoff for failed requests:
- •Attempt 1: Immediate
- •Attempt 2: After 30 seconds
- •Attempt 3: After 2 minutes
- •Attempt 4: After 10 minutes
- •Attempt 5: After 1 hour (final attempt)
After 5 failed attempts, the sync item is marked as Failed and appears in the Sync Monitor dashboard for manual review.
Echo Suppression
When Org A pushes a change to Org B, the update in Org B triggers its own outbound sync trigger. Without echo suppression, this would create an infinite loop. Delivery Hub prevents this by:
- Including a
transactionIdin every sync payload - Storing processed transaction IDs in a cache (Platform Cache or custom object)
- Checking inbound payloads against the cache before processing
- Skipping the outbound trigger if the update originated from a sync operation
Error Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Sync processed successfully. |
| 400 | Bad Request | Invalid payload structure or missing required fields. |
| 401 | Unauthorized | Invalid or expired access token. |
| 409 | Conflict | A newer version of the record exists (timestamp conflict). |
| 500 | Server Error | Unexpected error. Check Sync Monitor for details. |
Related
- Architecture — data model and sync engine design
- CI/CD — automated testing for sync endpoints