Skip to main content
POST
/
back-office
/
sync
/
historical
Trigger Historical Sync
curl --request POST \
  --url https://api.example.com/back-office/sync/historical \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "connectionId": "<string>",
  "startDate": "<string>",
  "endDate": "<string>",
  "allInvoices": false,
  "useWorker": false,
  "invoiceIds": [
    "<string>"
  ],
  "customerIds": [
    "<string>"
  ],
  "jobType": "sync_invoice",
  "slackUsername": "<string>"
}
'
{
  "data": {
    "message": "<string>",
    "connectionId": "<string>",
    "mode": "LOCAL",
    "syncOptions": {
      "allInvoices": true,
      "useWorker": true,
      "startDate": "<string>",
      "endDate": "<string>",
      "invoiceIds": [
        "<string>"
      ],
      "customerIds": [
        "<string>"
      ],
      "jobType": "sync_customer",
      "slackUsername": "<string>"
    }
  },
  "code": "health_status_ok",
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Historical sync parameters

connectionId
string
required

The unique identifier of the connection to sync

Minimum string length: 1
startDate
string

Start date in YYYY-MM-DD format

endDate
string

End date in YYYY-MM-DD format

allInvoices
boolean
default:false

Whether to fetch all invoices or only OPEN ones

useWorker
boolean
default:false

Whether to enqueue to SQS for distributed processing

invoiceIds
string[]

Optional array that will not work with date range to fetch a specific list of invoices

customerIds
string[]

Optional array of customer IDs to sync (for rutter integrations use emails)

jobType
enum<string>
default:sync_invoice

Type of sync job to run

Available options:
sync_customer,
sync_invoice
slackUsername
string

Optional Slack username to notify when sync completes (without @)

Response

Historical sync triggered successfully

data
object
required
code
enum<string>
Available options:
health_status_ok,
health_status_error,
validation_error,
bad_request,
unauthorized,
forbidden,
not_found,
method_not_allowed,
internal_server_error,
organization_not_found,
cannot_access_organization,
api_key_not_found,
resource_already_exists
message
string