Create a Chatbot

This API allows you to create a new Chatbot.


Generate your own API Key

The first thing you have to do to access Ollabot API, is by generating your own API Key. You can generate your API Key by following the steps here: Generate API Key.

Create API Guide

The Chatbot Creation API allows you to create a new chatbot by making a POST request to the /api/v1/create-chatbot endpoint. Note that you can only create One (1) chatbot per account.

Endpoint

POST https://app.ollabot.com/api/v1/create-chatbot

Request Headers

The API request must include the following headers:

  • Authorization: Bearer <Your-Secret-Key> - The secret key for authenticating the API request.
  • Content-Type: application/json - The content type of the request payload.

Request Body

The request body should contain the following parameters:

  • name (string, required): The name of the chatbot.
  • description (string, optional): A brief description of the chatbot.

Example Request

JavaScript

const res = await fetch('https://app.ollabot.com/api/v1/create-chatbot', {
  method: 'POST',
  headers: {
    Authorization: `Bearer <Your-Secret-Key>`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    name: 'example chatbot',
    description: 'This is an example chatbot.'
  })
});
 
const data = await res.json();
 
console.log(data); // {chatbotId: 'exampleId-123'}

Python

import requests
 
url = 'https://app.ollabot.com/api/v1/create-chatbot'
headers = {
    'Authorization': 'Bearer <Your-Secret-Key>',
    'Content-Type': 'application/json'
}
data = {
    'name': 'example chatbot',
    'description': 'This is an example chatbot.'
}
 
response = requests.post(url, json=data, headers=headers)
print(response.json())

Shell

curl -X POST https://app.ollabot.com/api/v1/create-chatbot \
  -H "Authorization: Bearer <Your-Secret-Key>" \
  -H "Content-Type: application/json" \
  -d '{"name": "example chatbot", "description": "This is an example chatbot."}'

Response

The API response will be a JSON object with the following structure:

{
  "chatbotId": "exampleId-123"
}

The chatbotId field in the response contains the unique identifier assigned to the created chatbot.

Error Handling

If there are any errors during the API request, appropriate HTTP status codes will be returned along with error messages in the response body. Make sure to handle these errors gracefully in your application.