szekler
03/29/2026, 12:17 PMChiranjeet Mishra
03/29/2026, 12:17 PMVapi Support Bot
03/29/2026, 12:17 PM/call endpoint requires a private JWT token, not a public API key.
To fix this, generate a private JWT token using your organization ID and private key, then use it in your request. Here’s an example of how to generate and use the token:
js
// Generate a private JWT token (Node.js example)
const payload = { orgId: process.env.ORG_ID, token: { tag: "private" } };
const key = process.env.PRIVATE_KEY;
const options = { expiresIn: "1h" };
const token = generateJWT(payload, key, options);
// Use the token in your cURL request
curl -X POST https://api.vapi.ai/call \
-H "Authorization: Bearer <your-private-jwt-token>" \
-H "Content-Type: application/json" \
-d '{ "assistantId": "ebdc9c40-6b0d-4ff3-99e0-9dddb2718067" }'
Replace <your-private-jwt-token> with the token you generate.
For more details, see the [JWT Authentication documentation](https://docs.vapi.ai/customization/jwt-authentication).
Source:
- [JWT Authentication documentation](https://docs.vapi.ai/customization/jwt-authentication)Vapi Support Bot
03/29/2026, 1:33 PMszekler
03/29/2026, 1:34 PM