Skip to content

Export Route Logs

Request

Export route logs for audit and reporting purposes.

Overview

The Route Logs API provides comprehensive audit trails for all routing, conversion, merging, and enrichment actions performed on Salesforce objects. It supports filtering, export formats, and configurable retention policies.

Query Parameters

  • from: Start date for log export (ISO format, required)
  • to: End date for log export (ISO format, required)
  • pool: Filter by specific pool name (optional)
  • object: Filter by specific object type (Lead, Contact, Account, Opportunity) (optional)
  • action: Filter by specific action type (assign, convert, merge, enrich) (optional)
  • format: Export format (json, csv) (optional, default: json)
  • include_diff: Include diff data in export (optional, default: true)
  • limit: Maximum number of records to return (optional, default: 1000, max: 10000)

Response Fields

Each log entry includes:

  • timestamp: ISO timestamp of the action
  • object: Salesforce object type
  • object_id: Salesforce ID of the object
  • action: Action performed (assign, convert, merge, enrich)
  • pool: Round-robin pool name (for assign actions)
  • assigned_to: Salesforce ID of assigned user (for assign actions)
  • prev_owner: Previous owner ID (for assign/convert actions)
  • sequence: Round-robin sequence number (for assign actions)
  • reason: Reason for the action
  • request_id: Request ID for tracking
  • idempotency_key: Idempotency key for duplicate prevention
  • diff: Field changes for enrichment/merge actions

Export Formats

JSON Format (Default)

Returns structured JSON data with full field information.

CSV Format

Returns comma-separated values suitable for spreadsheet applications.

  • Headers: timestamp, object, object_id, action, pool, assigned_to, prev_owner, sequence, reason, request_id, idempotency_key, diff
  • Diff data is JSON-encoded in the diff column

Use Cases

  • Audit Compliance: Track all actions for regulatory compliance
  • Performance Analysis: Analyze routing patterns and efficiency
  • User Activity: Monitor user assignments and activity
  • Enrichment Tracking: Track data enrichment changes and sources
  • Troubleshooting: Debug routing issues and user assignments

Retention Policy

  • Default Retention: 365 days
  • Maximum Retention: 1095 days (3 years)
  • Auto Cleanup: Enabled by default (daily at 2 AM)
  • Configurable: Retention can be adjusted per organization

Rate Limits

  • Standard Export: 10 requests per minute
  • Large Exports: 2 requests per minute (for exports > 5000 records)
  • Statistics: 20 requests per minute
Security
BearerAuth
Query
from_datestring, (date-time)(From Date)required

Start date for log export (ISO format)

to_datestring, (date-time)(To Date)required

End date for log export (ISO format)

poolstring or null(Pool)
Any of:

Filter by specific pool name

string
objectstring or null(Object)
Any of:

Filter by specific object type

string
actionstring or null(Action)
Any of:

Filter by specific action type

string
formatstring(Format)

Export format (json, csv)

Default:"json"
include_diffboolean(Include Diff)

Include diff data in export

Default:true
limitinteger, [ 1 .. 10000 ](Limit)

Maximum number of records to return

Default:1000
curl -i -X GET \
  'https://api-gateway.agenthq.withlantern.com/v1/logs/routing?from_date=2019-08-24T14%3A15%3A22Z&to_date=2019-08-24T14%3A15%3A22Z&pool=string&object=string&action=string&format=json&include_diff=true&limit=1000' \
  -H 'Authorization: Bearer <YOUR_ApiToken_HERE>'

Responses

Success Response

Bodyapplication/json
Array [
timestampstring, (date-time)(Timestamp)required

ISO timestamp of the action

objectstring(Object)required

Salesforce object type

Enum:"Lead""Contact""Account""Opportunity"
object_idstring(Object Id)required

Salesforce ID of the object

actionstring(Action)required

Action performed on the object

Enum:"assign""convert""merge""enrich"
poolstring or null(Pool)
Any of:

Round-robin pool name (for assign actions)

string
assigned_tostring or null(Assigned To)
Any of:

Salesforce ID of assigned user (for assign actions)

string
prev_ownerstring or null(Prev Owner)
Any of:

Previous owner ID (for assign/convert actions)

string
sequenceinteger or null(Sequence)
Any of:

Round-robin sequence number (for assign actions)

integer
reasonstring or null(Reason)
Any of:

Reason for the action (e.g., 'round_robin', 'manual_override')

string
request_idstring or null(Request Id)
Any of:

Request ID for tracking

string
idempotency_keystring or null(Idempotency Key)
Any of:

Idempotency key for duplicate prevention

string
diffobject or null(Diff)
Any of:

Field changes for enrichment/merge actions

]
Response
[ { "timestamp": "2025-09-18T16:12:00Z", "object": "Lead", "object_id": "00Qxx0000Lm789U", "action": "assign", "pool": "SDR_WEST_01", "assigned_to": "005xx0002ABCDE", "prev_owner": "005xx0001ZZZZZ", "sequence": 1245, "reason": "round_robin", "request_id": "req_abc123", "idempotency_key": "c1f2-..." }, { "timestamp": "2025-09-18T16:15:00Z", "object": "Lead", "object_id": "00Qxx0000Lm78AA", "action": "enrich", "reason": "auto_enrichment", "request_id": "req_def456", "idempotency_key": "a3b4-...", "diff": {} } ]