Bring Your Own API for Timezone Inference

Overview

ExpertFlow resolves each contact's timezone and region (jurisdiction) to enforce regional calling-window rules for outbound compliance. By default, the platform uses built-in phone area-code and Canadian postal-code inference.

Bring Your Own API (BYO API) lets you register an HTTPS endpoint — operated by your organization or a trusted geolocation vendor — that ExpertFlow calls when a contact is created or updated. Your API returns the timezone and region used for calling compliance.

This option is intended for organizations that:

  • Already maintain accurate location data in a CRM or data warehouse

  • Use a specialized geolocation or compliance vendor

  • Need higher accuracy than area-code / postal-code inference (e.g. mobile number portability)

Related guide: Automated Regional Compliance for Outbound Calling — overview of calling-window enforcement, CSV preparation, and built-in timezone resolution.

When the BYO API is Used

When CHECK_TIMEZONE is enabled and a BYO API is configured for your tenant, resolution follows this priority order:

Priority

Source

Description

1

Explicit CSV/API fields

Both timezone and region provided on the contact — BYO API is not called

2

Your BYO API

ExpertFlow calls your registered HTTPS endpoint

3

Built-in inference

Phone area code (US) or phone + postal code (Canada)

4

Quarantine

Contact cannot be resolved; excluded from dialling

If your BYO API fails or returns unresolved, behavior is configurable per tenant: fail closed (contact quarantined) or fallback to built-in inference.

Integration Model

Item

Specification

Protocol

HTTPS only (TLS 1.2+)

Method

POST

Content type

application/json

Timeout

3 seconds recommended (configurable, max 10 seconds)

Bulk import

One API call per contact (no batch endpoint in v1)

Request — What ExpertFlow Sends

ExpertFlow sends a JSON object containing the contact fields available at resolution time, plus request metadata for tracing.

Request body example

JSON
{
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "tenantId": "acme-corp",
  "timestamp": "2026-09-01T14:30:00.000Z",
  "customer": {
    "_id": "64f1a2b3c4d5e6f7a8b9c0d1",
    "phoneNumber": ["+14165551212"],
    "postalCode": "M5V 1A1",
    "timezone": null,
    "region": null,
    "firstName": "Jane",
    "lastName": "Doe",
    "email": ["jane.doe@example.com"],
    "addressLine1": "123 King St W",
    "city": "Toronto",
    "state": "ON",
    "country": "CA"
  }
}

Request fields

Metadata (required)

Field

Type

Description

requestId

string (UUID)

Unique ID for this resolution attempt

tenantId

string

Tenant identifier

timestamp

string (ISO 8601 UTC)

Time the request was sent

Customer object

Field

Type

Required

Description

customer

object

Yes

Contact record at time of resolution

customer._id

string

No

Contact ID in ExpertFlow (if already persisted)

customer.phoneNumber

string or string[]

Recommended

Primary phone number(s)

customer.postalCode

string

No

Postal or ZIP code

customer.timezone

string

No

Pre-supplied IANA timezone, if any

customer.region

string

No

Pre-supplied region code, if any

customer.firstName

string

No

Contact first name

customer.lastName

string

No

Contact last name

customer.email

string or string[]

No

Email address(es)

customer.addressLine1

string

No

Street address

customer.city

string

No

City

customer.state

string

No

State or province

customer.country

string

No

Country (ISO 3166-1 alpha-2 preferred)

The customer object may include additional custom attributes defined in your tenant schema. ExpertFlow does not guarantee every field is populated.

Response — What ExpertFlow Expects

Your API must return JSON with either a successful resolution or an explicit unresolved result.

Successful resolution

JSON
{
  "resolved": true,
  "timezone": "America/Toronto",
  "region": "CA-ON",
  "timezoneConfidence": "CONFIRMED",
  "timezoneSource": "EXTERNAL_API"
}

Unresolved (fail closed)

JSON
{
  "resolved": false,
  "reason": "INSUFFICIENT_DATA",
  "message": "Phone number and postal code could not be matched to a jurisdiction"
}

Response fields

Success (resolved = true)

Field

Type

Required

Description

resolved

boolean

Yes

Must be true

timezone

string

Yes

Valid IANA timezone (e.g. America/Toronto)

region

string

Yes

Jurisdiction code: CC-XX (e.g. CA-ON, US-FL)

timezoneConfidence

string

No

CONFIRMED or INFERRED (defaults to CONFIRMED)

timezoneSource

string

No

Defaults to EXTERNAL_API

Failure (resolved = false)

Field

Type

Required

Description

resolved

boolean

Yes

Must be false

reason

string

Yes

Machine-readable reason code (see below)

message

string

No

Human-readable explanation for logs

Standard reason codes

Code

Description

INSUFFICIENT_DATA

Not enough fields to resolve

INVALID_PHONE

Phone number invalid or unparseable

INVALID_POSTAL_FORMAT

Postal code format invalid

PHONE_POSTAL_MISMATCH

Phone and postal point to different jurisdictions

AMBIGUOUS_LOCATION

Multiple possible timezones or regions

NOT_FOUND

No match in your database

VENDOR_ERROR

Internal processing error

Authentication

Configure how ExpertFlow authenticates to your endpoint:

Method

How ExpertFlow sends credentials

API key (header)

Authorization: Bearer <api-key> or X-Api-Key: <key>

Basic auth

Authorization: Basic <base64(user:password)>

mTLS

Client certificate configured at deployment level

HTTP Status Codes

HTTP status

ExpertFlow behavior

200 OK

Parse JSON body; apply resolved result

400 Bad Request

Treat as unresolved (VENDOR_ERROR)

401 / 403

Log auth failure; treat as unresolved

429 Too Many Requests

Retry with backoff (up to 2 retries); then unresolved

5xx

Retry once; then unresolved or fallback

Timeout

Treat as unresolved or fallback

Examples

Canadian contact — success

Request: phoneNumber = 4165551212, postalCode = M5V 1A1

Response: timezone = America/Toronto, region = CA-ON, timezoneConfidence = CONFIRMED

US contact — success

Request: phoneNumber = +14155551234, postalCode = 94105, state = CA

Response: timezone = America/Los_Angeles, region = US-CA, timezoneConfidence = CONFIRMED

Unresolved — insufficient data

Request: only firstName and lastName provided

Response: resolved = false, reason = INSUFFICIENT_DATA

ExpertFlow result: contact quarantined (timezoneConfidence = UNRESOLVED_TIMEZONE)

Validation Rules

ExpertFlow validates your response before applying it to the contact:

  • timezone must be a valid IANA timezone string

  • region must match ^(CA|US)-[A-Z]{2}$ for standard compliance profiles

  • Both timezone and region must be present on success

  • Invalid or missing fields are treated as unresolved

What ExpertFlow Stores on the Contact

Field

Example

timezone

America/Toronto

region

CA-ON

timezoneSource

EXTERNAL_API

timezoneConfidence

CONFIRMED

Tenant Configuration (Admin)

Setting

Description

Enable BYO API

Turn third-party resolution on/off

Endpoint URL

HTTPS URL of your API

Authentication

API key, basic auth, or mTLS

Timeout

Request timeout in milliseconds (default: 3000)

Fallback on failure

Fail closed vs. use built-in inference

Retry count

Retries on 5xx/timeout (default: 1)

Data Privacy

  • ExpertFlow sends only contact data required for timezone resolution.

  • You are responsible for your vendor's data processing agreements (DPA, GDPR, PIPEDA).

  • PII fields (name, phone, email, address) may be included in the request.

  • We recommend vendors do not persist full customer payloads unless required for audit.

SLA Recommendations

Metric

Recommended

Availability

99.9%

P95 latency

< 500 ms

P99 latency

< 2000 ms

Limitations (v1)

  • No batch/bulk endpoint — one HTTP call per contact

  • ExpertFlow does not validate vendor accuracy — you are responsible for data quality

Disclaimer: ExpertFlow does not warrant the accuracy of third-party geolocation APIs. You are responsible for ensuring your API returns correct timezone and jurisdiction data for calling compliance.