Unltd AI logo

Getting started


Create Custom Bot

POST https://api.unltd.ai/v1/organizations/:organizationId/bots/

This endpoint creates a new Bot entity for a specific organization based on the provided information in the request body.

Request Body

modelKey

string

A key for the model that the bot uses. This is required.

description

string

A description of the bot.

name

string

The name of the bot. This is required.

prompt

string

The prompt for the bot.

inputs

array

An array of bot input objects. This is optional.

Permissions

This request requires an authenticated user who is an admin of the organization or an organization token.

API Example

const fetchApiData = async () => {
  const response = await fetch("https://api.unltd.ai/v1/organizations/example_org_id/bots/", {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      description: 'This is an example of how to post a bot.',
      name: 'My First Bot',
      modelKey: 'textCompletion',
      prompt: 'Hello Bots!'
    })
  });

  const data = await response.json();
  console.log(data);
};

fetchApiData();

Response Object

201 success

The response object will be returned as a bot.
{
  "modelKey": "textCompletion",
  "name": "'My First Bot",
  "description": "This is an example of how to post a bot.",
  "prompt": "Hello Bots!?",
  "slug": "organizationNameMyFirstBot",
  "inputs": []
}