Attach a tool to a scenario
curl --request POST \
--url https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"position": 0
}
'import requests
url = "https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach"
payload = {
"active": True,
"position": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: true, position: 0})
};
fetch('https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'active' => true,
'position' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach"
payload := strings.NewReader("{\n \"active\": true,\n \"position\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"position\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"position\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "f0d2e1b8-cc1d-4ef7-a3ba-1f4b0d2c5a4b",
"scenario_id": "7e3b9c2a-1d4f-4a1b-bdc6-9c8b2d3f4e5a",
"custom_function_id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"active": true,
"position": 0,
"custom_function": {
"id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters_schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"description": "The participant's account ID (e.g. cus_XXXX)."
}
},
"required": [
"account_id"
]
},
"execution_mode": "webhook",
"has_webhook_secret": true,
"timeout_ms": 8000,
"tool_spec": {
"type": "function",
"function": {
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters": {
"type": "object",
"properties": {
"account_id": {
"type": "string"
}
},
"required": [
"account_id"
]
}
}
},
"membership_id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"webhook_url": "https://your-app.com/waterr/tools/lookup_account",
"on_call": "static_filler",
"static_filler": "Sure, let me grab that for you.",
"on_resolve": "generate_response",
"created_at": "2026-06-18T12:34:56.000Z",
"updated_at": "2026-06-18T12:34:56.000Z"
},
"created_at": "2026-06-18T12:35:00.000Z",
"updated_at": "2026-06-18T12:35:00.000Z"
}
}{
"data": {
"id": "f0d2e1b8-cc1d-4ef7-a3ba-1f4b0d2c5a4b",
"scenario_id": "7e3b9c2a-1d4f-4a1b-bdc6-9c8b2d3f4e5a",
"custom_function_id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"active": true,
"position": 0,
"custom_function": {
"id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters_schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"description": "The participant's account ID (e.g. cus_XXXX)."
}
},
"required": [
"account_id"
]
},
"execution_mode": "webhook",
"has_webhook_secret": true,
"timeout_ms": 8000,
"tool_spec": {
"type": "function",
"function": {
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters": {
"type": "object",
"properties": {
"account_id": {
"type": "string"
}
},
"required": [
"account_id"
]
}
}
},
"membership_id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"webhook_url": "https://your-app.com/waterr/tools/lookup_account",
"on_call": "static_filler",
"static_filler": "Sure, let me grab that for you.",
"on_resolve": "generate_response",
"created_at": "2026-06-18T12:34:56.000Z",
"updated_at": "2026-06-18T12:34:56.000Z"
},
"created_at": "2026-06-18T12:35:00.000Z",
"updated_at": "2026-06-18T12:35:00.000Z"
}
}Tools
Attach a tool to a scenario
Link an existing tool to a scenario. Idempotent — re-attaching the same pair returns 200 OK with the existing row.
POST
/
scenarios
/
{scenarioId}
/
custom-functions
/
{id}
/
attach
Attach a tool to a scenario
curl --request POST \
--url https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"active": true,
"position": 0
}
'import requests
url = "https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach"
payload = {
"active": True,
"position": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: true, position: 0})
};
fetch('https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'active' => true,
'position' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach"
payload := strings.NewReader("{\n \"active\": true,\n \"position\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true,\n \"position\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.waterr.ai/v1/scenarios/{scenarioId}/custom-functions/{id}/attach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active\": true,\n \"position\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "f0d2e1b8-cc1d-4ef7-a3ba-1f4b0d2c5a4b",
"scenario_id": "7e3b9c2a-1d4f-4a1b-bdc6-9c8b2d3f4e5a",
"custom_function_id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"active": true,
"position": 0,
"custom_function": {
"id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters_schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"description": "The participant's account ID (e.g. cus_XXXX)."
}
},
"required": [
"account_id"
]
},
"execution_mode": "webhook",
"has_webhook_secret": true,
"timeout_ms": 8000,
"tool_spec": {
"type": "function",
"function": {
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters": {
"type": "object",
"properties": {
"account_id": {
"type": "string"
}
},
"required": [
"account_id"
]
}
}
},
"membership_id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"webhook_url": "https://your-app.com/waterr/tools/lookup_account",
"on_call": "static_filler",
"static_filler": "Sure, let me grab that for you.",
"on_resolve": "generate_response",
"created_at": "2026-06-18T12:34:56.000Z",
"updated_at": "2026-06-18T12:34:56.000Z"
},
"created_at": "2026-06-18T12:35:00.000Z",
"updated_at": "2026-06-18T12:35:00.000Z"
}
}{
"data": {
"id": "f0d2e1b8-cc1d-4ef7-a3ba-1f4b0d2c5a4b",
"scenario_id": "7e3b9c2a-1d4f-4a1b-bdc6-9c8b2d3f4e5a",
"custom_function_id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"active": true,
"position": 0,
"custom_function": {
"id": "4f8a6c50-9d3b-4c1f-9c0a-7a3b6e2d1f10",
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters_schema": {
"type": "object",
"properties": {
"account_id": {
"type": "string",
"description": "The participant's account ID (e.g. cus_XXXX)."
}
},
"required": [
"account_id"
]
},
"execution_mode": "webhook",
"has_webhook_secret": true,
"timeout_ms": 8000,
"tool_spec": {
"type": "function",
"function": {
"name": "lookup_account",
"description": "Fetch the participant's CRM record so you can reference their plan, MRR, and last contact date.",
"parameters": {
"type": "object",
"properties": {
"account_id": {
"type": "string"
}
},
"required": [
"account_id"
]
}
}
},
"membership_id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789",
"webhook_url": "https://your-app.com/waterr/tools/lookup_account",
"on_call": "static_filler",
"static_filler": "Sure, let me grab that for you.",
"on_resolve": "generate_response",
"created_at": "2026-06-18T12:34:56.000Z",
"updated_at": "2026-06-18T12:34:56.000Z"
},
"created_at": "2026-06-18T12:35:00.000Z",
"updated_at": "2026-06-18T12:35:00.000Z"
}
}Authorizations
API key from waterr.ai/settings?tab=api-keys. Send as Authorization: Bearer wai_<your_key>.
Path Parameters
Scenario UUID.
Tool definition UUID.
Body
application/json
Response
Already attached — the existing attachment row is returned unchanged.
Links a tool to a scenario. The tool is advertised to the LLM only when active = true.
Show child attributes
Show child attributes

