- Base URL:
https://address.sls.epilot.io - Full API Docs: https://docs.epilot.io/api/address
import { epilot } from '@epilot/sdk' epilot.authorize(() => '<token>') const { data } = await epilot.address.getAddressSuggestions(...)
import { getClient, authorize } from '@epilot/sdk/address' const addressClient = getClient() authorize(addressClient, () => '<token>') const { data } = await addressClient.getAddressSuggestions(...)
Address Suggestion
Availability
Location
Schemas
ResolveLocationParamsResolveLocationResultAddressValueAvailabilityCheckParamsAvailabilityFiltersAvailabilityDateAvailabilityLocationAvailabilityResultValidateAvailabilityFileResultValidateAvailabilityFileErrorAddressSuggestionAddressSuggestionsErrorResponse
Get address suggestions for the given Availability File
GET /v1/public/suggestions
const { data } = await client.getAddressSuggestions({ fileRef: 'example', countryCodeSearchTerm: 'example', postalCodeSearchTerm: 'example', streetSearchTerm: 'example', })
Response
[
{
"country": "st",
"postal_code": "string",
"city": "string",
"street": "string",
"street_number": "string"
}
]Check for Entities that contain a matching availability range in related availability files.
POST /v1/public/availability
const { data } = await client.availabilityCheck( null, {}, )
Response
{
"available_entities": [],
"check_results": [
{
"entity_id": "72c803b2-2e5d-4bd6-bffc-fad998bbbe36",
"matching_hits": 0
},
{
"entity_id": "72c803b2-2e5d-4bd6-bffc-fad998bbbe37",
"matching_hits": 0
}
]
}Resolve or create the canonical Location for a raw address (find-or-create by canonical address_hash) and return its id. This is the dedup-safe way to create a Location — direct entity creation of `lo
POST /v1/public/location-service/resolve
const { data } = await client.resolveLocation( null, { address: { street: 'string', street_number: 'string', postal_code: 'string', city: 'string', suburb: 'string', state: 'string', country: 'string', latitude: 0, longitude: 0 }, entityId: '3fa85f64-5717-4562-b3fc-2c963f66afa6', entitySlug: 'string' }, )
Response
{
"locationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created": true
}Validates an already uploaded availability file, it returns an array of errors if any errors are found in the file.
GET /v1/availability/{id}/validate
const { data } = await client.validateAvailabilityFile({ id: '123e4567-e89b-12d3-a456-426614174000', })
Response
{
"status": "success",
"rules_parsed_count": 0,
"errors": [
{
"line": 0,
"message": "string",
"data": "string"
}
]
}type ResolveLocationParams = { address: { street?: string street_number?: string postal_code?: string city?: string suburb?: string state?: string country?: string latitude?: number longitude?: number } entityId?: string // uuid entitySlug?: string }
type ResolveLocationResult = { locationId: string // uuid created: boolean }
A raw address. Provide EITHER a street address (street + street_number + (postal_code or city)) OR coordinates (latitude + longitude). Only the string fields drive the canonical address hash; for a street address the coordinates are stored as-is on the Location, while a coordinate-only a
type AddressValue = { street?: string street_number?: string postal_code?: string city?: string suburb?: string state?: string country?: string latitude?: number longitude?: number }
type AvailabilityCheckParams = { entities: string // uuid[] schemas?: string[] filters: { location: { street?: { ... } street_number?: { ... } postal_code?: { ... } city?: { ... } country?: { ... } } available_date?: string // date } }
Availability filters dimensions
type AvailabilityFilters = { location: { street?: string street_number?: string postal_code?: string city?: string country?: string } available_date?: string // date }
A value to be matched against the availability window (start & end date)
type AvailabilityDate = string // date
type AvailabilityLocation = { street?: string street_number?: string postal_code?: string city?: string country?: string }
The availability check result payload
type AvailabilityResult = { available_entities: string[] check_results: Array<{ entity_id: string // uuid matching_hits: number matching_error?: object }> }
The availability map file result payload
type ValidateAvailabilityFileResult = { status: "success" | "error" rules_parsed_count: number errors: Array<{ line?: number message: string data?: string }> }
The availability rule error
type ValidateAvailabilityFileError = { line?: number message: string data?: string }
The address suggestions entity
type AddressSuggestion = { country?: string postal_code?: string // postal-code city?: string // city street?: string // street-address street_number?: string // street-number }
The address suggestions entity array
type AddressSuggestions = Array<{ country?: string postal_code?: string // postal-code city?: string // city street?: string // street-address street_number?: string // street-number }>
type ErrorResponse = { error: string }