Find and book an optimal appointment slot using Salesforce Field Service's Scheduling API.
domain: developer.salesforce.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
In-depth guide
Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to developer.salesforce.com, checked against official docs, with linked verified routes.
Steps
Call the getAppointmentCandidates REST/Apex method with the ServiceAppointment ID (and work type/territory context) to get ranked resource+timeslot candidates.
Alternatively call getAppointmentSlots (via the Scheduler Apex methods) for lighter-weight available-slot lookups.
Book a chosen candidate by updating the ServiceAppointment (assigned resource + scheduled window) or via the booking method tied to the candidate response.
For batch/route-level optimization instead of one appointment, invoke the FSL_ScheduleService Apex class or the org's configured Scheduling Policy through the Optimization services.
Read back the ScheduleResult to confirm success/failure and any policy violations.
Known gotchas
Which endpoints are available (REST vs Apex-only) depends on the Field Service edition/add-on (Scheduling vs full Optimization); not all orgs have Optimization enabled.
Candidate ranking depends entirely on the org's configured Scheduling Policy — results aren't comparable across orgs with different policies.
These are managed-package APIs, so exact method signatures can change between Field Service package versions; verify against the customer's installed version.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?