Invalid Key. Hot tip, you may be using the private...
# support
k
I get this when trying to access anything through the API. I have checked multiple times that the key is the right one and formatted correctly with no whitespaces. I have logged out and tried to create a new key but I keep getting this error.
a
HeyKalleS Thank you for creating the ticket! A member of our team will reach out to you shortly.
v
@KalleS I'm sorry to hear that you're experiencing difficulties accessing the API. To assist you better, could you please provide me with the exact error message you're receiving? This will help me understand the issue more clearly and guide you towards a resolution.
You can continue this conversation by mentioning me in the message.
k
@Vapi
Copy code
{
  "message": "Invalid Key. Hot tip, you may be using the private key instead of the public key, or vice versa.",
  "error": "Forbidden",
  "statusCode": 403
}
v
@KalleS Thank you for providing the error message. It seems like there might be an issue with the key you are using. Here are a few steps you can take to troubleshoot this problem: 1. Double-check that you are using the correct key. There might be separate keys for different environments (e.g., development, staging, production). Ensure you're using the key intended for the environment you're working with. 2. Make sure that the key is being sent in the correct format in the header of your API requests. The header should typically look like this:
Authorization: Bearer YOUR_API_KEY
. 3. If you've recently generated a new key, ensure that there's no delay in key propagation. Sometimes, it may take a few minutes for a new key to become active. 4. Verify that the key has not been revoked or expired. You can check this in your API dashboard where you manage your keys. 5. If you're still having trouble, it might be helpful to see an example of how you're including the key in your API request. This can help identify if there's an issue with the request format. If you've gone through these steps and the issue persists, please let me know, and we can explore further solutions.
k
I have gone through the steps and the error persists @User
s
@KalleS Your required to use private key when your making API calls, your using public key because of this your observed this error message.
@KalleS Try making an API call using private key and then it will work. Do let me know how it goes for you!!
k
@Shubham Bajaj I did try it with both keys and it didn't work, but today it seems to work. Maybe it took some time for the new token to start working. I indeed needed to use the private key to use the api. Thanks!
s
Can you share your orgId so I can take a look at the logs!!
k
a2b69a8a-77bf-4600-b24c-076e9dba966c @Shubham Bajaj
s
logs
šŸ”“ 16:46:36:336 POST /call, BadRequestException 400 () Response: { "message": "Couldn't Get Assistant.
assistantId
a2b69a8a-77bf-4600-b24c-076e9dba966c Does Not Exist.", "error": "Bad Request", "statusCode": 400 } Actually there are no requests reported with Bad Key instead of assitantId is incorrect. @KalleS Please use the correct assistantID and then it will be fixed.
11 Views