{"openapi":"3.0.3","info":{"title":"CourtBuildr API","version":"2026-09-14","description":"Read your leads and jobs, create and move jobs, and manage signed webhooks. Docs: https://courtbuildr.com/developers"},"servers":[{"url":"https://courtbuildr.com/api/v1"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"cb_live_… from your dashboard → Integrations"}},"schemas":{"Lead":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"note":{"type":"string"},"reason":{"type":"string"},"sport":{"type":"string"},"sport_key":{"type":"string"},"size":{"type":"string"},"width_m":{"type":"number","nullable":true},"length_m":{"type":"number","nullable":true},"hoop":{"type":"string"},"estimated_value":{"type":"string","description":"Formatted, for display"},"estimated_value_cents":{"type":"integer","nullable":true},"estimated_value_amount":{"type":"number","nullable":true,"description":"The same amount in major units, e.g. 24500"},"currency":{"type":"string","description":"ISO 4217"},"design_url":{"type":"string"},"ar_url":{"type":"string"}}},"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}},"JobCreate":{"type":"object","properties":{"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["email"]},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"show_price":{"type":"boolean"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string","maxLength":120},"lead_id":{"type":"string","format":"uuid"},"invite":{"type":"boolean"},"force":{"type":"boolean","description":"Create even if the lead already has an open job"}},"required":["customer"]},"JobPatch":{"type":"object","properties":{"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"show_price":{"type":"boolean"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string","maxLength":120}}},"JobDetail":{"allOf":[{"$ref":"#/components/schemas/Job"},{"type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}}},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"stage_key":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"photo_count":{"type":"integer"},"created_at":{"type":"string"}}}},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"created_at":{"type":"string"}}}},"messages":{"type":"object","properties":{"count":{"type":"integer"},"unread_from_customer":{"type":"integer"},"last_at":{"type":"string","nullable":true}}}}}]},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"last_success_at":{"type":"string","nullable":true},"last_failure_at":{"type":"string","nullable":true},"failure_count":{"type":"integer"}}},"WebhookEndpointCreated":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"last_success_at":{"type":"string","nullable":true},"last_failure_at":{"type":"string","nullable":true},"failure_count":{"type":"integer"}}},{"type":"object","properties":{"secret":{"type":"string"}}}]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"endpoint_id":{"type":"string"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"next_attempt_at":{"type":"string","nullable":true},"response_status":{"type":"integer","nullable":true},"last_error":{"type":"string","nullable":true},"created_at":{"type":"string"},"delivered_at":{"type":"string","nullable":true}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}},"security":[{"apiKey":[]}],"paths":{"/me":{"get":{"summary":"The account behind this key","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/events":{"get":{"summary":"Event types a webhook can subscribe to","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}}},"meta":{"type":"object"}}}}}}}}},"/leads":{"get":{"summary":"List leads","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"meta.next_cursor from the previous page (opaque)"},{"name":"email","in":"query","schema":{"type":"string"},"description":"Exact match on the customer's email"},{"name":"status","in":"query","schema":{"type":"string","enum":["new","contacted","quoted","won","lost"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"note":{"type":"string"},"reason":{"type":"string"},"sport":{"type":"string"},"sport_key":{"type":"string"},"size":{"type":"string"},"width_m":{"type":"number","nullable":true},"length_m":{"type":"number","nullable":true},"hoop":{"type":"string"},"estimated_value":{"type":"string","description":"Formatted, for display"},"estimated_value_cents":{"type":"integer","nullable":true},"estimated_value_amount":{"type":"number","nullable":true,"description":"The same amount in major units, e.g. 24500"},"currency":{"type":"string","description":"ISO 4217"},"design_url":{"type":"string"},"ar_url":{"type":"string"}}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/leads/{id}":{"get":{"summary":"One lead","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"note":{"type":"string"},"reason":{"type":"string"},"sport":{"type":"string"},"sport_key":{"type":"string"},"size":{"type":"string"},"width_m":{"type":"number","nullable":true},"length_m":{"type":"number","nullable":true},"hoop":{"type":"string"},"estimated_value":{"type":"string","description":"Formatted, for display"},"estimated_value_cents":{"type":"integer","nullable":true},"estimated_value_amount":{"type":"number","nullable":true,"description":"The same amount in major units, e.g. 24500"},"currency":{"type":"string","description":"ISO 4217"},"design_url":{"type":"string"},"ar_url":{"type":"string"}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"patch":{"summary":"Update a lead's status or note","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"note":{"type":"string"},"reason":{"type":"string"},"sport":{"type":"string"},"sport_key":{"type":"string"},"size":{"type":"string"},"width_m":{"type":"number","nullable":true},"length_m":{"type":"number","nullable":true},"hoop":{"type":"string"},"estimated_value":{"type":"string","description":"Formatted, for display"},"estimated_value_cents":{"type":"integer","nullable":true},"estimated_value_amount":{"type":"number","nullable":true,"description":"The same amount in major units, e.g. 24500"},"currency":{"type":"string","description":"ISO 4217"},"design_url":{"type":"string"},"ar_url":{"type":"string"}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/stages":{"get":{"summary":"Your pipeline: the stage keys updates accept, in order","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/jobs":{"get":{"summary":"List jobs","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"meta.next_cursor from the previous page (opaque)"},{"name":"email","in":"query","schema":{"type":"string"},"description":"Exact match on the customer's email"},{"name":"stage","in":"query","schema":{"type":"string"}},{"name":"external_ref","in":"query","schema":{"type":"string"}},{"name":"lead_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"post":{"summary":"Create a job (returns the existing open job for that lead with meta.existing=true unless force)","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Same key from your account inside 24 hours replays the first response instead of acting twice"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["email"]},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"show_price":{"type":"boolean"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string","maxLength":120},"lead_id":{"type":"string","format":"uuid"},"invite":{"type":"boolean"},"force":{"type":"boolean","description":"Create even if the lead already has an open job"}},"required":["customer"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}},"meta":{"type":"object"}}}}}},"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/jobs/{id}":{"get":{"summary":"One job with stages, updates, documents, message counts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"$ref":"#/components/schemas/Job"},{"type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}}},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"stage_key":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"photo_count":{"type":"integer"},"created_at":{"type":"string"}}}},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"type":"string"},"created_at":{"type":"string"}}}},"messages":{"type":"object","properties":{"count":{"type":"integer"},"unread_from_customer":{"type":"integer"},"last_at":{"type":"string","nullable":true}}}}}]},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"patch":{"summary":"Edit a job (only the keys sent change)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"show_price":{"type":"boolean"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"external_ref":{"type":"string","maxLength":120}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/jobs/{id}/updates":{"post":{"summary":"Move the stage and/or post a note","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":200},"description":"Same key from your account inside 24 hours replays the first response instead of acting twice"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/jobs/{id}/invite":{"post":{"summary":"Email the customer their sign-in link (3 per job per hour)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"external_ref":{"type":"string","nullable":true,"description":"Your own id for this job"},"lead_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"stage":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"customer_label":{"type":"string","nullable":true},"terminal":{"type":"boolean"}}},"customer":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}}},"sport":{"type":"string"},"size":{"type":"string"},"design_url":{"type":"string"},"inclusions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"detail":{"type":"string"}},"required":["label"]}},"key_dates":{"type":"object","properties":{"start":{"type":"string","format":"date"},"install":{"type":"string","format":"date"},"handover":{"type":"string","format":"date"}}},"price":{"type":"object","properties":{"amount_cents":{"type":"integer"},"paid_cents":{"type":"integer"},"currency":{"type":"string"},"shown_to_customer":{"type":"boolean"}}},"site":{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postcode":{"type":"string"},"country":{"type":"string"},"notes":{"type":"string"}}},"customer_invited_at":{"type":"string","format":"date-time","nullable":true},"customer_signed_in":{"type":"boolean"},"portal_url":{"type":"string","nullable":true}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"502":{"description":"The invite email could not be sent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/webhooks":{"get":{"summary":"List endpoints","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"last_success_at":{"type":"string","nullable":true},"last_failure_at":{"type":"string","nullable":true},"failure_count":{"type":"integer"}}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"post":{"summary":"Register an endpoint (secret returned once)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["lead.created","job.created","job.stage_changed","job.updated","job.message.created","job.document.added","lead.*","job.*","*"]}},"description":{"type":"string"}},"required":["url"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointCreated"},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/webhooks/{id}":{"get":{"summary":"One endpoint with its last 50 deliveries","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"last_success_at":{"type":"string","nullable":true},"last_failure_at":{"type":"string","nullable":true},"failure_count":{"type":"integer"}}},{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"endpoint_id":{"type":"string"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"next_attempt_at":{"type":"string","nullable":true},"response_status":{"type":"integer","nullable":true},"last_error":{"type":"string","nullable":true},"created_at":{"type":"string"},"delivered_at":{"type":"string","nullable":true}}}}}}]},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"patch":{"summary":"Update or pause an endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"last_success_at":{"type":"string","nullable":true},"last_failure_at":{"type":"string","nullable":true},"failure_count":{"type":"integer"}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"delete":{"summary":"Remove an endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}},"/webhooks/{id}/test":{"post":{"summary":"Send a signed ping, or a realistic sample of any event (test: true on the envelope)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["ping","lead.created","job.created","job.stage_changed","job.updated","job.message.created","job.document.added"],"default":"ping"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true}}},"meta":{"type":"object"}}}}}},"400":{"description":"Bad request; the message names the field","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"401":{"description":"Missing or revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"403":{"description":"Not on this plan, or account inactive","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"404":{"description":"Not found on this account","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"503":{"description":"Temporarily unavailable; retry after retry_after_seconds","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}},"x-webhooks":{"lead.created":{"description":"A visitor left their details in the designer (name, contact, the court they designed).","headers":["X-CourtBuildr-Signature","X-CourtBuildr-Event","X-CourtBuildr-Delivery"],"body":{"id":"uuid","event":"lead.created","created_at":"date-time","api_version":"2026-09-14","test?":"true only on samples sent from the dashboard or /webhooks/{id}/test","data":{"$ref":"#/components/schemas/Lead"}}},"job.created":{"description":"A job was created for a customer, from a lead or from scratch.","headers":["X-CourtBuildr-Signature","X-CourtBuildr-Event","X-CourtBuildr-Delivery"],"body":{"id":"uuid","event":"job.created","created_at":"date-time","api_version":"2026-09-14","test?":"true only on samples sent from the dashboard or /webhooks/{id}/test","data":{"job":{"$ref":"#/components/schemas/Job"},"lead_id":"uuid | null"}}},"job.stage_changed":{"description":"A job moved to a new stage of the builder's pipeline.","headers":["X-CourtBuildr-Signature","X-CourtBuildr-Event","X-CourtBuildr-Delivery"],"body":{"id":"uuid","event":"job.stage_changed","created_at":"date-time","api_version":"2026-09-14","test?":"true only on samples sent from the dashboard or /webhooks/{id}/test","data":{"job":{"$ref":"#/components/schemas/Job"},"previous_stage":"string","update":{"id":"uuid","stage_key":"string","note":"string | null","photo_count":"integer","created_at":"date-time"}}}},"job.updated":{"description":"The builder posted a note or photos on a job without moving the stage.","headers":["X-CourtBuildr-Signature","X-CourtBuildr-Event","X-CourtBuildr-Delivery"],"body":{"id":"uuid","event":"job.updated","created_at":"date-time","api_version":"2026-09-14","test?":"true only on samples sent from the dashboard or /webhooks/{id}/test","data":{"job":{"$ref":"#/components/schemas/Job"},"update":{"id":"uuid","stage_key":null,"note":"string | null","photo_count":"integer","created_at":"date-time"}}}},"job.message.created":{"description":"The customer wrote a message on their job page.","headers":["X-CourtBuildr-Signature","X-CourtBuildr-Event","X-CourtBuildr-Delivery"],"body":{"id":"uuid","event":"job.message.created","created_at":"date-time","api_version":"2026-09-14","test?":"true only on samples sent from the dashboard or /webhooks/{id}/test","data":{"job_id":"uuid","job_number":"string","customer":{"name":"string","email":"string"},"message":{"id":"uuid","body":"string","photo_count":"integer","created_at":"date-time"}}}},"job.document.added":{"description":"The builder attached a document to a job.","headers":["X-CourtBuildr-Signature","X-CourtBuildr-Event","X-CourtBuildr-Delivery"],"body":{"id":"uuid","event":"job.document.added","created_at":"date-time","api_version":"2026-09-14","test?":"true only on samples sent from the dashboard or /webhooks/{id}/test","data":{"job_id":"uuid","document":{"id":"uuid","title":"string","kind":"string","created_at":"date-time"}}}}}}