It looks like there have been some recent changes to the tools function in Vapi that now require authentication tokens for creating and managing tools, including webhooks. This is a shift from the previous method where you could simply add a webhook without needing any authentication.
### What is an Authentication Token?
An authentication token is a secure way to verify your identity when making API requests. In Vapi, you can use either OAuth2 tokens or JWT (JSON Web Tokens) for this purpose. These tokens ensure that only authorized users can access certain functionalities.
### How to Create Tools with the New Functionality
To create tools using the new tools function, follow these steps:
1. **Generate an Authentication Token**:
- If you're using JWT, you'll need to define a payload, get a private key, and generate the token. You can find detailed instructions on how to do this in the [JWT Authentication Guide](
https://docs.vapi.ai/customization/jwt-authentication).
2. **Update Your Tool Configuration**:
- In the new interface, you'll see a field for the "Authentication Token." You need to enter the token you generated here.
- Make sure to fill in the other required fields, such as the Tool Name and Webhook URL.
3. **Send the API Request**:
- When you make an API request to create or update a tool, include the token in the Authorization header formatted as
Bearer <your-token>
.
4. **Test Your Tool**:
- After setting everything up, test your tool to ensure it works as expected.
### Example of a Tool Configuration
Here’s a basic example of how your tool configuration might look:
json
{
"tool_name": "Reschedule",
"description": "When the user wants to reschedule an appointment.",
"webhook_url": "https://hook.make/...",
"authentication_token": "your-authentication-token",
"metadata": {
"scenario_id": "your-scenario-id"
}
}
### Additional Resources