Kavish
09/03/2025, 11:19 PMVapi Support Bot
09/03/2025, 11:20 PM+1234567890?) This will help determine if the issue is due to the phone number format.Kavish
09/04/2025, 12:02 AMVapi Support Bot
09/04/2025, 12:02 AM+1234567890) when triggering the SMS tool.
If your tool or function does not automatically pick up the callee's number, update your agent or tool configuration to include the recipient number as a parameter, like this:
json
{
"to": "+1234567890",
"message": "Thank you for your interest! You can book a private showing here: https://www.booking.com"
}
This ensures the SMS is sent to the correct recipient and avoids format errors.
[See Vapi documentation for SMS tool usage.](https://docs.vapi.ai/tools/default-tools)
Source:
- [Default Tools Vapi Documentation](https://docs.vapi.ai/tools/default-tools)Kavish
09/04/2025, 12:22 AMVapi Support Bot
09/04/2025, 12:22 AM{{customer.number}} variable in your tool configuration or function call. For example:
json
{
"to": "{{customer.number}}",
"message": "Thank you for your interest! You can book a private showing here: https://www.booking.com"
}
This ensures the SMS tool automatically uses the recipient's number from each call at runtime.
[See Vapi dynamic variables documentation.](https://docs.vapi.ai/assistants/dynamic-variables)
Source:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)Kavish
09/04/2025, 1:01 AMVapi Support Bot
09/04/2025, 1:02 AMbash
curl -X POST https://api.vapi.ai/tool \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"function": {
"name": "send_text",
"description": "Send a pre-approved text message: Thank you for your interest! You can book a private showing here: https://www.booking.com",
"parameters": {
"to": "{{customer.number}}"
}
},
"messages": [
{
"type": "request-start",
"content": "I'll send you a text message right now with the appointment booking link.",
"blocking": false
},
{
"role": "assistant",
"type": "request-complete",
"content": "Perfect! I've sent you the text message with the appointment booking link. You should receive it shortly.",
"endCallAfterSpokenEnabled": false
}
],
"metadata": {
"from": "+18564925986"
}
}'
Replace <YOUR_TOKEN> with your actual API token. This setup ensures the SMS is sent to the current callee on each call.
[See Vapi dynamic variables documentation.](https://docs.vapi.ai/assistants/dynamic-variables)
Source:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)Kavish
09/04/2025, 1:08 AM{
"message": [
"function.parameters.property to should not exist",
"function.parameters.type must be one of the following values: object",
"function.parameters.type must be a string",
"function.parameters.properties must be an object"
],
"error": "Bad Request",
"statusCode": 400
}@Vapi Support Bot i am getting this errorVapi Support Bot
09/04/2025, 1:09 AMfunction.parameters field.
Update your cURL request as follows, ensuring "parameters" is an object with "type": "object" and a "properties" object that defines "to" as a string:
bash
curl -X POST https://api.vapi.ai/tool \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"function": {
"name": "send_text",
"description": "Send a pre-approved text message: Thank you for your interest! You can book a private showing here: https://www.booking.com",
"parameters": {
"type": "object",
"properties": {
"to": { "type": "string" }
},
"required": ["to"]
}
},
"messages": [
{
"type": "request-start",
"content": "I'll send you a text message right now with the appointment booking link.",
"blocking": false
},
{
"role": "assistant",
"type": "request-complete",
"content": "Perfect! I've sent you the text message with the appointment booking link. You should receive it shortly.",
"endCallAfterSpokenEnabled": false
}
],
"metadata": {
"from": "+18564925986"
}
}'
When triggering the tool, pass "to": "{{customer.number}}" in the function call to send the SMS to the current callee.
[See Vapi dynamic variables documentation.](https://docs.vapi.ai/assistants/dynamic-variables)
Source:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)Kavish
09/04/2025, 1:10 AMVapi Support Bot
09/04/2025, 1:11 AMbash
curl -X POST https://api.vapi.ai/tool \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"function": {
"name": "send_text",
"description": "Send a pre-approved text message: Thank you for your interest! You can book a private showing here: https://www.booking.com",
"parameters": {
"type": "object",
"properties": {
"to": { "type": "string" }
},
"required": ["to"]
}
},
"messages": [
{
"type": "request-start",
"content": "I'll send you a text message right now with the appointment booking link.",
"blocking": false
},
{
"role": "assistant",
"type": "request-complete",
"content": "Perfect! I've sent you the text message with the appointment booking link. You should receive it shortly.",
"endCallAfterSpokenEnabled": false
}
],
"metadata": {
"from": "+18564925986"
}
}'
Double-check for any stray or missing quotes/brackets. This should resolve the "Unterminated string" error.
Source:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)Kavish
09/04/2025, 1:14 AMVapi Support Bot
09/04/2025, 1:15 AM"to": "{{customer.number}}" value in the function call payload at runtime, or is the tool being triggered without specifying the recipient? This step is essential for the tool to dynamically use the current caller's number.
[See Vapi dynamic variables documentation.](https://docs.vapi.ai/assistants/dynamic-variables)
Source:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)Kavish
09/04/2025, 1:16 AMKavish
09/04/2025, 1:18 AMVapi Support Bot
09/04/2025, 1:20 AMbash
curl -X POST https://api.vapi.ai/tool \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"type": "sms",
"function": {
"name": "send_text",
"description": "Send a pre-approved text message: Thank you for your interest! You can book a private showing here: https://www.booking.com",
"parameters": {
"type": "object",
"properties": {
"to": { "type": "string" }
},
"required": ["to"]
}
},
"messages": [
{
"type": "request-start",
"content": "I'll send you a text message right now with the appointment booking link.",
"blocking": false
},
{
"role": "assistant",
"type": "request-complete",
"content": "Perfect! I've sent you the text message with the appointment booking link. You should receive it shortly.",
"endCallAfterSpokenEnabled": false
}
],
"metadata": {
"from": "+18564925986"
}
}'
When triggering the tool, ensure the function call payload includes:
json
{ "to": "{{customer.number}}" }
This setup will dynamically send the SMS to the current callee on each call.
[See Vapi dynamic variables documentation.](https://docs.vapi.ai/assistants/dynamic-variables)
Source:
- [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables)