Skip to main content
POST
/
assistants
/
v1
/
tools
Create Tool
curl --request POST \
  --url https://api-prod.interactly.ai/assistants/v1/tools \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "function",
  "async": false,
  "function": {
    "name": "getUserDetailsByPhoneNumber",
    "description": "Get user details by phone number, Run this tool when you want user details like name, dob etc by their phone number",
    "parameters": {
      "type": "object",
      "properties": {
        "dob": {
          "type": "string",
          "format": "date",
          "description": "This is the date of birth of the user.",
          "example": "1990-03-08"
        },
        "phoneNumber": {
          "type": "string",
          "description": "This is the phone number of the user.",
          "example": "+919867543210"
        }
      },
      "required": [
        "phoneNumber"
      ],
      "additionalProperties": false
    },
    "strict": false
  },
  "messages": [
    {
      "type": "request-start",
      "content": "Please wait while I fetch the details."
    }
  ],
  "server": {
    "url": "https://api.example.com/v1/getUserDetails",
    "timeoutSeconds": 20,
    "secret": "my-secret",
    "headers": {}
  }
}
'
{
  "_id": "1f7b1b1b1b1b1b1b1b1b1b1b",
  "teamId": "3f7b1b1b1b1b1b1b1b1b1b1b",
  "type": "function",
  "async": false,
  "function": {
    "name": "getUserDetailsByPhoneNumber",
    "description": "Get user details by phone number, Run this tool when you want user details like name, dob etc by their phone number",
    "parameters": {
      "type": "object",
      "properties": {
        "dob": {
          "type": "string",
          "format": "date",
          "description": "This is the date of birth of the user.",
          "example": "1990-03-08"
        },
        "phoneNumber": {
          "type": "string",
          "description": "This is the phone number of the user.",
          "example": "+919867543210"
        }
      },
      "required": [
        "phoneNumber"
      ],
      "additionalProperties": false
    },
    "strict": false
  },
  "messages": [
    {
      "type": "request-start",
      "content": "Please wait while I fetch the details."
    }
  ],
  "server": {
    "url": "https://api.example.com/v1/getUserDetails",
    "timeoutSeconds": 20,
    "secret": "my-secret",
    "headers": {}
  },
  "createdAt": "2020-10-05T00:00:00.000Z",
  "updatedAt": "2020-10-05T00:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Retrieve your API Key from Dashboard API Keys Section.

Body

application/json
type
enum<string>
required

The type of tool. "function" for Function tool.

Available options:
function
async
boolean

This determines if the tool is async.

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

Defaults to synchronous (false).

Example:

false

function
object

This is the function definition of the tool.

messages
(ToolMessageStart · object | ToolMessageComplete · object | ToolMessageFailed · object | ToolMessageDelayed · object)[]

These are the messages that will be spoken to the user as the tool is running.

server
object

This is the server that will be hit when this tool is requested by the model.

All requests will be sent with the call object among other things.

Response

_id
string
required

This is the unique identifier for the tool.

Example:

"1f7b1b1b1b1b1b1b1b1b1b1b"

teamId
string
required

This is the unique identifier for the organization that this tool belongs to.

Example:

"3f7b1b1b1b1b1b1b1b1b1b1b"

type
enum<string>
required

The type of tool. "function" for Function tool.

Available options:
function
Example:

"function"

async
boolean

This determines if the tool is async.

If async, the assistant will move forward without waiting for your server to respond. This is useful if you just want to trigger something on your server.

If sync, the assistant will wait for your server to respond. This is useful if want assistant to respond with the result from your server.

Defaults to synchronous (false).

Example:

false

function
object

This is the function definition of the tool.

messages
(ToolMessageStart · object | ToolMessageComplete · object | ToolMessageFailed · object | ToolMessageDelayed · object)[]

These are the messages that will be spoken to the user as the tool is running.

server
object

This is the server that will be hit when this tool is requested by the model.

All requests will be sent with the call object among other things.

createdAt
string<date-time>

This is the ISO 8601 date-time string of when the record was created.

Example:

"2020-10-05T00:00:00.000Z"

updatedAt
string<date-time>

This is the ISO 8601 date-time string of when the record was last updated.

Example:

"2020-10-05T00:00:00.000Z"