I'm encountering an issue when creating a Code Tool via your API that contradicts your current documentation.
According to your docs (
https://docs.vapi.ai/tools/code-tool#creating-code-tools), the request should include fields like name, description, parameters, and environmentVariables. For example:
json
{
"type": "code",
"name": "get_customer",
"description": "Retrieves customer information",
"code": "...",
"parameters": { ... },
"environmentVariables": [ ... ]
}
However, when I send a request with these fields, I receive a 400 error:
text
{
"message": [
"property name should not exist",
"property description should not exist",
"property parameters should not exist"
],
"error": "Bad Request",
"statusCode": 400
}
A minimal request without those fields succeeds:
json
{
"type": "code",
"code": "return { hello: \"world\" };"
}
I need to include description, parameters, and environmentVariables for my planned integration. Could you clarify the correct schema for creating Code Tools? If the API has changed, please update the documentation accordingly.
Thank you for your help!
Best regards,