{"openapi":"3.0.3","info":{"title":"Vestly.ai API","version":"1.0","description":"Leads, conversations, bookings, knowledge and monthly numbers of your Vestly.ai company. Create a token in the dashboard under Account \u2192 API (Premium and Enterprise) and send it as \"Authorization: Bearer vy_\u2026\". 120 requests a minute per token. Webhooks (signed with X-Vestly-Signature-V2) tell you about new events as they happen."},"servers":[{"url":"https:\/\/app.vestly.ee\/api\/public\/v1"}],"components":{"securitySchemes":{"token":{"type":"http","scheme":"bearer"}}},"security":[{"token":[]}],"paths":{"\/leads":{"get":{"summary":"List leads, newest first","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"status","in":"query","required":false,"description":"new, contacted, booked, lost or spam","schema":{"type":"string"}},{"name":"score","in":"query","required":false,"description":"hot, warm or cold","schema":{"type":"string"}},{"name":"since","in":"query","required":false,"description":"Changed since (ISO 8601)","schema":{"type":"string"}},{"name":"per_page","in":"query","required":false,"description":"1\u2013100","schema":{"type":"integer"}}]}},"\/leads\/{id}":{"get":{"summary":"One lead","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Lead id","schema":{"type":"integer"}}]},"patch":{"summary":"Update status, note or follow-up date","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Lead id","schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","contacted","booked","lost","spam"]},"owner_note":{"type":"string"},"follow_up_at":{"type":"string","format":"date-time"}}}}}}}},"\/conversations":{"get":{"summary":"List conversations, newest first","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"since","in":"query","required":false,"description":"Active since (ISO 8601)","schema":{"type":"string"}},{"name":"per_page","in":"query","required":false,"description":"1\u2013100","schema":{"type":"integer"}}]}},"\/conversations\/{uuid}":{"get":{"summary":"One conversation with its messages","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"uuid","in":"path","required":true,"description":"Conversation id","schema":{"type":"string"}}]}},"\/bookings":{"get":{"summary":"Times booked in the chat","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"limit","in":"query","required":false,"description":"At most 500","schema":{"type":"integer"}}]}},"\/knowledge":{"get":{"summary":"Knowledge you added (by hand, questions and answers, files, linked documents)","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"bot_id","in":"query","required":false,"description":"Only this chatbot","schema":{"type":"integer"}}]},"post":{"summary":"Add a knowledge entry; the chatbot uses it at once","responses":{"200":{"description":"The created entry (201)."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["bot_id","title","content"],"properties":{"bot_id":{"type":"integer"},"title":{"type":"string"},"content":{"type":"string"},"lang":{"type":"string","example":"et"},"pinned":{"type":"boolean"},"question_answer":{"type":"boolean"}}}}}}}},"\/knowledge\/{id}":{"delete":{"summary":"Delete an entry you added","responses":{"200":{"description":"Deleted (204)."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"id","in":"path","required":true,"description":"Entry id","schema":{"type":"integer"}}]}},"\/stats":{"get":{"summary":"A month in numbers: conversations, leads, bookings, sales after a chat, languages, top questions","responses":{"200":{"description":"A JSON object with data."},"401":{"description":"Invalid token"},"403":{"description":"Plan without the API"}},"parameters":[{"name":"month","in":"query","required":false,"description":"YYYY-MM, default this month","schema":{"type":"string"}}]}}}}