WayloAIWaylo Docs
APIReferenceTools

Create tool

POST
/tools

Define a tool in a workspace. type decides the shape of config, and an unknown config key is refused. For api_request the URL must be HTTPS; unknown {{variables}} and a credential outside the workspace are rejected here, not on a live call. A name is unique in its workspace, and a model-facing name reserved by the API is refused (400).

Access: workspace_admin · API key tools:write

Authorization

api-key
headerAuthorizationBearer <sk_waylo_<lookup><secret><checksum>>

Header Parameters

Authorization*string

Your API key.

Request Body

application/json
  1. body
workspaceId*string
Formatuuid
name*string

The function name the model calls. Letters, numbers, underscore and dash only; max 64.

Match^[\w-]{1,64}$
Lengthlength <= 64
feedback?
credentialId?|
Formatuuid
type*"api_request"
Value in"api_request"
description*string
Lengthlength <= 1000
parameters?

JSON Schema for the model-supplied arguments. Property names become the model arguments and are referenceable as {{name}} in the config url, headers and staticBody. A property cannot take the name of a context variable (session.id, workspace.id, agent.id, caller.number, now).

config*

Response Body

Created

application/json
  1. response
id*string
workspaceId*string
name*string
feedback*
credentialId*|
Formatuuid
active*boolean
agentCount*number
createdByUserId*|
Formatuuid
createdByUserName*string|null
updatedByUserId*|
Formatuuid
updatedByUserName*string|null
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
type*"api_request"
Value in"api_request"
description*string
parameters*
config*
Example Request
curl -X POST 'https://api.poc.app.waylovoice.ai/tools' \  -H 'Authorization: Bearer sk_waylo_...' \  -H 'Content-Type: application/json' \  -d '{  "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c",  "name": "string",  "type": "api_request",  "description": "string",  "config": {    "method": "GET",    "url": "https://api.example.com/products/search?q={{q}}"  }}'
Example Response
{  "id": "string",  "workspaceId": "string",  "name": "string",  "feedback": {    "ack": [      "string"    ],    "filler": [      "string"    ]  },  "credentialId": "f568fec0-10b6-4b94-9daf-e62c50c9bf3e",  "active": true,  "agentCount": 0,  "createdByUserId": "4d2aef9a-17b0-44e6-902e-616812033620",  "createdByUserName": "string",  "updatedByUserId": "b38eaad7-8efa-49e7-b0aa-619916a3821e",  "updatedByUserName": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "type": "api_request",  "description": "string",  "parameters": {},  "config": {    "method": "GET",    "url": "string",    "headers": {      "property1": "string",      "property2": "string"    },    "staticBody": {},    "timeoutMs": 0  }}