Create and configure Tools that an AI Assistant can use.
POST https://assistants.twilio.com/v1/Tools
application/json
The description of the tool.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createTool() {11const tool = await client.assistants.v1.tools.create({12name: "name",13type: "type",14enabled: false,15});1617console.log(tool.accountSid);18}1920createTool();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"date_created": "2009-07-06T20:30:00Z",4"date_updated": "2009-07-06T20:30:00Z",5"description": "description",6"enabled": false,7"id": "aia_tool",8"meta": {},9"name": "name",10"requires_auth": false,11"type": "type",12"url": "url"13}
GET https://assistants.twilio.com/v1/Tools
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listTools() {11const tools = await client.assistants.v1.tools.list({ limit: 20 });1213tools.forEach((t) => console.log(t.accountSid));14}1516listTools();
1{2"meta": {3"first_page_url": "https://www.example.com",4"key": "key",5"next_page_url": "https://www.example.com",6"page": 42,7"page_size": 42,8"previous_page_url": "https://www.example.com",9"url": "https://www.example.com"10},11"tools": [12{13"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"description": "description",15"enabled": false,16"id": "aia_tool",17"meta": {},18"name": "name",19"requires_auth": false,20"type": "type",21"url": "url",22"date_created": "2009-07-06T20:30:00Z",23"date_updated": "2009-07-06T20:30:00Z"24}25]26}
DELETE https://assistants.twilio.com/v1/Tools/{id}
The tool ID.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteTool() {11await client.assistants.v1.tools("id").remove();12}1314deleteTool();