genetic-orange
genetic-orange4mo ago

Call transcript

I am trying to fetch the call details and transcript to my own dashboard. And I read the documentation. This is like I need to generate a authentication JWT token to generate it. I need organisation ID and private key. So I am able to find the organisation ID inside organisation settings, but I am not able to find the private key, please assist me with it. It is very urgent.
4 Replies
Kyle Brunker
Kyle Brunker4mo ago
In your Vapi dashboard there is a section on the left menu called 'Vapi API keys'. Here you will find the public and private key
genetic-orange
genetic-orangeOP4mo ago
Yes but they are my API_KEYS i want PRIVATE_KEY to generate jwt token if they are same please let me know or guide me how to generate jwt token cause i want to log transcripts in my custom dashboard and also for batch calling from my dashboard or as there any other way to do it please show direction i am using workflow, not assistant directly so in workflow there is no option of setting message server url
genetic-orange
genetic-orange3mo ago
Hello Where can I get the private key in vapi... I need to get a jwt token for n8n
Kyle Brunker
Kyle Brunker3mo ago
Hi Steve, The private key for signing JWT tokens is in the VAPI API keys section mentioned earlier. Here is also a guide for JWTs
To fetch call details and transcripts, you do indeed need to authenticate using a JWT token. Here's a brief guide on what you need: 1. Organization ID: You can find this in your organization settings, as you've already done. 2. Private Key: The private key is essential for signing the JWT token, and it must be stored securely. If you cannot find this in your dashboard, ensure that you have the right permissions and access under your user profile. 3. Generate the JWT Token: - Define the payload, including your orgId and setting the tag to "private". - Retrieve your private key from the environment variables. - Use a JWT library to create the token with the payload and private key. For generating the JWT, here's an example in Node.js:
// Define the payload
const payload = {
orgId: process.env.ORG_ID,
token: {
tag: "private",
},
};

// Get the private key from environment variables
const key = process.env.PRIVATE_KEY;

// Define token options
const options = {
expiresIn: "1h",
};

// Generate the token using a JWT library
const token = generateJWT(payload, key, options);
// Define the payload
const payload = {
orgId: process.env.ORG_ID,
token: {
tag: "private",
},
};

// Get the private key from environment variables
const key = process.env.PRIVATE_KEY;

// Define token options
const options = {
expiresIn: "1h",
};

// Generate the token using a JWT library
const token = generateJWT(payload, key, options);
If you're unable to find the private key, check your user permissions or contact your account administrator to confirm it's available in your organizational setup. For more details, refer to the JWT Authentication Guide. By following these steps, you should be able to generate the necessary JWT token to authenticate your API requests successfully.

Did you find this page helpful?