Skip to content

Finding a customer

A job is created for an existing customer, at one of their sites, against one of their contacts. So before POST /jobs there is a lookup: turn what your system knows — an email address, a phone number — into the three IDs EyeOnTask needs.

All three endpoints here are read-only and scoped to your own company.

GET {BASE_URL}/customers?email=customer@example.com
GET {BASE_URL}/customers?phone=%2B919876543210
GET {BASE_URL}/customers?name=Acme%20Services

At least one parameter is required, and matching is exact — this is a lookup, not a search box.

{
"success": true,
"data": [
{
"id": 501,
"name": "Acme Services",
"matched_contact": {
"id": 901,
"name": "Ravi Kumar",
"email": "customer@example.com",
"mobile1": "+919876543210",
"mobile2": ""
}
}
],
"pagination": { "index": 0, "limit": 50, "returned": 1, "total": 1, "has_more": false },
"request_id": "req_abc123",
"timestamp": "2026-09-07T12:00:00Z"
}

matched_contact tells you which contact caused the match, which is often the contact you then want on the job.

  • email or phone wins over name. Send either one and name is ignored.
  • name is used only when both email and phone are absent.
  • Email matching is case-insensitive.
  • Phone matching is normalised — spaces, +, - and brackets are stripped, and the last 10 digits are compared. So +91 98765 43210 and 9876543210 find the same person.
  • A match on either is enough. The customer comes back whether it was the email or the phone that hit.
  • If email matches one customer and phone matches another, both are returned. That is not an error; it is two records that disagree about who owns that contact detail.
  • A customer with several matching contacts appears once, not once per contact.

When total is greater than one, do not automatically pick data[0]. More than one match means the question was ambiguous, and choosing for the user is how a job ends up on the wrong company’s account.

Put it in front of a person, or narrow it with a second parameter. Silently guessing is the failure that shows up weeks later as an invoice to the wrong client.

No match at all comes back as an empty data array with "total": 0 — not an error. For a customer who does not exist yet, create a request with their details rather than a job; requests can carry a new customer, jobs cannot.

GET {BASE_URL}/customers/{customer_id}/sites

Returns the customer’s active sites.

{
"success": true,
"data": [
{
"id": 701,
"name": "Main Office",
"address": "10 Main Street",
"city": "Mumbai",
"state_id": 22,
"country_id": 101,
"zip_code": "400001"
}
],
"pagination": { "index": 0, "limit": 50, "returned": 1, "total": 1, "has_more": false },
"request_id": "req_651e123f2f893fde",
"timestamp": "2026-09-07T12:00:00Z"
}

A client with thirty buildings has thirty sites, and the site decides where the fieldworker drives — see sites and contacts.

GET {BASE_URL}/customers/{customer_id}/contacts

Returns the customer’s active contacts.

{
"success": true,
"data": [
{
"id": 901,
"name": "Ravi Kumar",
"email": "customer@example.com",
"mobile1": "+919876543210",
"mobile2": ""
}
],
"pagination": { "index": 0, "limit": 50, "returned": 1, "total": 1, "has_more": false },
"request_id": "req_05db0bdd670d25cf",
"timestamp": "2026-09-07T12:00:00Z"
}

The contact is who the fieldworker asks for on arrival, so it is worth sending the one who actually knows about the visit rather than whichever came back first.