Who built this? Meet the guy crazy enough to build this

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

https://your-org.my.salesforce.com/services/apexrest/dlhub/delivery/sync

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:

Authorization: Bearer <access_token>

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

{ "transactionId": "txn_abc123", "sourceOrgId": "00D000000000001", "timestamp": "2026-02-27T14:30:00.000Z", "operation": "upsert", "records": [ { "externalId": "WI-001", "title": "Add revenue report", "status": "In Development", "priority": "High", "estimatedHours": 8, "assignee": "developer@example.com", "description": "Create a summary revenue report...", "acceptanceCriteria": "Report shows YTD revenue...", "comments": [], "timeLogs": [] } ] }

Response

{ "success": true, "transactionId": "txn_abc123", "recordsProcessed": 1, "errors": [] }

Field Reference

FieldTypeDescription
transactionIdStringUnique ID for echo suppression. Must be globally unique per sync operation.
sourceOrgIdStringThe Salesforce Organization ID of the sending org.
timestampISO 8601When the change occurred. Used for conflict resolution (last-write-wins).
operationStringupsert or delete
recordsArrayArray 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:

  1. Including a transactionId in every sync payload
  2. Storing processed transaction IDs in a cache (Platform Cache or custom object)
  3. Checking inbound payloads against the cache before processing
  4. Skipping the outbound trigger if the update originated from a sync operation

Error Codes

CodeStatusDescription
200OKSync processed successfully.
400Bad RequestInvalid payload structure or missing required fields.
401UnauthorizedInvalid or expired access token.
409ConflictA newer version of the record exists (timestamp conflict).
500Server ErrorUnexpected error. Check Sync Monitor for details.

Related

  • Architecture — data model and sync engine design
  • CI/CD — automated testing for sync endpoints