{"openapi":"3.1.0","info":{"title":"Belline Connect","version":"1.0.0","description":"Find a local business, read its services and price ranges, and send it a request for a person. A request is not a booking: the business answers, and the status says what it answered. Only businesses whose owner switched this on are listed."},"servers":[{"url":"https://app.belline.ai/api/connect/v1"}],"paths":{"/businesses":{"get":{"operationId":"searchBusinesses","summary":"Search listed businesses (text match; distance is not searched)","parameters":[{"name":"trade","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"lang","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Businesses with services and price ranges.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/businesses/{slug}":{"get":{"operationId":"getBusiness","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"One business.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/businesses/{slug}/services":{"get":{"operationId":"getServices","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Services with the owner's prices.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/businesses/{slug}/availability":{"get":{"operationId":"getAvailability","summary":"Free times (mode slots), opening windows (mode windows) or none (mode request). Never invented.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"service_id","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string"}},{"name":"to","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Availability.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/businesses/{slug}/ask":{"post":{"operationId":"askBusiness","summary":"Put a question to the business's own receptionist (Belle). Not a booking.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message","agent"],"properties":{"message":{"type":"string","description":"The question, up to about 600 characters."},"conversation_id":{"type":"string","description":"From an earlier answer, to continue the conversation."},"agent":{"type":"object","required":["name"],"properties":{"name":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Belle's answer and a conversation_id."},"400":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"502":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"503":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/businesses/{slug}/bookings":{"post":{"operationId":"bookSlot","summary":"Book an open time directly. Only where the business's profile says instantBooking is true; otherwise send an inquiry.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["service_id","date","start","customer","agent"],"properties":{"service_id":{"type":"string"},"date":{"type":"string","description":"YYYY-MM-DD, from availability."},"start":{"type":"string","description":"HH:MM, from availability."},"customer":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}},"notes":{"type":"string"},"agent":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"request_id":{"type":"string"}}}}}}}},"responses":{"200":{"description":"The same request_id was booked before; the same booking."},"201":{"description":"A real booking, with a reference and a link to change or cancel it."},"400":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"403":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"409":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/businesses/{slug}/inquiries":{"post":{"operationId":"createInquiry","summary":"Ask the business for a booking. Not a booking.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customer","preferred","agent"],"properties":{"customer":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}},"service_id":{"type":"string"},"description":{"type":"string"},"address":{"type":"string"},"preferred":{"type":"string","description":"When, in words: 'Thursday 14:00 to 16:00'."},"urgency":{"type":"string","enum":["emergency","this_week","flexible"]},"agent":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"request_id":{"type":"string"},"callback_url":{"type":"string","description":"https only; reserved, not called yet."}}}}}}}},"responses":{"200":{"description":"The same request_id was sent before; the same inquiry."},"201":{"description":"Received."},"400":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/inquiries/{id}":{"get":{"operationId":"getInquiry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^req_[a-f0-9-]{12}$"}}],"responses":{"200":{"description":"received, proposed, accepted, declined, cancelled or expired.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/inquiries/{id}/accept":{"post":{"operationId":"acceptProposal","summary":"Agree to the other time the business suggested. Only while the status is proposed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^req_[a-f0-9-]{12}$"}}],"responses":{"200":{"description":"Accepted; the suggested time is the message."},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"409":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/inquiries/{id}/cancel":{"post":{"operationId":"cancelInquiry","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^req_[a-f0-9-]{12}$"}}],"responses":{"200":{"description":"Cancelled."},"404":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"409":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"An error an assistant can act on.","content":{"application/json":{"schema":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string"},"fix":{"type":"string"}}}}}}}}}}}