v2

latestOpenAPI 3.1.02026-07-313981108.2 KB
Tools

Update Tool

patch/assistants/v1/tools/{id}

Path parameters

idstring required

Request body

asyncboolean

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 request

{
  "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"
      ]
    }
  },
  "messages": [
    {
      "content": "Please wait while I fetch the details."
    }
  ],
  "server": {
    "timeoutSeconds": 20,
    "url": "https://api.example.com/v1/getUserDetails",
    "secret": "my-secret",
    "headers": {}
  }
}

Response

_idstring required

This is the unique identifier for the tool.

teamIdstring required

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

type'function' required

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

asyncboolean

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).

createdAtstring date-time

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

updatedAtstring date-time

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

Example response

{
  "_id": "1f7b1b1b1b1b1b1b1b1b1b1b",
  "teamId": "3f7b1b1b1b1b1b1b1b1b1b1b",
  "type": "function",
  "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"
      ]
    }
  },
  "messages": [
    {
      "content": "Please wait while I fetch the details."
    }
  ],
  "server": {
    "timeoutSeconds": 20,
    "url": "https://api.example.com/v1/getUserDetails",
    "secret": "my-secret",
    "headers": {}
  },
  "createdAt": "2020-10-05T00:00:00.000Z",
  "updatedAt": "2020-10-05T00:00:00.000Z"
}