Tools type apiRequest Not accepting Headers and R...
# support
g
Hi, Im trying to integrate Tools type apiRequest. Its connecting, in dashboard Vapi the Tool Name, Headers and Body/parameters is empty but returned in response. Do I missed something? Thank You @Shubham Bajaj @ivy
Copy code
-H 'Authorization: Bearer xxx-xx-xx-xxx-xxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "function": {
    "name": "API",
    "strict": false,
    "description": "Transfer API",
    "parameters": {
      "type": "object",
      "properties": {
        "name": {
          "description": "name",
          "type": "string"
        },
        "address": {
          "type": "string"
        }
      }
    }
  },
  "messages": [
    {
      "type": "request-start",
      "content": "hello",
      "conditions": []
    },
    {
      "type": "request-complete",
      "content": "test",
      "conditions": []
    },
    {
      "type": "request-failed",
      "content": "sorry",
      "conditions": []
    },
    {
      "type": "request-response-delayed",
      "content": "Wait",
      "conditions": []
    }
  ],
  "server": {
    "timeoutSeconds": 20,
    "headers": {
      "token": "123"
    }
  },
  "async": false,
  "url": "https://www.vapi.ai",
  "method": "POST"
}'
--- END CURL ---

VAPI Tool Update Response: {
  id: 'd27c7c62-0e34-49f1-8c72-f35d06e46065',
...
  type: 'apiRequest',
  function: {
    name: 'API',
    strict: false,
    description: 'Transfer API',
    parameters: { type: 'object', properties: [Object] }
  },
  orgId: '218761d7-4a06-4459-9fdc-d4c0a66490d2',
  server: { timeoutSeconds: 20, headers: { token: '123' } },
...
}
v
Thank you for sharing the details. To help diagnose the issue: Are you configuring the tool via the Vapi dashboard UI, the API, or both—and does the problem persist after refreshing or re-saving the tool in the dashboard? This will help determine if the issue is related to the dashboard display or the API configuration. Sources: - [Vapi Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools) - [Vapi API Reference: Create Tool](https://docs.vapi.ai/api-reference/tools/create) - [Vapi API Reference: Update Tool](https://docs.vapi.ai/api-reference/tools/update) - [Vapi Server Authentication](https://docs.vapi.ai/server-url/server-authentication)
g
Configurations from API
v
Message marked as helpful by @! AetherMind! 🎉
i
API
Hi @Shubham Bajaj are you able to assist here?
v
Are you having the same issue @ivy?
i
yes
v
Could you share the request you are sending?
i
@Gilang can you please share to Kyle?
g
This one, @kylebrunker @ivy
v
I am looking at the request, but I am still not quite understanding what you are trying to achieve here. Could you please describe what your desired result is from this request?
i
There is no response received but this it looks like the API is trigerring
so unsure why there is no response
v
If you haven't looked at the documentation already, please review it for finding the correct format of API requests:
g
This is API Create Tool type apiRequest ; https://api.vapi.ai/tool In request i sent this the headers and *token*:
Copy code
"server": {
    "timeoutSeconds": 20,
    "headers": {
      "token": "123"
    }
  },
and respose from this request, i got this headers and *token*:
Copy code
server: { timeoutSeconds: 20, headers: { token: '123' } },
But it not showing in vapi dashboard tools. I dont know is this correct or not?
v
Here is the required fields for the apiRequest tool:
Copy code
{
  "type": "apiRequest",
  "method": "POST" | "GET",
  "url": "https://your-api-endpoint.com/path",
  "body": {
    "type": "object",
    "properties": {
      "paramName": {
        "type": "string",
        "description": "Parameter description"
      }
    }
  }
  "name": "myApiTool",
  "description": "Description of what this tool does",
  "headers": {
    "type": "object", 
    "properties": {
      "Authorization": {
        "type": "string",
        "value": "Bearer {{usertoken}}"
      }
    }
  },
  "timeoutSeconds": 20,
  "backoffPlan": {
    "backoffType": "exponential",
    "maxRetries": 3
  }
}
g
is there any documentations that can i read. the structures different with publish documentations. Or do i miss something?
v
The API documentation should be up to date. If you see any discrepancies please take a screenshot of response that you get from the server and request payload used