{"openapi":"3.1.0","info":{"title":"SureQuote agent API","version":"1.0.0","description":"Guide prices for Australian home jobs, and quote requests to local tradies. No sign-in or key is needed. Prices are guides, not quotes. Read the guide at /api/agent/v1 for the flow."},"servers":[{"url":"https://www.surequote.com.au"}],"security":[{},{"partnerCode":[]}],"components":{"securitySchemes":{"partnerCode":{"type":"http","scheme":"bearer","description":"Optional. A SureQuote partner access code: Authorization: Bearer <code>."}}},"paths":{"/api/agent/v1/jobs/search":{"post":{"operationId":"search_jobs","summary":"Find a home job","description":"Find the SureQuote job that matches a plain-English description of Australian home work (for example \"repaint two bedrooms\" or \"replace a hot water system\"). Returns up to 5 jobs, best match first. Use a job_id with get_job_estimate.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":2,"maxLength":200,"description":"What the homeowner wants done, in plain English."}},"required":["query"],"additionalProperties":false},"example":{"query":"repaint two bedrooms"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"jobs":[{"job_id":"280f3a5a-2bb0-4973-a9fb-a7247e0f9b36","name":"Interior Painting","trade":"Painting"}]}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/estimates":{"post":{"operationId":"get_job_estimate","summary":"Get a guide price for a job","description":"Get a SureQuote guide price range (AUD) for one job, the questions that shape the price, and what drives the cost. Unanswered questions use a typical answer, listed as assumed_answer. A question with affects_price true moves the range under the current answers; ask the homeowner the questions in unanswered_price_questions and call again with their answers to tailor the range. Questions with affects_price false do not change the guide but help tradies quote: if the homeowner may want quotes, ask them in the same message. Ranges are deliberately wide (at least 15% either side) and national, so an answer can leave the range unchanged. This is a guide, not a quote.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","format":"uuid","description":"A job_id returned by search_jobs."},"answers":{"type":"object","description":"Answers keyed by question key, from the questions list a previous get_job_estimate returned. Select questions take an option value (multi_select takes a list of option values); number questions take a number. Leave a question out to use the typical answer.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]}}},"required":["job_id"],"additionalProperties":false},"example":{"job_id":"280f3a5a-2bb0-4973-a9fb-a7247e0f9b36","answers":{"rooms_count_band":2}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"job":{"job_id":"280f3a5a-2bb0-4973-a9fb-a7247e0f9b36","name":"Interior Painting","trade":"Painting"},"estimate":{"low_aud":1000,"high_aud":2100,"currency":"AUD","basis":"national_guide","indicative_only":true},"price_factors":["Rooms","Surfaces"],"questions":[{"key":"rooms_count_band","question":"How many rooms need painting? (Include bedrooms, living areas, and hallways.)","label":"Rooms","type":"number","affects_price":true,"options":[{"value":1,"label":"1"},{"value":2,"label":"2"},{"value":3,"label":"3"}],"answer":2,"assumed_answer":null}],"unanswered_price_questions":["painting__surfaces_included"],"job_page_url":"https://www.surequote.com.au/painting-services/jobs/painting-interior","disclaimer":"A guide range from SureQuote for a typical job of this kind in Australia, not a quote. Prices vary by location, access and site conditions. Only a tradie who has seen the job can quote it.","source":"SureQuote"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/quote-requests":{"post":{"operationId":"start_quote_request","summary":"Ask local tradies to quote","description":"Send the homeowner's job to SureQuote to get quotes from matched local tradies. Only call this when the homeowner has asked for quotes and agreed to share their name, email and phone with the tradies who take the job (set consent to true). Collect everything in one message: contact details, suburb, how soon, consent, and the job questions from get_job_estimate (pass their answers here). SureQuote emails the homeowner a 6-digit code; nothing is sent to tradies until you call confirm_quote_request with that code.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A value unique to this quote request (8-128 letters, digits, . _ : -). Reuse it when retrying.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{8,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","format":"uuid","description":"A job_id returned by search_jobs."},"answers":{"type":"object","description":"Answers keyed by question key, from the questions list a previous get_job_estimate returned. Select questions take an option value (multi_select takes a list of option values); number questions take a number. Leave a question out to use the typical answer.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}}]}},"contact":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","format":"email","maxLength":254},"phone":{"type":"string","maxLength":40,"description":"Australian phone number, mobile preferred."}},"required":["name","email","phone"],"additionalProperties":false},"suburb":{"type":"string","minLength":2,"maxLength":120,"description":"Suburb where the work is."},"postcode":{"type":"string","pattern":"^[0-9]{4}$","description":"Postcode where the work is. Optional when only one Australian suburb has the name; if the suburb is ambiguous or misspelt, the location_not_found error lists the matching suburbs."},"urgency":{"type":"string","enum":["normal","urgent","after_hours","unsure"],"description":"How soon the homeowner needs it done: normal = Flexible, urgent = As soon as possible, after_hours = After hours or emergency, unsure = Not sure. \"Anytime\" or \"no rush\" is normal. If the job also has a timing question, answer it only when the homeowner gave a timeframe."},"notes":{"type":"string","maxLength":1000,"description":"Anything else the tradie should know, in the homeowner's words."},"consent":{"type":"boolean","const":true,"description":"True only if the homeowner agreed that SureQuote may email them a code and share the job and their contact details with matched local tradies."}},"required":["job_id","contact","suburb","urgency","consent"],"additionalProperties":false},"example":{"job_id":"280f3a5a-2bb0-4973-a9fb-a7247e0f9b36","answers":{"rooms_count_band":2},"contact":{"name":"Sam Taylor","email":"sam@example.com","phone":"0412 345 678"},"suburb":"Bondi","postcode":"2026","urgency":"normal","notes":"Two bedrooms, walls only. Furniture can be moved out.","consent":true}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"request_id":"6f1c2a4e-8d3b-4c55-9a1e-2b7d0c9e4f10","status":"awaiting_confirmation","confirmation":{"channel":"email","sent_to":"sa***@example.com","expires_in_minutes":30},"estimate":{"low_aud":1000,"high_aud":2100,"currency":"AUD","basis":"national_guide","indicative_only":true},"next_step":"SureQuote emailed the homeowner a 6-digit code. Ask them for it, then call the confirm operation with it. Nothing is sent to tradies until then."}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/quote-requests/{request_id}/confirm":{"post":{"operationId":"confirm_quote_request","summary":"Confirm a quote request with the emailed code","description":"Send a quote request to local tradies, using the 6-digit code SureQuote emailed the homeowner. Ask the homeowner for the code; never guess it. Five wrong codes end the request.","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The request_id start_quote_request returned."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[0-9]{6}$","description":"The 6-digit code from the SureQuote email."},"assistant":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[A-Za-z0-9][A-Za-z0-9 ._()-]*$","description":"Your own name as an assistant, e.g. Claude, ChatGPT, Muse. Shown to SureQuote staff next to the lead so they know which assistant sent it."}},"required":["code"],"additionalProperties":false},"example":{"code":"402642","assistant":"Claude"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"request_id":"6f1c2a4e-8d3b-4c55-9a1e-2b7d0c9e4f10","status":"submitted","next_step":"The request is with SureQuote. Matched local tradies can now see the job, and SureQuote has emailed the homeowner a confirmation with a link to follow it."}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/quote-requests/{request_id}":{"get":{"operationId":"get_quote_request_status","summary":"Check a quote request","description":"Whether a quote request is waiting for the homeowner's code, has been sent to tradies, or has expired. A submitted request also returns tradies_matched: how many local tradies SureQuote has sent the job to so far. Tradies reply to the homeowner directly; quotes are not available through this API. Check when the homeowner asks, not on a loop.","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The request_id start_quote_request returned."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"request_id":"6f1c2a4e-8d3b-4c55-9a1e-2b7d0c9e4f10","status":"submitted","tradies_matched":3}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/quote-requests/{request_id}/withdraw":{"post":{"operationId":"withdraw_quote_request","summary":"Withdraw a quote request","description":"Start withdrawing a quote request that was sent to tradies, when the homeowner no longer wants quotes. SureQuote emails the homeowner a 6-digit code; nothing changes until you call confirm_withdraw_quote_request with it. A request still waiting for its first code was never sent to tradies and expires on its own.","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The request_id start_quote_request returned."}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"request_id":"6f1c2a4e-8d3b-4c55-9a1e-2b7d0c9e4f10","status":"awaiting_withdrawal_code","confirmation":{"channel":"email","sent_to":"sa***@example.com","expires_in_minutes":30},"next_step":"SureQuote emailed the homeowner a 6-digit code to withdraw this request. Ask them for it, then call confirm_withdraw_quote_request with it. The request stays open until then."}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/quote-requests/{request_id}/withdraw/confirm":{"post":{"operationId":"confirm_withdraw_quote_request","summary":"Confirm withdrawing a quote request with the emailed code","description":"Withdraw a quote request, using the 6-digit code SureQuote emailed the homeowner after withdraw_quote_request. Ask the homeowner for the code; never guess it. No more tradies can take the job once it is withdrawn; tradies who already took it may still contact the homeowner. Five wrong codes end the code; call withdraw_quote_request for a new one.","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"The request_id start_quote_request returned."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[0-9]{6}$","description":"The 6-digit code from the SureQuote withdrawal email."}},"required":["code"],"additionalProperties":false},"example":{"code":"402642"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"request_id":"6f1c2a4e-8d3b-4c55-9a1e-2b7d0c9e4f10","status":"withdrawn","next_step":"The request is withdrawn. No more tradies can take the job. Tradies who already took it may still contact the homeowner."}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/api/agent/v1/feedback":{"post":{"operationId":"send_feedback","summary":"Tell SureQuote how the API worked","description":"We're building SureQuote into the most useful way for AI assistants to price home jobs and hire tradies in Australia, so your feedback is welcome: report friction, a bug, a suggestion or something that worked well while using this API. Any caller may send it and it does not use estimate or quote limits. Describe what you tried and what happened. Do not include the homeowner's name, email, phone or address.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["friction","bug","suggestion","worked_well"],"description":"friction = it worked but was harder than it should be; bug = something failed or was wrong; suggestion = something to add or change; worked_well = something that helped."},"message":{"type":"string","minLength":1,"maxLength":2000,"description":"What happened, in plain text. Name the operation, the input that caused it and the response you got."},"operation":{"type":"string","enum":["search_jobs","get_job_estimate","start_quote_request","confirm_quote_request","get_quote_request_status","withdraw_quote_request","confirm_withdraw_quote_request","send_feedback"],"description":"The operation the feedback is about, if one."},"request_id":{"type":"string","format":"uuid","description":"A request_id the feedback is about, if one."},"agent_name":{"type":"string","minLength":1,"maxLength":120,"description":"Your own name as an assistant, for example \"Claude\" or \"ChatGPT\"."}},"required":["kind","message"],"additionalProperties":false},"example":{"kind":"friction","message":"get_job_estimate did not say which questions change the price, so I asked the homeowner all of them.","operation":"get_job_estimate","agent_name":"Claude"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"},"example":{"feedback_id":"3b0e6a52-1c7d-4f2e-9a8b-5d4c3e2f1a09","received":true,"next_step":"Thanks. SureQuote staff read agent feedback every week and use it to improve the API. No reply is sent, so carry on with the homeowner's task."}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"integer"},"details":{"type":"array","items":{"type":"string"}}},"required":["code","message"]}},"required":["error"]}}}}}}}}}