{"openapi":"3.1.0","info":{"title":"TheBusinessApp API","version":"2026-10-17","description":"REST API for TheBusinessApp. Authenticate with `Authorization: Bearer tba_live_…` (create keys in Settings → Developers). Lists use cursor pagination; errors share one envelope; writes accept `Idempotency-Key`. Docs: https://thebusinessapp.co.uk/developers","contact":{"url":"https://thebusinessapp.co.uk/developers"}},"servers":[{"url":"https://api.thebusinessapp.co.uk/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"tba_live_<8>_<32>"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","permission_error","invalid_request_error","rate_limit_error","idempotency_error","api_error"]},"code":{"type":"string","enum":["unauthenticated","invalid_api_key","forbidden","insufficient_scope","module_disabled","not_found","validation_failed","invalid_cursor","rate_limited","idempotency_conflict","idempotency_in_progress","method_not_allowed","internal_error"]},"message":{"type":"string"},"request_id":{"type":"string"},"details":{}}}}},"LineItem":{"type":"object","required":["description","unit_price"],"properties":{"description":{"type":"string"},"quantity":{"type":"number","default":1},"unit_price":{"type":"number"},"vat_rate":{"type":"number","default":20},"discount_pct":{"type":"number","default":0},"unit":{"type":"string","default":"each"},"product_id":{"type":["string","null"],"format":"uuid"}}},"Event":{"type":"object","description":"Webhook payload envelope","properties":{"id":{"type":"string","example":"evt_3f2a…"},"object":{"const":"event"},"type":{"type":"string","enum":["customer.created","customer.updated","enquiry.created","quote.sent","quote.accepted","quote.declined","job.created","job.updated","job.completed","invoice.created","invoice.sent","invoice.paid","invoice.overdue","payment.received","booking.created","survey.responded"]},"api_version":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"object":{"type":"object"}}}}},"Customer":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"customer"}},"additionalProperties":true,"example":{"id":"7c1e…","object":"customer","name":"Jane Smith","company":null,"type":"individual","email":"jane@example.com","phone":"07700 900123","postcode":"BS1 4DJ","status":"active","tags":["landlord"],"created_at":"2026-10-17T09:00:00Z","updated_at":"2026-10-17T09:00:00Z"},"description":"People and businesses you work for."},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"contact"}},"additionalProperties":true,"example":{"id":"…","object":"contact","customer_id":"…","name":"Tom Accounts","role":"Accounts","email":"accounts@example.com","is_primary":false,"receives_invoices":true},"description":"Named contacts at a customer. Create with POST /customers/{id}/contacts."},"Site":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"site"}},"additionalProperties":true,"example":{"id":"…","object":"site","customer_id":"…","label":"Rental flat","address":"2 Quay St, Bristol","postcode":"BS1 4DJ"},"description":"Customer sites / properties where work happens. Create with POST /customers/{id}/sites."},"Enquiry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"enquiry"}},"additionalProperties":true,"example":{"id":"…","object":"enquiry","name":"Sam Patel","email":"sam@example.com","service":"Boiler service","status":"new","source":"api","priority":"normal"},"description":"Leads in the sales pipeline."},"Quote":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"quote"}},"additionalProperties":true,"example":{"id":"…","object":"quote","number":"Q-0042","status":"draft","customer_id":"…","title":"Bathroom refit","items":[{"description":"Labour","quantity":8,"unit_price":45,"vat_rate":20}],"subtotal":360,"vat_total":72,"total":432},"description":"Quotes. The API creates drafts only; sending happens in the app."},"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"job"}},"additionalProperties":true,"example":{"id":"…","object":"job","number":"J-0107","title":"Annual boiler service","status":"scheduled","priority":"normal","scheduled_start":"2026-10-20T09:00:00Z","scheduled_end":"2026-10-20T10:00:00Z"},"description":"Jobs on the schedule. Update `status` to move a job along (e.g. `done`)."},"Visit":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"visit"}},"additionalProperties":true,"example":{"id":"…","object":"visit","job_id":"…","starts_at":"2026-10-21T08:00:00Z","ends_at":"2026-10-21T12:00:00Z","status":"scheduled"},"description":"Scheduled visits within a job. Create with POST /jobs/{id}/visits."},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"invoice"}},"additionalProperties":true,"example":{"id":"…","object":"invoice","number":"INV-0311","status":"sent","issue_date":"2026-10-17","due_date":"2026-10-31","total":432,"amount_paid":0},"description":"Invoices. The API creates drafts only; sending and payment collection happen in the app."},"Payment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"payment"}},"additionalProperties":true,"example":{"id":"…","object":"payment","invoice_id":"…","amount":432,"method":"card","paid_at":"2026-10-18T14:02:00Z"},"description":"Payments recorded against invoices (card, bank transfer, cash…)."},"Product":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"product"}},"additionalProperties":true,"example":{"id":"…","object":"product","name":"Combi boiler service","sku":"SVC-BOIL","kind":"service","unit":"each","unit_price":95,"vat_rate":20,"active":true},"description":"Your price list: products and services."},"StaffMember":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"staff_member"}},"additionalProperties":true,"example":{"id":"…","object":"staff_member","display_name":"Alex Fitter","role":"field","job_title":"Engineer","active":true},"description":"Your team. Pay rates are never exposed."},"TimeEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"time_entry"}},"additionalProperties":true,"example":{"id":"…","object":"time_entry","user_id":"…","job_id":"…","started_at":"2026-10-17T08:00:00Z","ended_at":"2026-10-17T16:30:00Z","break_minutes":30,"approved":true},"description":"Clocked time entries."},"StockItem":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"stock_item"}},"additionalProperties":true,"example":{"id":"…","object":"stock_item","product_id":"…","location_id":"…","qty":12,"min_level":4,"product":{"name":"15mm copper elbow","sku":"CU-15-EL","unit":"each"},"location":{"name":"Van 2","kind":"van"}},"description":"Stock on hand per product and location (warehouse, van, site)."}}},"paths":{"/customers":{"get":{"tags":["customers"],"summary":"List customers","description":"People and businesses you work for.","operationId":"list_customers","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"email","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["customers"],"summary":"Create a customer","operationId":"create_customer","security":[{"bearerAuth":["customers:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200,"description":"Customer or contact name"},"company":{"type":["string","null"],"maxLength":200},"type":{"type":"string","enum":["individual","business"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"],"maxLength":40},"mobile":{"type":["string","null"],"maxLength":40},"website":{"type":["string","null"],"maxLength":300},"address":{"type":["string","null"],"maxLength":1000},"postcode":{"type":["string","null"],"maxLength":12},"billing_address":{"type":["string","null"],"maxLength":1000},"vat_number":{"type":["string","null"],"maxLength":30},"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]},"payment_terms_days":{"type":["integer","null"],"minimum":0,"maximum":365},"status":{"type":"string","enum":["lead","active","archived"]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{id}":{"get":{"tags":["customers"],"summary":"Get a customer","operationId":"get_customer","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["customers"],"summary":"Update a customer","operationId":"update_customer","security":[{"bearerAuth":["customers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200,"description":"Customer or contact name"},"company":{"type":["string","null"],"maxLength":200},"type":{"type":"string","enum":["individual","business"]},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"],"maxLength":40},"mobile":{"type":["string","null"],"maxLength":40},"website":{"type":["string","null"],"maxLength":300},"address":{"type":["string","null"],"maxLength":1000},"postcode":{"type":["string","null"],"maxLength":12},"billing_address":{"type":["string","null"],"maxLength":1000},"vat_number":{"type":["string","null"],"maxLength":30},"tags":{"type":"array","items":{"type":"string"}},"notes":{"type":["string","null"]},"payment_terms_days":{"type":["integer","null"],"minimum":0,"maximum":365},"status":{"type":"string","enum":["lead","active","archived"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts":{"get":{"tags":["contacts"],"summary":"List contacts","description":"Named contacts at a customer. Create with POST /customers/{id}/contacts.","operationId":"list_contacts","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts/{id}":{"get":{"tags":["contacts"],"summary":"Get a contact","operationId":"get_contact","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{id}/contacts":{"get":{"tags":["contacts"],"summary":"List contacts for one customer","operationId":"list_customers_contacts","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["contacts"],"summary":"Add a contact to a customer","operationId":"create_contact","security":[{"bearerAuth":["customers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200},"role":{"type":["string","null"],"maxLength":100},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"],"maxLength":40},"is_primary":{"type":"boolean"},"receives_invoices":{"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites":{"get":{"tags":["sites"],"summary":"List sites","description":"Customer sites / properties where work happens. Create with POST /customers/{id}/sites.","operationId":"list_sites","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sites/{id}":{"get":{"tags":["sites"],"summary":"Get a site","operationId":"get_site","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/customers/{id}/sites":{"get":{"tags":["sites"],"summary":"List sites for one customer","operationId":"list_customers_sites","security":[{"bearerAuth":["customers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Site"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["sites"],"summary":"Add a site to a customer","operationId":"create_site","security":[{"bearerAuth":["customers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"address":{"type":"string","maxLength":1000},"label":{"type":["string","null"],"maxLength":120},"postcode":{"type":["string","null"],"maxLength":12},"access_notes":{"type":["string","null"],"maxLength":2000}},"required":["address"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/enquiries":{"get":{"tags":["enquiries"],"summary":"List enquiries","description":"Leads in the sales pipeline.","operationId":"list_enquiries","security":[{"bearerAuth":["enquiries:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Enquiry"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["enquiries"],"summary":"Create a enquiry","operationId":"create_enquiry","security":[{"bearerAuth":["enquiries:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200},"email":{"type":["string","null"],"format":"email"},"phone":{"type":["string","null"],"maxLength":40},"service":{"type":["string","null"],"maxLength":200},"message":{"type":["string","null"],"maxLength":5000},"address":{"type":["string","null"],"maxLength":1000},"customer_id":{"type":["string","null"],"format":"uuid"},"estimated_value":{"type":["number","null"],"minimum":0},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"source":{"type":"string","maxLength":60},"follow_up_on":{"type":["string","null"],"format":"date"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Enquiry"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/enquiries/{id}":{"get":{"tags":["enquiries"],"summary":"Get a enquiry","operationId":"get_enquiry","security":[{"bearerAuth":["enquiries:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Enquiry"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quotes":{"get":{"tags":["quotes"],"summary":"List quotes","description":"Quotes. The API creates drafts only; sending happens in the app.","operationId":"list_quotes","security":[{"bearerAuth":["quotes:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Quote"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["quotes"],"summary":"Create a quote","operationId":"create_quote","security":[{"bearerAuth":["quotes:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"customer_id":{"type":"string","format":"uuid"},"title":{"type":"string","maxLength":200},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"Line items: { description, quantity, unit_price, vat_rate, discount_pct?, unit?, product_id? }"},"reference":{"type":["string","null"],"maxLength":100},"notes":{"type":["string","null"]},"terms":{"type":["string","null"]},"issue_date":{"type":"string","format":"date"},"valid_until":{"type":["string","null"],"format":"date"},"discount_pct":{"type":"number","minimum":0,"maximum":100},"deposit_pct":{"type":"number","minimum":0,"maximum":100},"property_id":{"type":["string","null"],"format":"uuid"},"enquiry_id":{"type":["string","null"],"format":"uuid"},"job_id":{"type":["string","null"],"format":"uuid"}},"required":["customer_id","items"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/quotes/{id}":{"get":{"tags":["quotes"],"summary":"Get a quote","operationId":"get_quote","security":[{"bearerAuth":["quotes:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs":{"get":{"tags":["jobs"],"summary":"List jobs","description":"Jobs on the schedule. Update `status` to move a job along (e.g. `done`).","operationId":"list_jobs","security":[{"bearerAuth":["jobs:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"assigned_to","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["jobs"],"summary":"Create a job","operationId":"create_job","security":[{"bearerAuth":["jobs:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","maxLength":200},"customer_id":{"type":["string","null"],"format":"uuid"},"description":{"type":["string","null"]},"address":{"type":["string","null"],"maxLength":1000},"job_type":{"type":["string","null"],"maxLength":80},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"status":{"type":"string","enum":["unscheduled","scheduled","in_progress","on_hold","done","cancelled"]},"scheduled_start":{"type":["string","null"],"format":"date-time"},"scheduled_end":{"type":["string","null"],"format":"date-time"},"assigned_to":{"type":["string","null"],"format":"uuid"},"value":{"type":"number","minimum":0},"notes":{"type":["string","null"]},"access_notes":{"type":["string","null"],"maxLength":2000},"property_id":{"type":["string","null"],"format":"uuid"},"quote_id":{"type":["string","null"],"format":"uuid"}},"required":["title"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}":{"get":{"tags":["jobs"],"summary":"Get a job","operationId":"get_job","security":[{"bearerAuth":["jobs:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["jobs"],"summary":"Update a job","operationId":"update_job","security":[{"bearerAuth":["jobs:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","maxLength":200},"description":{"type":["string","null"]},"address":{"type":["string","null"],"maxLength":1000},"job_type":{"type":["string","null"],"maxLength":80},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"status":{"type":"string","enum":["unscheduled","scheduled","in_progress","on_hold","done","cancelled"]},"scheduled_start":{"type":["string","null"],"format":"date-time"},"scheduled_end":{"type":["string","null"],"format":"date-time"},"assigned_to":{"type":["string","null"],"format":"uuid"},"value":{"type":"number","minimum":0},"notes":{"type":["string","null"]},"access_notes":{"type":["string","null"],"maxLength":2000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/visits":{"get":{"tags":["visits"],"summary":"List visits","description":"Scheduled visits within a job. Create with POST /jobs/{id}/visits.","operationId":"list_visits","security":[{"bearerAuth":["jobs:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"job_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Visit"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/visits/{id}":{"get":{"tags":["visits"],"summary":"Get a visit","operationId":"get_visit","security":[{"bearerAuth":["jobs:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Visit"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["visits"],"summary":"Update a visit","operationId":"update_visit","security":[{"bearerAuth":["jobs:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["scheduled","done","cancelled"]},"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"},"notes":{"type":["string","null"],"maxLength":2000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Visit"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/visits":{"get":{"tags":["visits"],"summary":"List visits for one job","operationId":"list_jobs_visits","security":[{"bearerAuth":["jobs:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"job_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Visit"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["visits"],"summary":"Add a visit to a job","operationId":"create_visit","security":[{"bearerAuth":["jobs:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"starts_at":{"type":"string","format":"date-time"},"ends_at":{"type":"string","format":"date-time"},"notes":{"type":["string","null"],"maxLength":2000}},"required":["starts_at","ends_at"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Visit"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Parent not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices":{"get":{"tags":["invoices"],"summary":"List invoices","description":"Invoices. The API creates drafts only; sending and payment collection happen in the app.","operationId":"list_invoices","security":[{"bearerAuth":["invoices:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"customer_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"job_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["invoices"],"summary":"Create a invoice","operationId":"create_invoice","security":[{"bearerAuth":["invoices:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"customer_id":{"type":"string","format":"uuid"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"Line items: { description, quantity, unit_price, vat_rate, discount_pct?, unit?, product_id? }"},"reference":{"type":["string","null"],"maxLength":100},"notes":{"type":["string","null"]},"issue_date":{"type":"string","format":"date"},"due_date":{"type":"string","format":"date"},"discount_pct":{"type":"number","minimum":0,"maximum":100},"job_id":{"type":["string","null"],"format":"uuid"},"quote_id":{"type":["string","null"],"format":"uuid"},"property_id":{"type":["string","null"],"format":"uuid"}},"required":["customer_id","items"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/invoices/{id}":{"get":{"tags":["invoices"],"summary":"Get a invoice","operationId":"get_invoice","security":[{"bearerAuth":["invoices:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payments":{"get":{"tags":["payments"],"summary":"List payments","description":"Payments recorded against invoices (card, bank transfer, cash…).","operationId":"list_payments","security":[{"bearerAuth":["payments:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"invoice_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"method","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payments/{id}":{"get":{"tags":["payments"],"summary":"Get a payment","operationId":"get_payment","security":[{"bearerAuth":["payments:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products":{"get":{"tags":["products"],"summary":"List products","description":"Your price list: products and services.","operationId":"list_products","security":[{"bearerAuth":["products:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"sku","in":"query","schema":{"type":"string"}},{"name":"category","in":"query","schema":{"type":"string"}},{"name":"active","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["products"],"summary":"Create a product","operationId":"create_product","security":[{"bearerAuth":["products:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200},"sku":{"type":["string","null"],"maxLength":60},"description":{"type":["string","null"],"maxLength":2000},"kind":{"type":"string","enum":["service","labour","material","equipment"]},"category":{"type":["string","null"],"maxLength":80},"unit":{"type":"string","maxLength":20},"unit_price":{"type":"number"},"cost_price":{"type":"number","minimum":0},"vat_rate":{"type":"number","minimum":0,"maximum":100},"active":{"type":"boolean"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/products/{id}":{"get":{"tags":["products"],"summary":"Get a product","operationId":"get_product","security":[{"bearerAuth":["products:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["products"],"summary":"Update a product","operationId":"update_product","security":[{"bearerAuth":["products:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":255},"description":"Safely retry writes: the same key returns the first response for 24 hours"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":200},"sku":{"type":["string","null"],"maxLength":60},"description":{"type":["string","null"],"maxLength":2000},"kind":{"type":"string","enum":["service","labour","material","equipment"]},"category":{"type":["string","null"],"maxLength":80},"unit":{"type":"string","maxLength":20},"unit_price":{"type":"number"},"cost_price":{"type":"number","minimum":0},"vat_rate":{"type":"number","minimum":0,"maximum":100},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/staff":{"get":{"tags":["staff"],"summary":"List staff","description":"Your team. Pay rates are never exposed.","operationId":"list_staff","security":[{"bearerAuth":["staff:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"role","in":"query","schema":{"type":"string"}},{"name":"active","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/StaffMember"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/staff/{id}":{"get":{"tags":["staff"],"summary":"Get a staff member","operationId":"get_staff_member","security":[{"bearerAuth":["staff:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffMember"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/timesheets":{"get":{"tags":["timesheets"],"summary":"List timesheets","description":"Clocked time entries.","operationId":"list_timesheets","security":[{"bearerAuth":["timesheets:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"user_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"job_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"approved","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/TimeEntry"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/timesheets/{id}":{"get":{"tags":["timesheets"],"summary":"Get a time entry","operationId":"get_time_entry","security":[{"bearerAuth":["timesheets:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeEntry"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stock-items":{"get":{"tags":["stock-items"],"summary":"List stock-items","description":"Stock on hand per product and location (warehouse, van, site).","operationId":"list_stock_items","security":[{"bearerAuth":["stock:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"`next_cursor` from the previous page"},{"name":"created_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only rows changed at or after this time (for incremental sync)"},{"name":"product_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"location_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"A page of results","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/StockItem"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stock-items/{id}":{"get":{"tags":["stock-items"],"summary":"Get a stock item","operationId":"get_stock_item","security":[{"bearerAuth":["stock:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockItem"}}}},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/exports":{"get":{"tags":["exports"],"summary":"List accounting-package exports (scope exports:read)","operationId":"list_exports","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Targets and datasets"},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/exports/{target}/{dataset}":{"get":{"tags":["exports"],"summary":"Download a CSV in Xero / QuickBooks Online / Sage 50 / Sage Business Cloud / FreeAgent import format (scope exports:read)","operationId":"get_export","security":[{"bearerAuth":[]}],"parameters":[{"name":"target","in":"path","required":true,"schema":{"type":"string","enum":["xero","quickbooks","sage50","sage_bc","freeagent"]}},{"name":"dataset","in":"path","required":true,"schema":{"type":"string","enum":["sales","bills","contacts","bank","payments","products","credits"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"since_last_export","in":"query","schema":{"type":"boolean"},"description":"Skip records returned by an earlier since_last_export call, and log this one"},{"name":"format","in":"query","schema":{"type":"string","enum":["csv","json"]},"description":"json wraps the file(s) with row counts and totals; multi-file exports always return json"}],"responses":{"200":{"description":"text/csv file, or JSON with files[]"},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/me":{"get":{"tags":["meta"],"summary":"Describe the calling API key","operationId":"get_me","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Key, organisation and scopes"},"401":{"description":"Missing, malformed or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks the scope, or the module is switched off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"customer.created":{"post":{"summary":"A customer was added (app, portal, booking or API).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"customer.updated":{"post":{"summary":"Any field on a customer changed.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"enquiry.created":{"post":{"summary":"A new lead arrived (website form, booking, inbound email or API).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"quote.sent":{"post":{"summary":"A quote was sent to the customer.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"quote.accepted":{"post":{"summary":"The customer accepted (signed) a quote.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"quote.declined":{"post":{"summary":"The customer declined a quote.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"job.created":{"post":{"summary":"A job was created.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"job.updated":{"post":{"summary":"A job changed (status, schedule, assignee, details).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"job.completed":{"post":{"summary":"A job moved to `done`.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"invoice.created":{"post":{"summary":"An invoice was created (usually as a draft).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"invoice.sent":{"post":{"summary":"An invoice was sent to the customer.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"invoice.paid":{"post":{"summary":"An invoice was paid in full.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"invoice.overdue":{"post":{"summary":"A sent invoice passed its due date unpaid (once per invoice).","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"payment.received":{"post":{"summary":"A payment was recorded against an invoice.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"booking.created":{"post":{"summary":"A customer booked online.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}},"survey.responded":{"post":{"summary":"A customer answered a satisfaction survey.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Return any 2xx within 10 seconds to acknowledge"}}}}}}