{"openapi":"3.1.0","info":{"title":"LimeKiwi API","version":"1","description":"Manage agents, their goals, qualification and knowledge, leads, calls and meetings. Authenticate with an API key from Settings: Authorization: Bearer <key>. Successful responses are { data }, errors { error }."},"servers":[{"url":"https://app.limekiwi.ai/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer"}},"responses":{"Error":{"description":"Something was wrong with the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"paths":{"/company":{"get":{"operationId":"get_company","summary":"Your company's settings (name, timezone, recording retention) and how many agents, leads and calls it has.","parameters":[],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"update_company","summary":"Change the company name, timezone (calling hours and booking follow it) or how long call recordings are kept.","description":"Changes settings or the playbook.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","enum":["Australia/Sydney","Australia/Melbourne","Australia/Brisbane","Australia/Adelaide","Australia/Darwin","Australia/Perth","Australia/Hobart"]},"recordingRetentionDays":{"type":"integer","minimum":1,"maximum":2555,"description":"Days to keep call recordings"}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents":{"get":{"operationId":"list_agents","summary":"List the company's agents.","parameters":[],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"create_agent","summary":"Create a new agent. Pick its kind (salesperson, receptionist, appointment setter, lead qualifier, customer support or feedback & surveys) and give its name, company, company description and offer (what the company sells or does); write sensible objection handling and rules if the user doesn't. Goals, qualification criteria and knowledge can be given now or added after; without them, non-sales kinds start with ones suited to the job. The voice defaults to the one your latest agent uses.","description":"Changes settings or the playbook.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["sales","receptionist","appointment_setter","lead_qualifier","consultant","account_manager","support","appointment_reminders","recruiter","payment_reminders","events","surveys"],"description":"The job it does: sales (Salesperson), receptionist (Receptionist), appointment_setter (Appointment setter), lead_qualifier (Lead qualifier), consultant (Consultant), account_manager (Account manager), support (Customer support), appointment_reminders (Appointment reminders), recruiter (Recruiter), payment_reminders (Payment reminders), events (Event bookings), surveys (Feedback & surveys)"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"The agent's first name, which it introduces itself with"},"companyName":{"type":"string","minLength":1,"maxLength":120,"description":"The company it calls for"},"companyDescription":{"type":"string","minLength":1,"maxLength":4000,"description":"Who the company is, in a few sentences"},"offer":{"type":"string","minLength":1,"maxLength":4000,"description":"What it sells or offers, with typical prices if it may mention them"},"objections":{"type":"string","minLength":1,"maxLength":4000,"description":"How to answer common objections"},"guardrails":{"type":"string","minLength":1,"maxLength":4000,"description":"Rules it must never break"},"playbookSections":{"description":"Extra sections on its job tab (promotions, scripts, comparisons); replaces the existing ones","maxItems":30,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"content":{"type":"string","minLength":1,"maxLength":8000}},"required":["title","content"]}},"brain":{"type":"string","enum":["gemini","claude"],"description":"The AI model behind the agent"},"voiceProvider":{"type":"string","enum":["fish"]},"voiceId":{"type":"string","minLength":1,"maxLength":200,"description":"The voice's id on the voice provider"},"backupVoiceId":{"description":"A voice on another provider, used if the main voice fails","type":["string","null"]},"phoneNumber":{"description":"The Twilio number it answers and calls from","type":["string","null"]},"transferNumber":{"description":"Where hot leads are live-transferred: a phone number or sip: address","type":["string","null"]},"transferName":{"description":"Who they're transferred to, e.g. 'the sales team'","type":["string","null"]},"sipTrunk":{"description":"The customer's own phone system host, for outbound calls","type":["string","null"]},"recordCalls":{"type":"boolean","description":"Record calls (always announced to the caller)"},"smsEnabled":{"type":"boolean","description":"Let it text the person on the call"},"smsFreeform":{"type":"boolean","description":"Let it also write short texts in its own words, not just its messages"},"smsTemplates":{"description":"The text messages it may send; replaces the existing ones","maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"when":{"default":"","type":"string","maxLength":300},"body":{"type":"string","minLength":1,"maxLength":600,"description":"The text, with {first_name}, {agent_name}, {company}, {phone}, {meeting_time} or {details}"},"active":{"default":true,"description":"Offered on calls; off keeps it without using it","type":"boolean"}},"required":["name","body"]}},"healthQuotes":{"type":"boolean","description":"Quote Australian health insurance on calls"},"firstQuestion":{"description":"Asked word for word once an outbound lead says they have a minute","type":["string","null"]},"bookingDays":{"type":"string","pattern":"^[0-6](,[0-6])*$","description":"Days meetings can be booked, as weekday numbers: 0 Sunday to 6 Saturday, e.g. 1,2,3,4,5"},"bookingStart":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Earliest meeting start, 24-hour, e.g. 09:00"},"bookingEnd":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Latest meeting end, 24-hour, e.g. 17:00"},"meetingMinutes":{"type":"integer","minimum":5,"maximum":480,"description":"Appointment length in minutes"},"bookingGapMinutes":{"type":"integer","minimum":0,"maximum":240,"description":"Minutes kept free before and after each appointment"},"bookingNoticeHours":{"type":"integer","minimum":0,"maximum":720,"description":"The soonest a booking can start, in hours from now"},"bookingAheadDays":{"type":"integer","minimum":1,"maximum":90,"description":"How many days ahead it offers times"},"notifySms":{"description":"Where call summaries are texted","type":["string","null"]},"notifyEmail":{"description":"Where call summaries are emailed","type":["string","null"]},"maxAttempts":{"type":"integer","minimum":1,"maximum":10,"description":"Most times a lead is called before giving up"},"personality":{"type":"object","properties":{"gender":{"type":"string","enum":["female","male"],"description":"Whether the agent is a woman or a man; pick a voice to match"},"language":{"type":"string","enum":["en","zh","ar","vi","yue","pa","el","it","tl","hi","es","ko","ja","id","th","fr","de","pt","tr"],"description":"The language calls are held in"},"accent":{"type":"string","enum":["australian","british","american","new_zealand","irish","scottish","indian","south_african","canadian"],"description":"Their accent when speaking English; pick a voice to match"},"role":{"type":"string","maxLength":80,"description":"Their job title, e.g. 'health cover specialist'; empty for none"},"traits":{"type":"object","properties":{"warmth":{"type":"integer","minimum":1,"maximum":5,"description":"Warmth: 1 Reserved to 5 Warm"},"energy":{"type":"integer","minimum":1,"maximum":5,"description":"Energy: 1 Calm to 5 Upbeat"},"formality":{"type":"integer","minimum":1,"maximum":5,"description":"Formality: 1 Casual to 5 Formal"},"humour":{"type":"integer","minimum":1,"maximum":5,"description":"Humour: 1 Serious to 5 Playful"},"assertiveness":{"type":"integer","minimum":1,"maximum":5,"description":"Assertiveness: 1 Gentle to 5 Assertive"},"talkativeness":{"type":"integer","minimum":1,"maximum":5,"description":"How much they say: 1 Brief to 5 Chatty"}}},"notes":{"type":"string","maxLength":1000,"description":"Anything else about how they come across, e.g. phrases they use"}},"description":"How the agent comes across: gender, language, accent, role, notes and trait sliders from 1 to 5"},"goals":{"description":"In order: the main goal first, then fallbacks","maxItems":10,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"The goal in a few words, e.g. 'Book a free consult'"},"instructions":{"default":"","description":"How to get there","type":"string","maxLength":4000},"outcome":{"type":"string","enum":["booked","transferred","qualified","follow_up"],"description":"The call outcome that counts as reaching it"}},"required":["title","outcome"]}},"criteria":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200,"description":"What to find out, e.g. 'Owns their home'"},"detail":{"default":"","description":"More on what counts","type":"string","maxLength":4000},"required":{"default":true,"description":"Must find out (true) or good to know (false)","type":"boolean"},"disqualifyIf":{"description":"When the answer means they're not a fit","type":["string","null"]}},"required":["label"]}},"knowledge":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"content":{"type":"string","minLength":1,"maxLength":20000,"description":"The facts, in plain sentences"}},"required":["title","content"]}}},"required":["name","companyName","companyDescription","offer"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}":{"get":{"operationId":"get_agent","summary":"Everything about one agent: its settings, goals in order, qualification criteria and knowledge sources.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"update_agent","summary":"Change any of an agent's settings except its kind, which is fixed once it's created. Only the fields given are changed.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80,"description":"The agent's first name, which it introduces itself with"},"companyName":{"type":"string","minLength":1,"maxLength":120,"description":"The company it calls for"},"companyDescription":{"type":"string","minLength":1,"maxLength":4000,"description":"Who the company is, in a few sentences"},"offer":{"type":"string","minLength":1,"maxLength":4000,"description":"What it sells or offers, with typical prices if it may mention them"},"objections":{"type":"string","minLength":1,"maxLength":4000,"description":"How to answer common objections"},"guardrails":{"type":"string","minLength":1,"maxLength":4000,"description":"Rules it must never break"},"playbookSections":{"description":"Extra sections on its job tab (promotions, scripts, comparisons); replaces the existing ones","maxItems":30,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"content":{"type":"string","minLength":1,"maxLength":8000}},"required":["title","content"]}},"brain":{"type":"string","enum":["gemini","claude"],"description":"The AI model behind the agent"},"voiceProvider":{"type":"string","enum":["fish"]},"voiceId":{"type":"string","minLength":1,"maxLength":200,"description":"The voice's id on the voice provider"},"backupVoiceId":{"description":"A voice on another provider, used if the main voice fails","type":["string","null"]},"phoneNumber":{"description":"The Twilio number it answers and calls from","type":["string","null"]},"transferNumber":{"description":"Where hot leads are live-transferred: a phone number or sip: address","type":["string","null"]},"transferName":{"description":"Who they're transferred to, e.g. 'the sales team'","type":["string","null"]},"sipTrunk":{"description":"The customer's own phone system host, for outbound calls","type":["string","null"]},"recordCalls":{"type":"boolean","description":"Record calls (always announced to the caller)"},"smsEnabled":{"type":"boolean","description":"Let it text the person on the call"},"smsFreeform":{"type":"boolean","description":"Let it also write short texts in its own words, not just its messages"},"smsTemplates":{"description":"The text messages it may send; replaces the existing ones","maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"when":{"default":"","type":"string","maxLength":300},"body":{"type":"string","minLength":1,"maxLength":600,"description":"The text, with {first_name}, {agent_name}, {company}, {phone}, {meeting_time} or {details}"},"active":{"default":true,"description":"Offered on calls; off keeps it without using it","type":"boolean"}},"required":["name","body"]}},"healthQuotes":{"type":"boolean","description":"Quote Australian health insurance on calls"},"firstQuestion":{"description":"Asked word for word once an outbound lead says they have a minute","type":["string","null"]},"bookingDays":{"type":"string","pattern":"^[0-6](,[0-6])*$","description":"Days meetings can be booked, as weekday numbers: 0 Sunday to 6 Saturday, e.g. 1,2,3,4,5"},"bookingStart":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Earliest meeting start, 24-hour, e.g. 09:00"},"bookingEnd":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Latest meeting end, 24-hour, e.g. 17:00"},"meetingMinutes":{"type":"integer","minimum":5,"maximum":480,"description":"Appointment length in minutes"},"bookingGapMinutes":{"type":"integer","minimum":0,"maximum":240,"description":"Minutes kept free before and after each appointment"},"bookingNoticeHours":{"type":"integer","minimum":0,"maximum":720,"description":"The soonest a booking can start, in hours from now"},"bookingAheadDays":{"type":"integer","minimum":1,"maximum":90,"description":"How many days ahead it offers times"},"notifySms":{"description":"Where call summaries are texted","type":["string","null"]},"notifyEmail":{"description":"Where call summaries are emailed","type":["string","null"]},"maxAttempts":{"type":"integer","minimum":1,"maximum":10,"description":"Most times a lead is called before giving up"},"personality":{"type":"object","properties":{"gender":{"type":"string","enum":["female","male"],"description":"Whether the agent is a woman or a man; pick a voice to match"},"language":{"type":"string","enum":["en","zh","ar","vi","yue","pa","el","it","tl","hi","es","ko","ja","id","th","fr","de","pt","tr"],"description":"The language calls are held in"},"accent":{"type":"string","enum":["australian","british","american","new_zealand","irish","scottish","indian","south_african","canadian"],"description":"Their accent when speaking English; pick a voice to match"},"role":{"type":"string","maxLength":80,"description":"Their job title, e.g. 'health cover specialist'; empty for none"},"traits":{"type":"object","properties":{"warmth":{"type":"integer","minimum":1,"maximum":5,"description":"Warmth: 1 Reserved to 5 Warm"},"energy":{"type":"integer","minimum":1,"maximum":5,"description":"Energy: 1 Calm to 5 Upbeat"},"formality":{"type":"integer","minimum":1,"maximum":5,"description":"Formality: 1 Casual to 5 Formal"},"humour":{"type":"integer","minimum":1,"maximum":5,"description":"Humour: 1 Serious to 5 Playful"},"assertiveness":{"type":"integer","minimum":1,"maximum":5,"description":"Assertiveness: 1 Gentle to 5 Assertive"},"talkativeness":{"type":"integer","minimum":1,"maximum":5,"description":"How much they say: 1 Brief to 5 Chatty"}}},"notes":{"type":"string","maxLength":1000,"description":"Anything else about how they come across, e.g. phrases they use"}},"description":"How the agent comes across: gender, language, accent, role, notes and trait sliders from 1 to 5"}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"delete_agent","summary":"Delete an agent for good, with its leads, calls, meetings and recordings. The do-not-call list is kept. Can't be undone.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/active":{"post":{"operationId":"set_agent_active","summary":"Pause an agent (it stops answering and calling) or switch it back on.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/stats":{"get":{"operationId":"get_agent_stats","summary":"An agent's dashboard numbers for recent days: calls, answered, conversations, goal rate, outcomes, average talk time.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":365}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/goals":{"post":{"operationId":"add_goal","summary":"Add a goal to the end of an agent's goals. The first goal is the main one; later ones are fallbacks.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"The goal in a few words, e.g. 'Book a free consult'"},"instructions":{"default":"","description":"How to get there","type":"string","maxLength":4000},"outcome":{"type":"string","enum":["booked","transferred","qualified","follow_up"],"description":"The call outcome that counts as reaching it"}},"required":["title","outcome"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/goals/{goalId}":{"patch":{"operationId":"update_goal","summary":"Change a goal's title, instructions or outcome.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"goalId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"The goal in a few words, e.g. 'Book a free consult'"},"instructions":{"default":"","description":"How to get there","type":"string","maxLength":4000},"outcome":{"type":"string","enum":["booked","transferred","qualified","follow_up"],"description":"The call outcome that counts as reaching it"}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"delete_goal","summary":"Delete one of an agent's goals.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"goalId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/goals/{goalId}/move":{"post":{"operationId":"move_goal","summary":"Move a goal up or down one place.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"goalId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["up","down"]}},"required":["direction"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/criteria":{"post":{"operationId":"add_criterion","summary":"Add something the agent must find out (or should, if it comes up) before moving to a goal.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200,"description":"What to find out, e.g. 'Owns their home'"},"detail":{"default":"","description":"More on what counts","type":"string","maxLength":4000},"required":{"default":true,"description":"Must find out (true) or good to know (false)","type":"boolean"},"disqualifyIf":{"description":"When the answer means they're not a fit","type":["string","null"]}},"required":["label"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/criteria/{criterionId}":{"patch":{"operationId":"update_criterion","summary":"Change a qualification criterion.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"criterionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200,"description":"What to find out, e.g. 'Owns their home'"},"detail":{"default":"","description":"More on what counts","type":"string","maxLength":4000},"required":{"default":true,"description":"Must find out (true) or good to know (false)","type":"boolean"},"disqualifyIf":{"description":"When the answer means they're not a fit","type":["string","null"]}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"delete_criterion","summary":"Delete a qualification criterion.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"criterionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/criteria/{criterionId}/move":{"post":{"operationId":"move_criterion","summary":"Move a qualification criterion up or down one place.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"criterionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["up","down"]}},"required":["direction"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/knowledge/{knowledgeId}":{"get":{"operationId":"get_knowledge","summary":"The full text of one knowledge source.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"knowledgeId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"update_knowledge","summary":"Edit a written knowledge entry, switch a source on or off, or re-read a web page (refresh: true).","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"knowledgeId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"content":{"description":"New text, for written entries","type":"string","minLength":1,"maxLength":20000},"enabled":{"description":"Whether the agent uses it","type":"boolean"},"refresh":{"description":"Re-read a web page source","type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"delete_knowledge","summary":"Delete a knowledge source.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"knowledgeId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/knowledge":{"post":{"operationId":"add_knowledge","summary":"Add facts the agent may state on calls: a written entry, or a web page, which is read now and digested into a fact sheet (calls never look it up).","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"description":"Defaults to the page title for a web page","type":"string","maxLength":200},"content":{"description":"The facts, for a written entry","type":"string","maxLength":20000},"url":{"description":"A web page to read instead of written content","type":"string","format":"uri"}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/connections":{"get":{"operationId":"list_connections","summary":"An agent's custom connections: other apps' MCP servers whose tools it can use on calls.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"add_connection","summary":"Connect an app's MCP server to an agent so it can use the app's tools on calls. Only for servers the user says they trust.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"description":"What it's for, so the agent knows when to use it","anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"url":{"type":"string","format":"uri","description":"The MCP server's streamable HTTP address, often ending in /mcp"},"authType":{"default":"none","type":"string","enum":["none","bearer","header"]},"headerName":{"description":"For authType header, e.g. X-API-Key","anyOf":[{"type":"string","pattern":"^[A-Za-z0-9-]+$"},{"type":"null"}]},"secret":{"description":"The API key, for bearer or header auth","type":["string","null"]}},"required":["name","url"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/agents/{agentId}/connections/{connectionId}":{"patch":{"operationId":"update_connection","summary":"Switch a connection on or off, switch one of its tools on or off, or re-read its tools from the server.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"connectionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"tool":{"description":"A tool's name, to switch with toolEnabled","type":"string"},"toolEnabled":{"type":"boolean"},"refresh":{"type":"boolean"}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"delete_connection","summary":"Remove a custom connection from an agent.","description":"Changes settings or the playbook.","parameters":[{"name":"agentId","in":"path","required":true,"schema":{"type":"string"}},{"name":"connectionId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/leads":{"get":{"operationId":"list_leads","summary":"List leads, newest first. Filter by agent, status, or a search on name, phone, email or company.","parameters":[{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","queued","calling","booked","transferred","follow_up","not_interested","do_not_call","unreachable","blocked"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"description":"How many to return (1 to 200)","type":"integer","minimum":1,"maximum":200}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"description":"How many to skip, for paging","type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"add_lead","summary":"Add a lead for an agent. With queue: true the agent rings them at the next allowed calling time (straight away within calling hours).","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"phone":{"type":"string","minLength":1,"description":"Australian mobile or landline, any format"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"description":"What the agent should know before calling","anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"agentId":{"type":"string","minLength":1,"description":"The agent's id"},"consent":{"default":"requested","type":"string","enum":["requested","existing_customer","none"],"description":"requested: they asked to be contacted. existing_customer: a current customer. none: a cold lead, which must be washed against the Do Not Call Register before calling"},"dncrChecked":{"default":false,"description":"Washed against the Do Not Call Register in the last 30 days","type":"boolean"},"queue":{"default":false,"description":"Queue them to be called","type":"boolean"}},"required":["name","phone","agentId"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/leads/{leadId}":{"get":{"operationId":"get_lead","summary":"One lead with its calls (newest first) and meetings.","parameters":[{"name":"leadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"update_lead","summary":"Change a lead's name, phone, email, company or notes.","parameters":[{"name":"leadId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"phone":{"type":"string","minLength":1,"description":"Australian mobile or landline, any format"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"description":"What the agent should know before calling","anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/leads/import":{"post":{"operationId":"import_leads","summary":"Add up to 1,000 leads for an agent at once and queue them all to be called. They share one consent basis.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","minLength":1,"description":"The agent's id"},"consent":{"type":"string","enum":["requested","existing_customer","none"],"description":"requested: they asked to be contacted. existing_customer: a current customer. none: a cold lead, which must be washed against the Do Not Call Register before calling"},"dncrChecked":{"default":false,"description":"The list was washed against the Do Not Call Register in the last 30 days","type":"boolean"},"leads":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"phone":{"type":"string","minLength":1,"description":"Australian mobile or landline, any format"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"description":"What the agent should know before calling","anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["name","phone"]}}},"required":["agentId","consent","leads"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/leads/status":{"post":{"operationId":"set_leads_status","summary":"For one or more leads: queue them to be called, record that they were washed against the Do Not Call Register (which also queues them), or take them off the queue.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leadIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string"}},"action":{"type":"string","enum":["queue","dncr_checked","unqueue"]}},"required":["leadIds","action"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/leads/{leadId}/call":{"post":{"operationId":"call_lead_now","summary":"Have the lead's agent ring them now. Calling hours and the do-not-call list still apply.","parameters":[{"name":"leadId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/leads/reset":{"post":{"operationId":"reset_leads","summary":"For testing: put every lead back to new with no attempts or follow-ups. Do-not-call requests stay, except for your own test numbers.","description":"Changes settings or the playbook.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/calls":{"get":{"operationId":"list_calls","summary":"List calls, newest first, with each call's one-line summary. Filter by agent, lead, outcome or direction.","parameters":[{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"leadId","in":"query","required":false,"schema":{"type":"string"}},{"name":"outcome","in":"query","required":false,"schema":{"type":"string","enum":["booked","transferred","qualified","follow_up","not_qualified","not_interested","do_not_call","voicemail","no_answer","failed","other"]}},{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["inbound","outbound","test"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"description":"How many to return (1 to 200)","type":"integer","minimum":1,"maximum":200}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"description":"How many to skip, for paging","type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/calls/{callId}":{"get":{"operationId":"get_call","summary":"One call with its full transcript and summary.","parameters":[{"name":"callId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/meetings":{"get":{"operationId":"list_meetings","summary":"Meetings the agents booked, soonest first. Upcoming only unless a from date is given.","parameters":[{"name":"agentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"description":"ISO date-time; defaults to now","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"description":"How many to return (1 to 200)","type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/health-quotes":{"post":{"operationId":"quote_health_cover","summary":"Compare every Australian health fund open to the public and return the cheapest policies that fit, monthly and before the government rebate.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["NSW","VIC","QLD","SA","WA","TAS","ACT","NT"]},"cover":{"type":"string","enum":["single","couple","family","single_parent"]},"wants":{"type":"string","enum":["hospital","extras","both"]},"hospital_tier":{"anyOf":[{"type":"string","enum":["basic","bronze","silver","gold"]},{"type":"null"}]},"must_cover":{"anyOf":[{"type":"array","items":{"type":"string","enum":["AssistedReproductive","BackNeckSpine","Blood","BoneJointMuscle","BrainNervousSystem","BreastSurgery","Cataracts","ChemotherapyRadiotherapyImmunotherapy","DentalSurgery","Diabetes","Dialysis","DigestiveSystem","EarNoseThroat","Eye","GastrointestinalEndoscopy","Gynaecology","HeartVascular","HerniaAppendix","HospitalPsychiatric","ImplantationHearingDevices","InsulinPumps","JointReconstructions","JointReplacements","KidneyBladder","LungChest","MaleReproductive","MiscarriageTerminationOfPregnancy","PainManagement","PainManagementWithDevice","PalliativeCare","PlasticReconstructiveSurgery","PodiatricSurgery","PregnancyBirth","Rehabilitation","Skin","SleepStudies","TonsilsAdenoidsGrommets","WeightLossSurgery"]}},{"type":"null"}]},"extras":{"anyOf":[{"type":"array","items":{"type":"string","enum":["DentalGeneral","DentalMajor","Endodontic","Orthodontic","Optical","Physiotherapy","Chiropractic","Osteopathy","RemedialMassage","Podiatry","Psychology","Acupuncture","HearingAids","Audiology","Dietetics","ExercisePhysiology","NonPBS","SpeechTherapy","OccupationalTherapy","Orthotics","GlucoseMonitor","AntenatalPostnatal","Vaccinations"]}},{"type":"null"}]},"max_excess":{"type":["number","null"]},"max_monthly_budget":{"type":["number","null"]}},"required":["state","cover","wants"]}}}},"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"data":{}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}}}}