{"openapi":"3.1.0","info":{"title":"Motzo Partner API","version":"2026-12-01","description":"Get car owners' repair requests (leads) from Motzo, answer with quotes, and hear when an owner picks you. Owners stay anonymous until they accept your quote; then GET /v1/leads/{id}/contact returns their name and phone. Use a test key (mk_test_…) to try everything with sample leads. Webhooks are signed: Motzo-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">.","contact":{"name":"Motzo partners","email":"partners@motzo.si","url":"https://developers.motzo.online"}},"servers":[{"url":"https://api.motzo.online/v1","description":"Motzo (live and test keys)"}],"security":[{"apiKey":[]}],"tags":[{"name":"Account"},{"name":"Leads","description":"Repair requests sent to you."},{"name":"Webhooks","description":"Get leads pushed to your system."},{"name":"Sandbox","description":"Test keys only."}],"paths":{"/me":{"get":{"tags":["Account"],"operationId":"getMe","summary":"Who this key belongs to","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Partner"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads":{"get":{"tags":["Leads"],"operationId":"listLeads","summary":"List leads sent to you, newest first","parameters":[{"name":"status","in":"query","schema":{"type":"string"},"description":"Comma-separated: new, seen, quoted, declined, accepted, not_chosen, cancelled"},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only leads created after this time"},{"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":"format","in":"query","schema":{"type":"string","enum":["json","csv"]},"description":"csv downloads a spreadsheet"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads/{id}":{"get":{"tags":["Leads"],"operationId":"getLead","summary":"One lead, with photo links that last an hour. Marks it seen.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads/{id}/quote":{"post":{"tags":["Leads"],"operationId":"sendQuote","summary":"Send or update your quote","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteIn"}}}},"responses":{"201":{"description":"Quote saved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads/{id}/messages":{"get":{"tags":["Leads"],"operationId":"listMessages","summary":"The conversation with the owner","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Leads"],"operationId":"messageOwner","summary":"Ask the owner a question (through Motzo; no phone numbers are exchanged)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","maxLength":2000}}}}}},"responses":{"201":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads/{id}/decline":{"post":{"tags":["Leads"],"operationId":"declineLead","summary":"Say you can't take this job","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"const":"declined"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/leads/{id}/contact":{"get":{"tags":["Leads"],"operationId":"getContact","summary":"The owner's contact details, only after they accept your quote","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhooks":{"get":{"tags":["Webhooks"],"operationId":"listWebhooks","summary":"Your webhooks and recent deliveries","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Webhooks"],"operationId":"createWebhook","summary":"Add a webhook (5 per mode). The secret is returned once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"https only"},"format":{"type":"string","enum":["json","slack"],"default":"json"},"events":{"type":"array","items":{"type":"string","enum":["lead.created","lead.message","lead.cancelled","quote.accepted","quote.not_chosen"]},"description":"Empty means all events"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Webhook"},{"type":"object","properties":{"secret":{"type":"string","example":"whsec_…"}}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhooks/{id}":{"delete":{"tags":["Webhooks"],"operationId":"deleteWebhook","summary":"Remove a webhook","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"operationId":"testWebhook","summary":"Send a signed ping event now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"type":["integer","null"]},"error":{"type":"string"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/sandbox/leads":{"post":{"tags":["Sandbox"],"operationId":"createSampleLead","summary":"Make a sample lead (test keys only). Fires lead.created to your test webhooks.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"service":{"type":"string","enum":["glass","body","tire","oil"]}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/sandbox/leads/{id}/accept":{"post":{"tags":["Sandbox"],"operationId":"acceptSampleLead","summary":"Act as the owner and accept your quote on a sample lead","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","example":"ld_8fK2mQ0aZ1xY7bTn"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/connection":{"delete":{"tags":["Account"],"operationId":"disconnect","summary":"Revoke the key making this call (for a Disconnect button). For Connect with Motzo keys it also revokes the paired key and removes webhooks on the software's own site.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"revoked":{"type":"array","items":{"type":"string"}},"webhooks_removed":{"type":"array","items":{"type":"string"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"webhooks":{"lead.created":{"post":{"summary":"Motzo sends lead.created","parameters":[{"name":"Motzo-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Motzo-Event","in":"header","required":true,"schema":{"const":"lead.created"}},{"name":"Motzo-Event-Id","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Return any 2xx within 8 seconds. Motzo retries twice on other answers."}}}},"lead.message":{"post":{"summary":"Motzo sends lead.message","parameters":[{"name":"Motzo-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Motzo-Event","in":"header","required":true,"schema":{"const":"lead.message"}},{"name":"Motzo-Event-Id","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Return any 2xx within 8 seconds. Motzo retries twice on other answers."}}}},"lead.cancelled":{"post":{"summary":"Motzo sends lead.cancelled","parameters":[{"name":"Motzo-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Motzo-Event","in":"header","required":true,"schema":{"const":"lead.cancelled"}},{"name":"Motzo-Event-Id","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Return any 2xx within 8 seconds. Motzo retries twice on other answers."}}}},"quote.accepted":{"post":{"summary":"Motzo sends quote.accepted","parameters":[{"name":"Motzo-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Motzo-Event","in":"header","required":true,"schema":{"const":"quote.accepted"}},{"name":"Motzo-Event-Id","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Return any 2xx within 8 seconds. Motzo retries twice on other answers."}}}},"quote.not_chosen":{"post":{"summary":"Motzo sends quote.not_chosen","parameters":[{"name":"Motzo-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"Motzo-Event","in":"header","required":true,"schema":{"const":"quote.not_chosen"}},{"name":"Motzo-Event-Id","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Return any 2xx within 8 seconds. Motzo retries twice on other answers."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"mk_live_… or mk_test_…, from motzo.online/partners or Connect with Motzo"},"connect":{"type":"oauth2","description":"Connect with Motzo: for software that serves many shops (like motzo.shop). The token is a Motzo API key.","flows":{"authorizationCode":{"authorizationUrl":"https://motzo.online/connect","tokenUrl":"https://api.motzo.online/oauth/token","scopes":{"leads:read":"See leads sent to the shop","quotes:write":"Quote, message and decline","webhooks:manage":"Add and remove webhooks"}}}}},"responses":{"Unauthorized":{"description":"Missing or bad key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Not allowed (pending approval, missing scope, paused, or contact not available yet)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such lead sent to you","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The lead is closed or you declined it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many calls; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"Partner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["pending","approved","paused","declined"]},"services":{"type":"array","items":{"type":"string"}},"mode":{"type":"string","enum":["live","test"]},"scopes":{"type":"array","items":{"type":"string"}},"limits":{"type":"object","properties":{"per_minute":{"type":"integer"},"per_day":{"type":"integer"}}}}},"Lead":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"lead"},"sandbox":{"type":"boolean"},"status":{"type":"string","enum":["new","seen","quoted","declined","accepted","not_chosen","cancelled","closed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"service":{"type":"string","enum":["glass","body","mechanic","tire","oil","detail","dealer","other"]},"job":{"type":"string"},"vehicle":{"type":"object","properties":{"year":{"type":"string"},"make":{"type":"string"},"model":{"type":"string"},"trim":{"type":"string"},"vin":{"type":["string","null"]}}},"location":{"type":"object","properties":{"city":{"type":"string"},"zip":{"type":"string"},"area":{"type":"string"},"distance_miles":{"type":["number","null"]}}},"timing":{"type":"string"},"insurance_claim":{"type":"boolean"},"diagnosis":{"type":"object","properties":{"readings":{"type":"array","items":{"type":"string"}}}},"photo_count":{"type":"integer"},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"expires_at":{"type":"string"}}}},"language":{"type":"string"},"questions":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string"},"question":{"type":"string"}}}},"your_quote":{"oneOf":[{"$ref":"#/components/schemas/QuoteIn"},{"type":"null"}]},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"contact_available":{"type":"boolean"}}},"QuoteIn":{"type":"object","required":["total"],"properties":{"total":{"type":"number","description":"Full price in dollars, parts + labor + fees"},"currency":{"type":"string","default":"USD"},"parts_type":{"type":"string","example":"OEM-equivalent"},"earliest":{"type":"string","example":"Tomorrow 9 AM"},"mobile":{"type":"boolean","description":"You come to the owner"},"warranty":{"type":"string"},"notes":{"type":"string"},"answers":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string"},"answer":{"type":"string"}}}},"valid_until":{"type":"string","format":"date-time"}}},"Message":{"type":"object","properties":{"at":{"type":"string"},"from":{"type":"string","enum":["shop","owner","motzo"]},"text":{"type":"string"}}},"Contact":{"type":"object","properties":{"lead_id":{"type":"string"},"sandbox":{"type":"boolean"},"accepted_at":{"type":"string"},"contact":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"insurer":{"type":"string"},"policy_number":{"type":"string"}}}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"format":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"mode":{"type":"string"},"active":{"type":"boolean"}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"event"},"type":{"type":"string","enum":["lead.created","lead.message","lead.cancelled","quote.accepted","quote.not_chosen","ping"]},"created_at":{"type":"string"},"mode":{"type":"string"},"data":{"type":"object","properties":{"lead":{"$ref":"#/components/schemas/Lead"}}}}}}}}