API reference

REST API reference

The Vyostra AI REST API has eight read-only endpoints under /v1, covering four resources: leads, chatbots, lead forms and voice agents. Every endpoint takes a GET request with an API key in the Authorization header and returns JSON. This page lists each endpoint, its parameters and every field in its response.

By Vinayak Tiwari, Co-Founder & Builder. Published .

What are the conventions for every request?

  • Base URL. Shown next to your keys in the dashboard under Settings. Examples here call it $VYOSTRA_API_URL.
  • Authentication. Authorization: Bearer followed by your key. See API keys and authentication.
  • Format. Responses are JSON with field names in camelCase. Timestamps are ISO 8601 strings in UTC.
  • Missing values. A field with no value is null. It is never left out, so every object of one type has the same keys.
  • Errors. A failed request returns an error object with a code and a message. See Errors and rate limits.
Method and pathReturnsScope
GET /v1/leadsA page of leadsleads:read
GET /v1/leads/:idOne lead with its transcriptleads:read
GET /v1/botsAll chatbotsbots:read
GET /v1/bots/:botIdOne chatbotbots:read
GET /v1/formsAll lead formsforms:read
GET /v1/forms/:formIdOne lead formforms:read
GET /v1/voice-agentsAll voice agentsvoice_agents:read
GET /v1/voice-agents/:agentIdOne voice agentvoice_agents:read

How do you list leads?

GET /v1/leads returns one page of the leads in your account, from every source.

Query parameterTypeMeaning
limitInteger, 1 to 200Leads per page. Defaults to 50.
cursorStringThe nextCursor value from the previous page.
includeArchivedtrueAlso return leads archived in the dashboard. Left out by default.
Shell
curl "$VYOSTRA_API_URL/v1/leads?limit=100" \
  -H "Authorization: Bearer $VYOSTRA_API_KEY"

The response body is the page itself:

FieldTypeMeaning
dataArray of leadsThe leads on this page.
nextCursorString or nullPass it as cursor to get the next page. null on the last page.
totalIntegerHow many leads match across all pages.
incompleteSourcesArray of stringsPresent only when a lead source could not be read. This page is then missing that source's leads.

Leads come back in dashboard inbox order, which is by urgency and not by date. The list covers every chat and form lead, plus the 500 most recent Meta lead ad leads and the 500 most recent voice leads.

What fields does a lead have?

FieldTypeMeaning
idStringThe lead's id, starting with lead_. Treat it as opaque.
sourceStringOne of chat, form, meta, voice.
sourceIdStringThe id of the chatbot, form, Facebook Page or voice agent the lead came through.
nameString or nullThe lead's name.
phoneString or nullThe lead's phone number.
emailString or nullThe lead's email address.
sourceUrlString or nullThe page the lead was captured on.
attributesObjectAnything else captured with the lead, as string values keyed by field name.
statusStringOne of new, contacted, qualified, closed.
outcomeString or nullOne of won, lost, unreachable. Set only on a closed lead.
leadScoreInteger or nullA score from 0 to 100, when one has been assigned.
archivedBooleanWhether the lead has been archived in the dashboard.
createdAtStringWhen the lead was captured.

How do you fetch one lead?

GET /v1/leads/:id returns a single lead wrapped in data. Use the id exactly as the list returned it.

Shell
curl "$VYOSTRA_API_URL/v1/leads/lead_WyJjaGF0IiwiOWYyYzFkN2UtYm90IiwiNWI4ZTQxYWEtbGVhZCJd" \
  -H "Authorization: Bearer $VYOSTRA_API_KEY"

It has every field in the table above, with two differences:

FieldTypeMeaning
transcriptString or nullThe chat conversation, for a lead captured by the chatbot. null when there is none.
attributesObjectAlso includes the answers submitted on a form or a Meta lead ad.

An id that does not exist, or belongs to another account, returns 404 with the code not_found.

How do you read chatbots?

GET /v1/bots returns every chatbot in the account as an array in data. GET /v1/bots/:botId returns one.

Shell
curl "$VYOSTRA_API_URL/v1/bots" \
  -H "Authorization: Bearer $VYOSTRA_API_KEY"
FieldTypeMeaning
botIdStringThe id used in the widget script tag.
nameStringThe chatbot's name.
websiteUrlString or nullThe site the chatbot was trained on.
greetingMessageStringThe first message a visitor sees.
brandColorStringThe widget colour as a hex code.
widgetTriggerStringWhen the widget opens: immediate, delay_5s, scroll_50 or exit_intent.
leadTriggerAfterMessagesIntegerHow many visitor messages before the lead form is offered.
leadFormFieldsArrayThe fields of the in-chat lead form. Each has fieldId, label, type, required and, for a select, options.
supportEmailString or nullThe support address shown in the widget.
createdAt, updatedAtStringWhen the chatbot was created and last changed.

How do you read lead forms?

GET /v1/forms returns every lead form as an array in data. GET /v1/forms/:formId returns one.

FieldTypeMeaning
formIdStringThe id used in the form widget script tag.
nameStringThe form's name.
descriptionString or nullThe text shown under the name.
submitButtonTextStringThe label on the submit button.
fieldsArrayEach field has fieldId, label, type, required and optionally placeholder and options. type is one of text, number, email, phone, options.
createdAt, updatedAtStringWhen the form was created and last changed.

How do you read voice agents?

GET /v1/voice-agents returns every voice agent as an array in data. GET /v1/voice-agents/:agentId returns one.

FieldTypeMeaning
agentIdStringThe id used in the voice widget script tag.
nameStringThe voice agent's name.
voiceStringThe voice it speaks with, for example coral or sage.
greetingMessageStringWhat the agent says first.
brandColorStringThe widget colour as a hex code.
widgetPositionStringOne of bottom-left, bottom-right, bottom-center.
maxSessionDurationIntegerThe longest a session can run, in minutes: 5, 10 or 15.
enabledBooleanWhether the agent is switched on.
createdAt, updatedAtStringWhen the agent was created and last changed.

What is not in the API yet?

The API is read-only. It has no endpoints that create or change anything, it does not send webhooks, and there is no official SDK. Fields may be added to a response over time, so write clients that ignore fields they do not recognise.

Common questions

Can the Vyostra AI API create or update leads?

Not yet. Every endpoint in the Vyostra AI API today is read-only: it can list and fetch leads, chatbots, forms and voice agents, and cannot create, change or delete them. Leads are created by the chatbot, form and voice widgets and by connected Meta lead ads.

Does the Vyostra AI API have webhooks?

No. The Vyostra AI API does not send webhooks today, so an integration that needs new leads has to poll GET /v1/leads on a schedule. The sync guide in these docs shows a polling loop that stays inside the rate limit.

In what order does GET /v1/leads return leads?

In the same order as the Vyostra AI dashboard inbox, which is by urgency rather than by date: overdue follow-ups first, then untouched leads, then scheduled, in-progress and closed ones. To get every lead, follow nextCursor until it is null instead of relying on the order.