Skip to main content
POST
/
customers
/
schedule
/
sync
cURL
curl --request POST \
  --url https://api.example.com/customers/schedule/sync \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "id": "<string>",
  "taskType": "collections",
  "firstName": "<string>",
  "lastName": "<string>",
  "email": "[email protected]",
  "birthday": "1985-06-15",
  "ssnLastFour": "1234",
  "timezone": "<string>",
  "phoneNumber": "<string>",
  "streetAddress1": "123 Main St",
  "streetAddress2": "Apt 4B",
  "city": "San Francisco",
  "state": "CA",
  "zipCode": "94102",
  "doNotCall": true,
  "isTest": true,
  "test": false,
  "externalMetadata": {
    "home_phone": "+14155555555",
    "cell_phone": "+14155556666",
    "employer_name": "Acme Corporation",
    "employer_address": "456 Business Ave",
    "employer_city": "San Francisco",
    "employer_state": "CA",
    "employer_zip": "94103",
    "employer_department": "Sales",
    "employer_phone": "+14155557777",
    "employer_direct_line": "+14155558888",
    "pay_frequency": "biweekly",
    "pay_day": "Friday"
  },
  "loanIds": [
    123,
    456,
    789
  ],
  "sync": false,
  "loanId": "<string>"
}
'
{
  "id": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "scheduleCreated": true,
  "tasksCreated": 1,
  "existingTasksRemoved": 3,
  "email": "[email protected]",
  "birthday": "2023-12-25",
  "ssnLastFour": "<string>",
  "timezone": "<string>",
  "phoneNumber": "<string>",
  "streetAddress1": "<string>",
  "streetAddress2": "<string>",
  "city": "<string>",
  "state": "<string>",
  "zipCode": "<string>",
  "doNotCall": true,
  "isTest": true,
  "taskType": "<string>",
  "externalMetadata": {}
}

Overview

This endpoint provides an idempotent way to sync a customer’s call schedule. It will:
  1. Create or update the customer with the provided data
  2. Remove all pending tasks for the customer
  3. Create a new call schedule based on the task type
Calling this endpoint multiple times with the same data will produce the same result, making it safe for retries and integration workflows.

Authentication

Authentication via X-API-Key header. See Authentication for details.

Request Body

The request accepts the same fields as the Create Customer endpoint, with all the same validations and requirements.

Required Fields

  • id - External customer reference ID
  • firstName - Customer’s first name
  • lastName - Customer’s last name
  • email - Customer email address
  • birthday - Customer birthday (YYYY-MM-DD format)
  • ssnLastFour - Last 4 digits of SSN
  • phoneNumber - Customer’s phone number (required) - Used for automated calling and SMS communications
  • timezone - Customer’s timezone as an IANA timezone name (e.g., “America/New_York”, “America/Los_Angeles”, “America/Chicago”) (required) - Required for TCPA compliance to ensure calls are made during appropriate hours. Must be a valid IANA timezone identifier.
  • taskType - Task type for customer’s call schedule
  • streetAddress1 - Street address line 1
  • city - City name
  • state - State code (e.g., “NY”, “CA”)
  • zipCode - ZIP/postal code

Optional Fields

  • doNotCall - Whether to mark customer for Do Not Call (optional; if not provided, existing value is preserved)
  • test - Mark customer as test customer (default: false)
  • externalMetadata - Custom JSON object with additional customer data
  • streetAddress2 - Street address line 2
  • loanId - LMS loan ID for enrichment
  • sync - When true, auto-fetch missing customer data from your company’s LMS (default: false). See the Create Customer endpoint for details.

Response Body

The API returns all customer fields that were provided in the request body, along with any computed fields and sync operation metadata. This includes:
  • Basic Information: id, firstName, lastName, email, phoneNumber, timezone
  • Personal Information: birthday, ssnLastFour
  • Address Information: streetAddress1, streetAddress2, city, state, zipCode
  • Configuration: taskType, doNotCall, isTest
  • Custom Data: externalMetadata - The complete metadata object you provided
  • Sync Metadata: schedule_created, tasks_created, existing_tasks_removed - Information about the sync operation performed
All fields that were included in the request will be returned in the response, along with sync metadata that indicates what actions were taken during the sync operation.

Sync Metadata Fields

In addition to all the customer fields, the response includes three metadata fields that describe the sync operation:
  • schedule_created (boolean): Whether a new schedule was created during this sync operation. This will be true if the customer has both a valid timezone and phone number, and false if either is missing.
  • tasks_created (integer): The number of new tasks created as part of the schedule.
  • existing_tasks_removed (integer): The number of pending tasks that were removed before creating the new schedule. This ensures a clean slate for the new schedule and prevents duplicate tasks.

Schedule Creation

The response will indicate whether the schedule was successfully created via the schedule_created field.

Do Not Call Validation

If an existing customer is already marked as Do Not Call, the endpoint will return a 400 error unless you explicitly set doNotCall: false in the request. Behavior:
  • If doNotCall is not provided (omitted from request) and the customer has Do Not Call status → Error (prevents accidental schedule creation)
  • If doNotCall: true and the customer has Do Not Call status → Error (attempting to maintain Do Not Call while creating schedule)
  • If doNotCall: false and the customer has Do Not Call status → Success (explicitly removing Do Not Call and creating schedule)
  • If doNotCall is not provided and the customer does NOT have Do Not Call status → Success (preserves existing state)

Idempotency

This endpoint is designed to be idempotent:
  • If a customer with the given id exists, it will be updated
  • All pending tasks are removed before creating the new schedule
  • Calling the endpoint multiple times with the same data produces the same result
  • Safe for retries in case of network failures or integration workflows

Use Cases

This endpoint is useful for:
  • Re-syncing customer data from external systems
  • Resetting call schedules after customer information changes
  • Bulk customer updates where you want to ensure consistent state
  • Integration workflows that need guaranteed idempotency

Authorizations

X-API-Key
string
header
required

Body

application/json

Customer data to sync

id
string
required

Unique identifier for the customer. This is your customer reference and should match your internal system's ID.

taskType
string
required

Type of tasks to create for the customer's automated call schedule. Valid values depend on company configuration. This field is required.

Example:

"collections"

firstName
string

The first name of the customer

lastName
string

The last name of the customer

email
string<email>

Customer email address

birthday
string<date>

Customer birthday in YYYY-MM-DD format

Example:

"1985-06-15"

ssnLastFour
string

Last 4 digits of SSN

Example:

"1234"

timezone
string

Timezone of the customer (IANA timezone name, e.g., 'America/New_York', 'America/Los_Angeles')

phoneNumber
string

Phone number of the customer

streetAddress1
string

Street address line 1

Example:

"123 Main St"

streetAddress2
string

Street address line 2 (optional)

Example:

"Apt 4B"

city
string

City

Example:

"San Francisco"

state
string

State code

Example:

"CA"

zipCode
string

ZIP/postal code

Example:

"94102"

doNotCall
boolean

Do not call the customer

isTest
boolean

Indicates if this is a test customer

test
boolean
default:false

Mark customer as test customer

externalMetadata
object

Additional custom metadata about the customer (e.g. employer information, pay schedule, additional contact details)

loanIds
integer[]

Array of loan IDs to import. If provided, only these loans are imported. If omitted, all loans are imported.

Example:
[123, 456, 789]
sync
boolean
default:false

When true, auto-fetch missing customer data from your integrated lending system. Defaults to false.

loanId
string

Loan reference ID for enrichment. Distinct from loanIds which filters loan imports.

Response

Customer schedule synced successfully

id
string
required

Customer ID (reference_id)

firstName
string
required

Customer's first name

lastName
string
required

Customer's last name

scheduleCreated
boolean
required

Whether a new schedule was created during this sync operation

Example:

true

tasksCreated
integer
required

Number of new tasks created as part of the schedule

Example:

1

existingTasksRemoved
integer
required

Number of pending tasks that were removed before creating the new schedule

Example:

3

email
string<email>

Customer email address

birthday
string<date>

Customer birthday in YYYY-MM-DD format

ssnLastFour
string

Last 4 digits of SSN

timezone
string

Timezone of the customer (IANA timezone name, e.g., 'America/New_York', 'America/Los_Angeles')

phoneNumber
string

Phone number of the customer

streetAddress1
string

Street address line 1

streetAddress2
string

Street address line 2 (optional)

city
string

City name

state
string

State code (e.g., NY, CA)

zipCode
string

ZIP/postal code

doNotCall
boolean

Do not call the customer

isTest
boolean

Indicates if this is a test customer

taskType
string

Type of tasks created for the customer's automated call schedule

externalMetadata
object

Additional custom metadata about the customer