DspatchDevelopers

Dspatch API

A clean REST API and signed webhooks for everything your business does on Dspatch - customers, jobs and their proof of service, recurring schedules, quotes, invoices, payments, crews, time off, Rentals & Hotels and reports. Available on the Pro and Enterprise plans.

Base URL: https://dspatch.io/api/v1/ · Format: JSON · Version: v1 · Machine-readable spec: openapi.json

curl https://dspatch.io/api/v1/me/ \
  -H "Authorization: Bearer dsk_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Authentication

Create a key in your admin portal under Integrations → API & Webhooks. Keys act as your business (not as a person), carry only the scopes you give them, and are shown once. Send the key as a bearer token or in X-API-Key.

Authorization: Bearer dsk_live_...
# or
X-API-Key: dsk_live_...
Keep keys server-side. Revoke a key from Integrations the moment it may have leaked; a revoked key fails with 401 immediately.

A key carries only scopes for areas its maker's role includes: an admin whose owner turned off Reports or Payables cannot make a key that reads them. When someone stops being an owner or admin (deactivated, removed or moved to another role), the keys they made are revoked and the webhook endpoints they added are paused; the owner can make new keys and resume endpoints.

Scopes

ScopeGrants
read:customersList and read customers and sites, and each customer's monthly service reports
write:customersCreate and update customers
read:jobsList and read jobs (visits), and each visit's proof of service
write:jobsCancel a visit that has not started
read:schedulesRecurring schedules
write:schedulesEnd a recurring schedule (its visits after the end that nobody started are deleted)
read:quotesQuotes, including the service agreement text, and each quote's PDF
read:invoicesInvoices with their payments, and each invoice's PDF
write:invoicesRecord an offline payment (check, cash, bank transfer)
read:paymentsPayments across invoices
read:crewsCrews and members, without pay
read:payrollCrew members' pay type and pay rate (with read:crews)
read:time_offCrew time off: requested, approved, denied (the reason a person gave stays private)
read:rentalsRentals & Hotels: properties, rooms, stays, cleanings and the housekeeping board
write:rentalsSet the housekeeping board and room status, add or remove stays typed in by hand, approve a cleaning
read:rental_moneyRentals & Hotels money: the ledger and performance (occupancy, ADR, RevPAR, net)
read:reportsReport summary

A key reads and changes only what its scopes name, and only in your business. Write scopes do not include the matching read scope; give a key both when it needs both.

Conventions

Errors & limits

StatusMeaning
400Validation problem - the body says what
401Missing, invalid or revoked key
403Key lacks the scope, or the plan does not include the API
404Not found in your business
409The same thing changed at the same moment (the housekeeping board) - read it again and resend
429Rate limit: 600 requests per hour per key, and 3,000 per hour per business across its keys

Ids in paths are numbers; anything else is a 404. Request bodies are JSON objects, and text may not contain NUL characters.

Customers

GET /customers/ qactive · GET /customers/{id}/ (includes sites) · POST /customers/ · PATCH /customers/{id}/ ("active": false deletes it as Dspatch does: see the changelog for 2026-11-29)

A customer's po_number is its purchase order number: new invoices for it start with that number, unless the site has its own (sites carry po_number too). Up to 60 characters; "" clears it.

GET /customers/{id}/service-reports/ - the last 12 months with finished visits (months: month, label, visits). With month (?month=2026-10): that month's service report, site by site: each visit's job, date, minutes_on_site, people, checklist done and total, photos, signed_off_by, issues and report_url, the totals, and pdf. GET /customers/{id}/service-reports/{YYYY-MM}/pdf/ - the same month as the PDF the client gets (application/pdf). Times on site follow the business's Service Reports settings.

curl -X POST https://dspatch.io/api/v1/customers/ -H "Authorization: Bearer dsk_live_..." \
  -H "Content-Type: application/json" -d '{"name":"Wausau Country Club","kind":"commercial","billing_email":"ap@wausaucc.com"}'

Sites

GET /sites/ customer

Jobs

GET /jobs/ statusfromtocustomer · GET /jobs/{id}/ · POST /jobs/{id}/cancel/ · GET /jobs/{id}/service-report/

Statuses: draft, scheduled, in_progress, on_break, completed, ready_to_invoice, cancelled.

Arrival: arrival_window_minutes is the arrival window promised to the customer (null when there is none). arrive_by is when the visit becomes late: the end of the window, or 15 minutes after scheduled_start without one. first_check_in is the first crew check-in. arrival_status is on_time, late, not_due (no check-in yet and still before arrive_by) or null for a cancelled visit. The Dspatch apps, alerts and reports use the same rule.

Proof of service: service_report_url is the visit's report page (the link the Job completed email carries) once the visit is finished and the business has Service Reports on; null otherwise. /jobs/{id}/service-report/ gives the same report as data: finished, arrived_at, left_at, minutes_on_site, people, checklist (done, total, items), before_photos and after_photos (url, video), signoff (name, signed, has_signature), issues and report_url. It shows what the client's report shows (the business's Service Reports and Client Portal settings), never phone locations or crew names.

Recurring schedules

GET /schedules/ status · GET /schedules/{id}/ - rrule is an iCalendar recurrence rule (e.g. FREQ=WEEKLY;BYDAY=MO,WE,FR); arrival_window_minutes is the window every visit of the schedule promises. A schedule whose end date has passed is ended; it starts again only when the office gives it a later end date, or none.

POST /schedules/{id}/end/ write:schedules - body {"end_date": "2026-11-30"} (the last day of service, in the site's time zone; default today; at most ten years ahead). Visits after that day that nobody has started are deleted (a visit already on an invoice is cancelled instead); started visits stay. An end date of today or earlier ends the schedule now. Answers {schedule, visits_deleted, visits_cancelled}; 400 when the schedule has already ended, the date is before it starts, or it already ends on or before that date.

Quotes

GET /quotes/ status · GET /quotes/{id}/ - includes service_agreement. · GET /quotes/{id}/pdf/ - the quote as the PDF its email carries.

Invoices

GET /invoices/ statuscustomer · GET /invoices/{id}/ (includes payments, amount_due, dispute fields) · GET /invoices/{id}/pdf/ (the PDF its email carries) · POST /invoices/{id}/record-payment/ · PATCH /invoices/{id}/ - only po_number (write:invoices): the PO number shows on the invoice and its PDF and ends the subject of its emails as [PO 4500012345]; "" clears it.

curl -X POST https://dspatch.io/api/v1/invoices/1203/record-payment/ -H "Authorization: Bearer dsk_live_..." \
  -H "Content-Type: application/json" -d '{"amount":"450.00","provider":"check","reference":"#1042"}'
Card payments cannot be recorded through the API - they are collected through Dspatch so they are verified. Offline providers: check, cash, bank_transfer, zelle, venmo, other.

Payments

GET /payments/ fromto - each payment carries verified.

provider says how it was paid: stripe, square or paypal (collected through the business's connected account; verified is true), a quote deposit carried onto the invoice (deposit), or one of the providers recorded by hand (check, cash, bank_transfer, zelle, venmo, other and similar; verified is false).

Crews

GET /crews/ · GET /crews/members/ - pay_type, pay_rate and pay_currency (the currency the person is paid in) are included only for a key with read:payroll.

Time off

GET /time-off/ statusfromtocrew_member read:time_off - each entry: id, crew_member_id, crew_member, status (pending, approved, denied; filter with one or more, comma-separated), start_at, end_at, is_recurring, recur_days, created_at. The reason a person gave is never returned.

Rentals & Hotels

For businesses with Rentals & Hotels turned on (otherwise 403). Read with read:rentals, change with write:rentals; the ledger and performance need read:rental_money. Calendar links are secrets and are never returned (each calendar shows its channel, active, last_ok_at and last_error), and neither is anything a booking calendar wrote about a guest.

GET /rental-properties/ · GET /rental-properties/{id}/ - the property (kind, check-out and check-in times, cleaning settings) and its rooms or units.

GET /rental-properties/{id}/board/ date - the day's housekeeping board: each room, its status, departures and stayovers, and its cleaning. POST the same path with {"date": "2026-11-02", "departures": [unit ids], "stayovers": [unit ids]} to set the day (from yesterday to a year ahead): missing cleanings are created and assigned, and rooms set before and left out now are cancelled if nobody started them. Every id must be an active room of the property.

GET /rental-units/ property · POST /rental-units/{id}/room-status/ {"room_status": "clean"} (clean, dirty, inspected, out_of_order) · POST /rental-units/{id}/stays/ {"check_in": "2026-11-02", "check_out": "2026-11-05", "channel": "airbnb", "note": "", "is_block": false} - a stay typed in by hand (a direct booking or an owner stay); it plans cleanings like a calendar stay.

GET /rental-stays/ fromtounitproperty (default: the next 60 days) · DELETE /rental-stays/{id}/ - stays typed in by hand only; a stay from a calendar changes on its channel and Dspatch follows within 30 minutes.

GET /rental-turnovers/ fromtostatusunitproperty (default: the next 30 days) · GET /rental-turnovers/{id}/ - each cleaning: date, kind (checkout, stayover), status (planned, pending, created, cancelled), the next check-in, same_day, any flag, and its job. POST /rental-turnovers/{id}/create-job/ approves a cleaning that is waiting for approval or planned for later: its job is created and assigned now.

GET /rental-ledger/ fromtounitproperty read:rental_money (default: the last 90 days) · GET /rental-performance/ fromtounitproperty read:rental_money (default: the last 30 days) - occupancy, ADR, RevPAR, revenue, costs, cleanings and net per unit and in total.

Reports

GET /reports/summary/ fromto - collected, verified collected, jobs completed/cancelled, labor cost, open invoice balance, earned_revenue, bad_debt, disputes_lost and bad_debt_pct_of_revenue.

GET /reports/profit_and_loss/ fromto - the Dspatch P&L on the earned basis: revenue, collected, labor, other_job_costs, lead_costs, gross_profit, gross_margin_pct, processing_fees_est, bad_debt, disputes_lost, bad_debt_pct_of_revenue, net_profit, net_margin_pct. Revenue is earned when a visit is completed; costs are the same visits. Scope read:reports.

GET /reports/customer_retention/ fromto - customers won, kept and lost in the period (default: the last 90 days): active_start, active_end, served, new, signed_up, lost, kept, churn_pct, retention_pct, repeat_pct, revenue, revenue_per_customer, revenue_per_customer_month, lead_cost, cac, ltv_estimate, lost_customers (id, name, last visit, visits, 12-month revenue), series_12m (month, new, lost, active, churn_pct). A customer is active while their last completed visit is within their own lapse window (twice their usual gap, at least 90 days); lost means that window ran out during the period. Scope read:reports.

Me

GET /me/ - the business and this key's scopes and rate limit. Any valid key may call it, whatever its scopes.

Webhooks

Add an https:// endpoint in your admin portal under Integrations → API & Webhooks, choose events, and keep the signing secret (shown once). Dspatch POSTs JSON:

{
  "id": 8812, "event": "invoice.paid", "created_at": "2026-10-05T15:21:08Z", "business_id": 1,
  "data": { "id": 1203, "customer": 5511, "status": "paid", "total": "450.00", "amount_due": "0.00", ... }
}

Events

customer.created · job.created · job.completed · job.cancelled · quote.sent · quote.accepted · quote.declined · invoice.created · invoice.sent · invoice.paid · invoice.payment_processing · invoice.payment_failed · invoice.refunded · payment.received · dispute.opened · dispute.resolved · schedule.ended - or * for all.

Verifying signatures

Headers: X-Dspatch-Event, X-Dspatch-Delivery, X-Dspatch-Timestamp, X-Dspatch-Signature. The signature is sha256= + HMAC-SHA256 of timestamp + "." + rawBody with your secret. Reject timestamps older than five minutes.

# Python
import hmac, hashlib
expected = "sha256=" + hmac.new(secret.encode(), f"{ts}.{raw_body}".encode(), hashlib.sha256).hexdigest()
ok = hmac.compare_digest(expected, request.headers["X-Dspatch-Signature"])
// Node
const crypto = require("crypto");
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers["x-dspatch-signature"]));

Retries

Respond with any 2xx within 10 seconds. Otherwise Dspatch retries after 1 minute, 5 minutes and 30 minutes. After 10 consecutive failures the endpoint is paused; resume it from Integrations. Every attempt is visible in the delivery log, and Send test posts a test.ping event.

Changelog

2026-11-29 - PATCH /customers/{id}/ with "active": false now does what deleting the customer in Dspatch does: its invoice automation is turned off, its recurring schedules end and its upcoming visits that nobody started come off the schedule. Finished visits, invoices and payments stay. Setting active back to true does not restart them. POST /jobs/{id}/cancel/ is unchanged (only visits that have not started).

2026-11-29 - Crew members each have a pay currency: pay_currency on /crews/members/ (with read:payroll) names the currency their pay_rate is in. Labor costs and every total stay in the business's own currency.

2026-11-19 - PO numbers: invoices, customers and sites carry po_number (also in invoice.* webhook payloads). A new invoice starts with its site's PO number, else its customer's. Set a customer's with POST /customers/ or PATCH /customers/{id}/ and an invoice's with the new PATCH /invoices/{id}/ (write:invoices, only po_number). Additive.

2026-11-16 - Proof of service: jobs carry service_report_url (also in job.* webhook payloads, so job.completed brings the link); new GET /jobs/{id}/service-report/ (read:jobs), GET /customers/{id}/service-reports/ and GET /customers/{id}/service-reports/{YYYY-MM}/pdf/ (read:customers). PDFs: GET /quotes/{id}/pdf/ (read:quotes) and GET /invoices/{id}/pdf/ (read:invoices). Payments name square and paypal as providers alongside stripe. All additive; the scopes are the ones that already read jobs, customers, quotes and invoices.

2026-11-14 - Status: dspatch.io/status/ shows whether each part of Dspatch, the API included, is working, with incidents, planned maintenance and deprecations. The same is at GET https://dspatch.io/status.json (no key needed): status.indicator is none, maintenance, minor, major or critical, and each entry in components has a status (operational, degraded, partial_outage, major_outage, maintenance or deprecated, with replacement and sunset_on).

2026-11-13 - Refunds: payments may now have status refunded (the refunded part of a payment is split into its own row), invoices carry refund_credit (the part of refunds that lowered what the customer owes; amount_due already counts it), and the new webhook event invoice.refunded fires when a payment on an invoice is refunded, in Dspatch or directly with the payment processor. All additive; no scope changes.

2026-10-30 - New scopes and endpoints: POST /schedules/{id}/end/ (write:schedules); /time-off/ (read:time_off); Rentals & Hotels properties, rooms, board, stays, cleanings, ledger and performance (read:rentals, write:rentals, read:rental_money). Crew members' pay_type and pay_rate now need read:payroll; every existing key with read:crews was given read:payroll, so nothing changes for it. Recording a payment answers 400 for a paid or void invoice, an amount that is not a number, or more than the invoice still owes. Webhooks are delivered only to the public address the endpoint's host names, checked on every delivery, never follow redirects, are cut off after 20 seconds, and go out only while the account is active on a plan with the API. Rate limits now also cap a business at 3,000 requests an hour across its keys. Keys follow their maker's role (see Authentication). Ids that are not numbers answer 404, bodies that are not JSON objects 400.

2026-10-29 - Jobs and recurring schedules carry any_time: true when the client did not book a time, so route planning may move the visit within the work day. Additive.

2026-10-25 - Jobs carry arrival_window_minutes, arrive_by, first_check_in and arrival_status (also in job.* webhook payloads); schedules carry arrival_window_minutes. /me/ answers any valid key (it needed read:customers). Additive; no scope changes.

2026-10-23 - Reports: new /reports/customer_retention/ (customers won, kept and lost, churn, CAC, LTV estimate, the lost customers by name). Additive.

2026-10-23 - Reports: /reports/summary/ adds earned_revenue, bad_debt, disputes_lost and bad_debt_pct_of_revenue; new /reports/profit_and_loss/ returns the Dspatch P&L for a period (revenue, costs, fees, bad debt, disputes lost, subscription, net profit). Additive; no scope changes.

2026-10-19 - Invoices carry amount_in_flight and amount_payable (a bank payment that is still clearing counts as in flight and cannot be paid twice), plus written_off_amount, written_off_reason and written_off_at when an invoice was written off as bad debt; invoice status may now be written_off. Payments carry status (paid, processing, failed, pending), failure_reason and failed_at. Crew members carry employment_type (full_time, part_time, contractor), expected_hours_week, language and termination_date. New webhook events invoice.payment_processing and invoice.payment_failed. All additive; no scope changes.

2026-10-05 - v1 launched: keys with scopes, customers, sites, jobs, schedules, quotes, invoices, payments, crews, reports, webhooks.

Questions or a feature you need? support@dspatch.io · Dspatch, Inc.