Skip to main content
If you are building your own application and want to integrate chatbot functionality into it, you can call the chatbot directly through the VectorShift API. This gives you full control over how messages are sent and responses are displayed, and it supports both synchronous and streaming responses.

Full API Reference

See the complete API reference for all chatbot endpoints — run, list, upload, and terminate

Prerequisites

Your chatbot must be deployed before making API calls. Toggle Deployment Enabled in the chatbot builder’s Export tab. You also need your VectorShift API key, which you can find by clicking your profile icon in the top-left corner of the VectorShift app, then clicking API Keys.
The profile menu with API Keys highlighted

How it works

You send a POST request to the chatbot endpoint with your message. VectorShift runs the connected workflow and returns the chatbot’s response. To maintain conversation continuity across multiple messages, you include the conversation_id from the previous response in each subsequent request.
  1. First message: Send your text without a conversation_id. The API returns the bot’s response along with a new conversation_id.
  2. Subsequent messages: Include the conversation_id from the previous response. The chatbot retrieves the conversation history and responds in context.
  3. New conversation: Omit the conversation_id to start a fresh conversation at any time.
Always store the conversation_id from the first response and include it in every subsequent call. Without it, each call starts a new conversation and the chatbot loses context.

Authentication

Every API request must include your VectorShift API key in the Api-Key header. You can generate and manage API keys from your profile settings.

Request and response formats

Endpoint

Request body

Response (non-streaming)

Response (streaming)

When stream is set to true, the response is delivered as Server-Sent Events. Each event contains a JSON object with the current output text and the conversation_id. The final event includes the complete response.

Conversation management

Each conversation is identified by a conversation_id. The chatbot automatically generates a name for new conversations based on the first message (using a short LLM summary). To manage conversations programmatically:
  • Start a new conversation: Send a request without a conversation_id.
  • Continue an existing conversation: Include the conversation_id from the previous response.
  • List conversations: Use the List Chatbots API to retrieve chatbot metadata, including associated conversations.

Code examples

Python

JavaScript

cURL

Rate limits and error handling

If the chatbot fails to run (for example, the connected workflow encounters an error), the response will have "status": "failed" and include an error message. Common causes include:
  • The chatbot is not deployed (Deployment Enabled is off).
  • The connected workflow has a configuration error.
  • The API rate limit has been exceeded.
API calls are subject to rate limiting. If you receive a rate limit error, wait before retrying. See Subscriptions for details on rate limits by plan.
For the full API reference, including upload, terminate, and listing endpoints, see the API Reference.

Next steps

Analytics

Track usage, review conversations, and export data

Sharing and deploying

Explore other deployment channels