Request Body for Custom API Call Tool Not Generati...
# support
f
I'm trying to set up an API call to GoHighLevel. I am using 'https://services.leadconnectorhq.com/contacts/search' POST Request I've set up the URL, Method, Request Headers, and the Request Body with it's defaults as well as one property that has a dynamic variable. When I go to test this API call, nothing appears in the Request Body and it fails every time. I genuinely have no idea where to go from here. Any help is appreciated. https://cdn.discordapp.com/attachments/1402696342056210452/1402696342446411776/Screenshot_2025-08-06_at_12.50.46_PM.png?ex=6894da44&is=689388c4&hm=2f41b81e7d1390462d67d91817fcda337ee417f5e57da1133496384d605ce620& https://cdn.discordapp.com/attachments/1402696342056210452/1402696342979084460/Screenshot_2025-08-06_at_12.50.39_PM.png?ex=6894da45&is=689388c5&hm=28eed5c7aa4733bfdb552a0d861dd0ac856c1e2fa00446e567a4ee6f2488345f&
v
It looks like your request body may not be getting sent because the properties aren't being included as a JSON object. Try explicitly defining your request body like this in your tool setup:
Copy code
json
{
  "query": "search term",
  "pageLimit": "10",
  "locationId": "your-location-id"
}
Make sure all required fields are present and match the API's expected format. Test again after updating—this should resolve the 422 error if the body is sent correctly. Source: - [Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools)
f
@Vapi How do I include the properties as part of the JSON object? Which section of this tool is this in? Request headers, Request body? Your answer is unclear
@Vapi Support Bot I've tried adding curly brackets {{ }} to pretty much everything in my request headers then trying again with request body and I'm still getting errors
v
You should enter the JSON object in the "Request Body" section of your tool configuration—not in the headers. Make sure it looks like this:
Copy code
json
{
  "query": "search term",
  "pageLimit": "10",
  "locationId": "your-location-id"
}
Do not use curly brackets in the headers; only use this format in the Request Body area. This should ensure the body is sent correctly and resolve the 422 error. [See Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools) Source: - [Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools)
f
@Vapi Support Bot I'm now getting this error: '{ "statusCode": 403, "message": "The token does not have access to this location." }' Even though I grabbed the API key directly from my agency view API Tokens area for the target sub account
v
The 403 error means your API token does not have access to the specified location. To resolve this, ensure you generate the API key from within the sub-account (location) you want to access, not from the agency view. Use that sub-account's API key in your Authorization header. Example:
Copy code
Authorization: Bearer <sub-account-specific-token>
This should grant the correct permissions and resolve the access error. [See Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools) Source: - [Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools)
f
@Vapi Support Bot I've gone inside the Private Integrations tab in GoHighLevel Sub-account view specifically, and I generated a token that literally has every scope possible inside of GHL, and it's still giving me the same error when using this API token
v
Thanks for the detailed info. To help pinpoint the issue: Can you confirm that the
locationId
you are sending in your request body exactly matches the sub-account (location) for which you generated the API token? A mismatch here can cause a 403 error even if the token has all scopes. Let me know! Source: - [Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools)
f
@Vapi Support Bot Yes the locationId matches the sub account location
v
I understand how frustrating it can be to run into persistent errors even after double-checking everything. At this point, based on the information available, I don't have any additional troubleshooting steps or insights to offer. If anything changes or more details become available, I'll be happy to help further.
2 Views