# Okta API call using API Key throws 403 Error

**URL:** <https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486>\
**Category:** API\
**Created:** [March 24, 2021, 4:10pm UTC](https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486 "2021-03-24T16:10:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akjenamca](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@akjenamca](https://devforum.okta.com/u/akjenamca)\
**Post date:** [March 24, 2021, 4:10pm UTC](https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486/1 "2021-03-24T16:10:49Z")

</div>

I am calling Okta API [https://XXXX.oktapreview.com/api/v1/users](https://XXXX.oktapreview.com/api/v1/users) using API Key via postman  
In Authorization tab in postman, I have selected API Token and provided API key and value  
I have created API Key from Okta menu security-\>API-\>token  
I am getting below error , my API Key is valid and not expired … I would appreciate if anyone can let me know what I am missing

{

```
"errorCode": "E0000005",

"errorSummary": "Invalid session",

"errorLink": "E0000005",

"errorId": "oaeC8aV9kVKTXaCgON99MqDLg",

"errorCauses": []

```

}

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [March 24, 2021, 10:02pm UTC](https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486/2 "2021-03-24T22:02:51Z")

</div>

@akjenamca Are you testing in Postman. Can you please check if you have the correct headers?

1. You should have following headers:

{

“Accept”: “application/json”,

“Content-Type”: “application/json”,

“Authorization”: “SSWS $apiKey”

}

Is it possible you added the request info in postman?

---

<div class="post-metadata">

**Author:** ![akjenamca](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@akjenamca](https://devforum.okta.com/u/akjenamca)\
**Post date:** [March 25, 2021, 1:34pm UTC](https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486/3 "2021-03-25T13:34:06Z")

</div>

Thank you so much, Lijia !!  
Yes, I am using postman to test this. After setting “Authorization”: “SSWS \*\*\*\*\*\*\*” in header section, it started working. I was passing this token in Authorization tab which was the issue. It does not matter to set this token in authorization tab but it needs to be set in header section.

Thanks  
Ashok Jena

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [March 25, 2021, 5:51pm UTC](https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486/4 "2021-03-25T17:51:13Z")

</div>

@akjenamca You are so welcome~ Cool. It is glad to know the request is working now.

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [March 25, 2021, 6:49pm UTC](https://devforum.okta.com/t/okta-api-call-using-api-key-throws-403-error/13486/5 "2021-03-25T18:49:09Z")

</div>


