Known-good requests

Examples

Copy these examples into scripts, API clients, GCP workflows, or the Developer Workbench. Replace demo IDs with real tenant, workspace, manifest, profile, and connector context before using against production data.

GET/api/datasynch/health

Check API health

Use this before deeper testing to make sure the DataSynch API is responding.

Request
http
GET /api/datasynch/health
Example response
json
{
  "ok": true,
  "service": "atlas-datasynch",
  "version": "1.0.0",
  "timestamp": "2026-06-24T17:30:00.000Z"
}
curl
bash
curl -X GET "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/health" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY"
fetch()
ts
const response = await fetch('/api/datasynch/health', {
  method: 'GET',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  }
});

const data = await response.json();
Notes
  • No manifest ID is required.
  • Use this as a smoke test for gateway and local development routes.
GET/api/datasynch/application-integration/status

Check GCP Application Integration status

Use this to confirm safe configuration status before connecting Google Application Integration.

Request
http
GET /api/datasynch/application-integration/status
Example response
json
{
  "ok": true,
  "applicationIntegrationReady": true,
  "projectIdConfigured": true,
  "regionConfigured": true,
  "integrationNameConfigured": true,
  "triggerIdConfigured": true,
  "googleCredentialsConfigured": true,
  "missing": []
}
curl
bash
curl -X GET "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/application-integration/status" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY"
fetch()
ts
const response = await fetch('/api/datasynch/application-integration/status', {
  method: 'GET',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  }
});

const data = await response.json();
Notes
  • This should not leak secrets.
  • Use missing[] to guide setup work.
POST/api/datasynch/master-tables/import

Import location records

Import facility, customer, warehouse, service-zone, dock, or address records.

Request body
json
{
  "manifestId": "manifest_demo_001",
  "targetTable": "locations",
  "sourceKind": "manual",
  "connectorId": "developer-center",
  "connectionName": "Developer Center example",
  "records": [
    {
      "externalId": "SEA-DC-001",
      "recordType": "distribution_center",
      "fields": {
        "name": "Seattle Distribution Center",
        "addressLine1": "100 Logistics Way",
        "city": "Seattle",
        "state": "WA",
        "postalCode": "98134",
        "country": "US",
        "latitude": 47.5899,
        "longitude": -122.3315,
        "locationType": "distribution_center"
      },
      "metadata": {
        "source": "developer_center_example"
      }
    }
  ]
}
Example response
json
{
  "ok": true,
  "manifestId": "manifest_demo_001",
  "targetTable": "locations",
  "importId": "import_001",
  "importedCount": 1,
  "failedCount": 0,
  "errors": []
}
curl
bash
curl -X POST "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/master-tables/import" \
  -H "content-type: application/json" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY" \
  --data '{
  "manifestId": "manifest_demo_001",
  "targetTable": "locations",
  "sourceKind": "manual",
  "connectorId": "developer-center",
  "connectionName": "Developer Center example",
  "records": [
    {
      "externalId": "SEA-DC-001",
      "recordType": "distribution_center",
      "fields": {
        "name": "Seattle Distribution Center",
        "addressLine1": "100 Logistics Way",
        "city": "Seattle",
        "state": "WA",
        "postalCode": "98134",
        "country": "US",
        "latitude": 47.5899,
        "longitude": -122.3315,
        "locationType": "distribution_center"
      },
      "metadata": {
        "source": "developer_center_example"
      }
    }
  ]
}'
fetch()
ts
const response = await fetch('/api/datasynch/master-tables/import', {
  method: 'POST',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  },
    body: JSON.stringify({
  "manifestId": "manifest_demo_001",
  "targetTable": "locations",
  "sourceKind": "manual",
  "connectorId": "developer-center",
  "connectionName": "Developer Center example",
  "records": [
    {
      "externalId": "SEA-DC-001",
      "recordType": "distribution_center",
      "fields": {
        "name": "Seattle Distribution Center",
        "addressLine1": "100 Logistics Way",
        "city": "Seattle",
        "state": "WA",
        "postalCode": "98134",
        "country": "US",
        "latitude": 47.5899,
        "longitude": -122.3315,
        "locationType": "distribution_center"
      },
      "metadata": {
        "source": "developer_center_example"
      }
    }
  ]
})
});

const data = await response.json();
Notes
  • Use targetTable: locations for the generic master-table route.
  • Prefer stable externalId values for repeat imports.
POST/api/datasynch/crm/import

Import CRM records

Import customer, account, partner, or prospect records.

Request body
json
{
  "manifestId": "manifest_demo_001",
  "records": [
    {
      "externalId": "ACME-001",
      "recordType": "account",
      "fields": {
        "accountName": "Acme Retail Northwest",
        "tier": "pilot",
        "email": "ops@example.com",
        "city": "Bellevue",
        "state": "WA",
        "country": "US"
      }
    }
  ]
}
Example response
json
{
  "ok": true,
  "manifestId": "manifest_demo_001",
  "importedCount": 1,
  "failedCount": 0,
  "errors": []
}
curl
bash
curl -X POST "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/crm/import" \
  -H "content-type: application/json" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY" \
  --data '{
  "manifestId": "manifest_demo_001",
  "records": [
    {
      "externalId": "ACME-001",
      "recordType": "account",
      "fields": {
        "accountName": "Acme Retail Northwest",
        "tier": "pilot",
        "email": "ops@example.com",
        "city": "Bellevue",
        "state": "WA",
        "country": "US"
      }
    }
  ]
}'
fetch()
ts
const response = await fetch('/api/datasynch/crm/import', {
  method: 'POST',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  },
    body: JSON.stringify({
  "manifestId": "manifest_demo_001",
  "records": [
    {
      "externalId": "ACME-001",
      "recordType": "account",
      "fields": {
        "accountName": "Acme Retail Northwest",
        "tier": "pilot",
        "email": "ops@example.com",
        "city": "Bellevue",
        "state": "WA",
        "country": "US"
      }
    }
  ]
})
});

const data = await response.json();
Notes
  • Use CRM records for account-level mapping and sales/support overlays.
  • Connect CRM records to locations through XREF when needed.
POST/api/datasynch/geofences

Create point-radius geofence

Create a geofence around a location or coordinate.

Request body
json
{
  "manifestId": "manifest_demo_001",
  "name": "Seattle DC arrival fence",
  "locationId": "SEA-DC-001",
  "geometryType": "point_radius",
  "latitude": 47.5899,
  "longitude": -122.3315,
  "radiusMiles": 0.25,
  "enabled": true,
  "metadata": {
    "purpose": "arrival_departure_detection"
  }
}
Example response
json
{
  "ok": true,
  "geofence": {
    "geofenceId": "gf_seattle_dc",
    "manifestId": "manifest_demo_001",
    "name": "Seattle DC arrival fence",
    "geometryType": "point_radius",
    "enabled": true
  }
}
curl
bash
curl -X POST "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/geofences" \
  -H "content-type: application/json" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY" \
  --data '{
  "manifestId": "manifest_demo_001",
  "name": "Seattle DC arrival fence",
  "locationId": "SEA-DC-001",
  "geometryType": "point_radius",
  "latitude": 47.5899,
  "longitude": -122.3315,
  "radiusMiles": 0.25,
  "enabled": true,
  "metadata": {
    "purpose": "arrival_departure_detection"
  }
}'
fetch()
ts
const response = await fetch('/api/datasynch/geofences', {
  method: 'POST',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  },
    body: JSON.stringify({
  "manifestId": "manifest_demo_001",
  "name": "Seattle DC arrival fence",
  "locationId": "SEA-DC-001",
  "geometryType": "point_radius",
  "latitude": 47.5899,
  "longitude": -122.3315,
  "radiusMiles": 0.25,
  "enabled": true,
  "metadata": {
    "purpose": "arrival_departure_detection"
  }
})
});

const data = await response.json();
Notes
  • Use point_radius for simple operational zones.
  • Use polygon when a facility boundary is irregular.
POST/api/datasynch/telemetry/events

Send telemetry event

Send a shipment, carrier, equipment, scanner, or mobile telemetry event.

Request body
json
{
  "manifestId": "manifest_demo_001",
  "shipmentId": "SHIP-100045",
  "equipmentId": "TRAILER-9088",
  "carrierScac": "ABCD",
  "mode": "truck",
  "eventCode": "ARRIVED",
  "eventDescription": "Arrived at distribution center",
  "eventTime": "2026-06-24T17:30:00.000Z",
  "latitude": 47.5899,
  "longitude": -122.3315,
  "references": [
    "PO-45000123",
    "ASN-856-778899"
  ],
  "metadata": {
    "source": "developer_center_example"
  }
}
Example response
json
{
  "ok": true,
  "event": {
    "eventId": "evt_001",
    "manifestId": "manifest_demo_001",
    "shipmentId": "SHIP-100045",
    "eventCode": "ARRIVED"
  }
}
curl
bash
curl -X POST "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/telemetry/events" \
  -H "content-type: application/json" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY" \
  --data '{
  "manifestId": "manifest_demo_001",
  "shipmentId": "SHIP-100045",
  "equipmentId": "TRAILER-9088",
  "carrierScac": "ABCD",
  "mode": "truck",
  "eventCode": "ARRIVED",
  "eventDescription": "Arrived at distribution center",
  "eventTime": "2026-06-24T17:30:00.000Z",
  "latitude": 47.5899,
  "longitude": -122.3315,
  "references": [
    "PO-45000123",
    "ASN-856-778899"
  ],
  "metadata": {
    "source": "developer_center_example"
  }
}'
fetch()
ts
const response = await fetch('/api/datasynch/telemetry/events', {
  method: 'POST',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  },
    body: JSON.stringify({
  "manifestId": "manifest_demo_001",
  "shipmentId": "SHIP-100045",
  "equipmentId": "TRAILER-9088",
  "carrierScac": "ABCD",
  "mode": "truck",
  "eventCode": "ARRIVED",
  "eventDescription": "Arrived at distribution center",
  "eventTime": "2026-06-24T17:30:00.000Z",
  "latitude": 47.5899,
  "longitude": -122.3315,
  "references": [
    "PO-45000123",
    "ASN-856-778899"
  ],
  "metadata": {
    "source": "developer_center_example"
  }
})
});

const data = await response.json();
Notes
  • Coordinates can be used for geofence evaluation.
  • references[] keeps PO, ASN, BOL, or partner IDs attached.
POST/api/datasynch/xref/evaluate

Evaluate XREF rules

Evaluate incoming record fields against lookup or matching rules.

Request body
json
{
  "manifestId": "manifest_demo_001",
  "records": [
    {
      "recordId": "incoming-001",
      "fields": {
        "partnerLocationCode": "SEA-DC",
        "partnerSku": "ABC-CASE-12"
      }
    }
  ],
  "rules": [
    {
      "id": "location-code-to-location-id",
      "name": "Partner location code to Atlas location ID",
      "sourceField": "partnerLocationCode",
      "targetField": "locationId",
      "matchType": "lookup",
      "lookupTable": "locations",
      "enabled": true
    }
  ]
}
Example response
json
{
  "ok": true,
  "manifestId": "manifest_demo_001",
  "matchedCount": 1,
  "unmatchedCount": 0,
  "results": []
}
curl
bash
curl -X POST "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/xref/evaluate" \
  -H "content-type: application/json" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY" \
  --data '{
  "manifestId": "manifest_demo_001",
  "records": [
    {
      "recordId": "incoming-001",
      "fields": {
        "partnerLocationCode": "SEA-DC",
        "partnerSku": "ABC-CASE-12"
      }
    }
  ],
  "rules": [
    {
      "id": "location-code-to-location-id",
      "name": "Partner location code to Atlas location ID",
      "sourceField": "partnerLocationCode",
      "targetField": "locationId",
      "matchType": "lookup",
      "lookupTable": "locations",
      "enabled": true
    }
  ]
}'
fetch()
ts
const response = await fetch('/api/datasynch/xref/evaluate', {
  method: 'POST',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  },
    body: JSON.stringify({
  "manifestId": "manifest_demo_001",
  "records": [
    {
      "recordId": "incoming-001",
      "fields": {
        "partnerLocationCode": "SEA-DC",
        "partnerSku": "ABC-CASE-12"
      }
    }
  ],
  "rules": [
    {
      "id": "location-code-to-location-id",
      "name": "Partner location code to Atlas location ID",
      "sourceField": "partnerLocationCode",
      "targetField": "locationId",
      "matchType": "lookup",
      "lookupTable": "locations",
      "enabled": true
    }
  ]
})
});

const data = await response.json();
Notes
  • Use this before import when source IDs differ from Atlas IDs.
  • Unmatched records should become reviewable exceptions.
POST/api/datasynch/notification-dispatch

Dispatch webhook notification

Dispatch a downstream webhook after an event, rule, or exception.

Request body
json
{
  "manifestId": "manifest_demo_001",
  "dispatchType": "webhook",
  "subject": "Geofence arrival event",
  "message": "Shipment SHIP-100045 arrived at Seattle DC.",
  "payload": {
    "recordId": "geofence-event-001",
    "recordType": "geofence_event",
    "fields": {
      "eventType": "enter",
      "shipmentId": "SHIP-100045",
      "geofenceId": "gf_seattle_dc"
    }
  },
  "metadata": {
    "targetName": "Customer webhook"
  }
}
Example response
json
{
  "ok": true,
  "dispatchId": "dispatch_001",
  "status": "queued"
}
curl
bash
curl -X POST "https://atlasemoji--epicatlas-4361e.us-east4.hosted.app/api/datasynch/notification-dispatch" \
  -H "content-type: application/json" \
  -H "x-api-key: $ATLAS_DATASYNCH_API_KEY" \
  --data '{
  "manifestId": "manifest_demo_001",
  "dispatchType": "webhook",
  "subject": "Geofence arrival event",
  "message": "Shipment SHIP-100045 arrived at Seattle DC.",
  "payload": {
    "recordId": "geofence-event-001",
    "recordType": "geofence_event",
    "fields": {
      "eventType": "enter",
      "shipmentId": "SHIP-100045",
      "geofenceId": "gf_seattle_dc"
    }
  },
  "metadata": {
    "targetName": "Customer webhook"
  }
}'
fetch()
ts
const response = await fetch('/api/datasynch/notification-dispatch', {
  method: 'POST',
  headers: {
    'content-type': 'application/json',
    'x-api-key': process.env.ATLAS_DATASYNCH_API_KEY ?? ''
  },
    body: JSON.stringify({
  "manifestId": "manifest_demo_001",
  "dispatchType": "webhook",
  "subject": "Geofence arrival event",
  "message": "Shipment SHIP-100045 arrived at Seattle DC.",
  "payload": {
    "recordId": "geofence-event-001",
    "recordType": "geofence_event",
    "fields": {
      "eventType": "enter",
      "shipmentId": "SHIP-100045",
      "geofenceId": "gf_seattle_dc"
    }
  },
  "metadata": {
    "targetName": "Customer webhook"
  }
})
});

const data = await response.json();
Notes
  • Dispatch should produce logs.
  • Use metadata to preserve traceability to the source rule or event.