Create a job and book a visit from your own system
developers-create-job-and-visitOn this page
Find or create the contact, create the job, then schedule a visit for a technician.
Your app needs the scopes read:contacts, write:contacts, write:jobs, read:technicians and write:visits. In the examples, $SKEDULER_API is your Skeduler API address. Contact Skeduler support if you don't have it. In the JavaScript and PHP tabs, the same names in capitals (SKEDULER_API, ACCESS_TOKEN and so on) are variables you set.
Who can do this: Owners and Admins with the Manage Developer Tools permission.
Send a fresh Idempotency-Key on each write, and the same key when you retry it. See Safe retries.
1. Find or create the contact
curl
curl -s "$SKEDULER_API/api/v1/contacts?email=sam@example.com" \
-H "Authorization: Bearer $ACCESS_TOKEN"
JavaScript (fetch)
const res = await fetch(`${SKEDULER_API}/api/v1/contacts?email=sam@example.com`, {
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
},
});
const data = await res.json();
PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', "$SKEDULER_API/api/v1/contacts?email=sam@example.com", [
'headers' => [
'Authorization' => "Bearer $ACCESS_TOKEN",
],
]);
$data = json_decode((string) $res->getBody(), true);
If data is empty, create one:
curl
curl -s -X POST "$SKEDULER_API/api/v1/contacts" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{"first_name":"Sam","last_name":"Rivera","email":"sam@example.com","mobile_phone":"0400 000 000"}'
JavaScript (fetch)
const res = await fetch(`${SKEDULER_API}/api/v1/contacts`, {
method: "POST",
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({"first_name": "Sam", "last_name": "Rivera", "email": "sam@example.com", "mobile_phone": "0400 000 000"}),
});
const data = await res.json();
PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$res = $client->request('POST', "$SKEDULER_API/api/v1/contacts", [
'headers' => [
'Authorization' => "Bearer $ACCESS_TOKEN",
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'json' => ['first_name' => 'Sam', 'last_name' => 'Rivera', 'email' => 'sam@example.com', 'mobile_phone' => '0400 000 000'],
]);
$data = json_decode((string) $res->getBody(), true);
Keep the contact's id.
2. Create the job
curl
curl -s -X POST "$SKEDULER_API/api/v1/jobs" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{"title":"Hot water system replacement","customer_id":"<contact id>","address_line_1":"1 Example St","city":"Sydney","state":"NSW","postal_code":"2000"}'
JavaScript (fetch)
const res = await fetch(`${SKEDULER_API}/api/v1/jobs`, {
method: "POST",
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({"title": "Hot water system replacement", "customer_id": "<contact id>", "address_line_1": "1 Example St", "city": "Sydney", "state": "NSW", "postal_code": "2000"}),
});
const data = await res.json();
PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$res = $client->request('POST', "$SKEDULER_API/api/v1/jobs", [
'headers' => [
'Authorization' => "Bearer $ACCESS_TOKEN",
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'json' => ['title' => 'Hot water system replacement', 'customer_id' => '<contact id>', 'address_line_1' => '1 Example St', 'city' => 'Sydney', 'state' => 'NSW', 'postal_code' => '2000'],
]);
$data = json_decode((string) $res->getBody(), true);
Only title is required. To set a status, priority, lead source or call-out fee, take their ids from GET /job-lookups (it needs read:jobs). If you leave the status out, the default is used. Keep the job's id.
3. Pick a technician
curl
curl -s "$SKEDULER_API/api/v1/technicians" -H "Authorization: Bearer $ACCESS_TOKEN"
JavaScript (fetch)
const res = await fetch(`${SKEDULER_API}/api/v1/technicians`, {
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
},
});
const data = await res.json();
PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', "$SKEDULER_API/api/v1/technicians", [
'headers' => [
'Authorization' => "Bearer $ACCESS_TOKEN",
],
]);
$data = json_decode((string) $res->getBody(), true);
The list has your active technicians, ordered by name, and every id in it can take a visit. Deactivated technicians are left out. Send include_inactive=true only when you need them too, for example to show who did older visits: they come back with "active": false. Pick the technician for a visit from the default list only.
To check a technician's time off before you pick a time, read their leave and time blocks. See Read technicians' leave and time blocks.
4. Schedule the visit
curl
curl -s -X POST "$SKEDULER_API/api/v1/visits" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{"job_id":"<job id>","technician_id":"<technician id>","start_at":"2026-12-01T09:00:00+11:00","end_at":"2026-12-01T11:00:00+11:00","dispatch":true}'
JavaScript (fetch)
const res = await fetch(`${SKEDULER_API}/api/v1/visits`, {
method: "POST",
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({"job_id": "<job id>", "technician_id": "<technician id>", "start_at": "2026-12-01T09:00:00+11:00", "end_at": "2026-12-01T11:00:00+11:00", "dispatch": true}),
});
const data = await res.json();
PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$res = $client->request('POST', "$SKEDULER_API/api/v1/visits", [
'headers' => [
'Authorization' => "Bearer $ACCESS_TOKEN",
'Idempotency-Key' => bin2hex(random_bytes(16)),
],
'json' => ['job_id' => '<job id>', 'technician_id' => '<technician id>', 'start_at' => '2026-12-01T09:00:00+11:00', 'end_at' => '2026-12-01T11:00:00+11:00', 'dispatch' => true],
]);
$data = json_decode((string) $res->getBody(), true);
- Times need a UTC offset (or
Z).end_atmust be afterstart_at. "dispatch": truesends the visit to the technician's list now. It never changes the visit'sstatus.- Leave
technician_idout for an unassigned visit. - The technician must be a current team member without blocked time (such as leave) in that window, or the call is refused. See My request fails with validation_failed.
The new job and visit show in the Skeduler app straight away.
Related
In this section
- Change a job's status
- Push leads from your website into Skeduler
- Read a job's notes
- Read technicians' leave and time blocks
- Record a payment on an invoice
- API reference
- Authentication API
- Contacts API
- Credit Notes API
- Customers API
- Estimates API
- Invoices API
- Jobs API
- Payments API
- Schedule blocks API
- Technicians API
- Visits API
- Webhooks API
- Customers or contacts, which endpoint do I use?