Unltd AI logo

Getting started


Update Custom Bot Input

PATCH https://api.unltd.ai/v1/organizations/:organizationId/bots/:botSlug/inputs/:botInputId/

This endpoint updates a Bot Input entity for a specific organization and bot based on the provided information in the request body.

Request Body

accept

string

File types accepted by the input. This attribute is only used for file type inputs.

defaultValue

number or string

The default value for this bot input.

inputGroup

number

The index of the input group this input belongs to.

inputType

string

The type of the input, should be one of the supported UI input types.

label

string

The label for the bot input.

max

number

The maximum value for the bot input (if applicable).

min

number

The minimum value for the bot input (if applicable).

multiple

boolean

Specifies if multiple values can be selected (if applicable).

name

string

The name of the bot input.

options

array

An array of Bot Input Option objects for the bot input.

placeholder

string

A placeholder text for the bot input.

required

boolean

Specifies if the bot input is required.

rows

number

Number of rows for the bot input (if applicable).

step

number

Step interval for the bot input (if applicable).

value

number or string

The value of the bot input.

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/example_bot_slug/inputs/example_bot_input_id/", {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer ',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      defaultValue: 'option3',
      inputGroup: '1',
      inputType: 'select',
      label: 'Updated label',
      multiple: 'true',
      name: 'UpdatedInputName',
      options: '[object Object],[object Object]',
      placeholder: 'Select new options...',
      required: 'true',
      value: 'option3'
    })
  });

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

fetchApiData();

Response Object

200 success

The response object will be returned as a bot input.
{
  "defaultValue": "option3",
  "inputGroup": 1,
  "inputType": "select",
  "label": "Updated label",
  "multiple": true,
  "name": "UpdatedInputName",
  "options": [
    {
      "text": "Option 3",
      "value": "option3"
    },
    {
      "text": "Option 4",
      "value": "option4"
    }
  ],
  "placeholder": "Select new options...",
  "required": true,
  "value": "option3"
}