# Invalid Api Key Error

**URL:** <https://community.wowza.com/t/invalid-api-key-error/54332>\
**Category:** Wowza Developer Dojo\
**Tags:** rest-api\
**Created:** [December 13, 2019, 1:12pm UTC](https://community.wowza.com/t/invalid-api-key-error/54332 "2019-12-13T13:12:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Giordano](https://avatars.discourse-cdn.com/v4/letter/m/7ab992/32.png) [@Michael\_Giordano](https://community.wowza.com/u/Michael_Giordano)\
**Post date:** [December 13, 2019, 1:12pm UTC](https://community.wowza.com/t/invalid-api-key-error/54332/1 "2019-12-13T13:12:59Z")

</div>

**Input Params:**  
{ “live\_stream”: { “aspect\_ratio\_height”: 1080, “aspect\_ratio\_width”: 1920, “billing\_mode”: “pay\_as\_you\_go”, “broadcast\_location”: “asia\_pacific\_india”, “encoder”: “wowza\_gocoder”, “name”: “My Live Stream”, “transcoder\_type”: “transcoded”, “closed\_caption\_type”: “none”, “delivery\_method”: “push”, “delivery\_protocols”: [“rtmp”, “rtsp”, “wowz”], “delivery\_type”: “single-bitrate”, “disable\_authentication”: false, “hosted\_page”: true, “hosted\_page\_description”: “My Hosted Page Description”, “hosted\_page\_logo\_image”: “[Base64-encoded string representation of GIF, JPEG, or PNG file]”, “hosted\_page\_sharing\_icons”: true, “hosted\_page\_title”: “My Hosted Page”, “low\_latency”: false, “password”: “XXXXXXXX”, “player\_countdown”: true, “player\_countdown\_at”: “2019-01-30 17:00:00 UTC”, “player\_logo\_image”: “[Base64-encoded string representation of GIF, JPEG, or PNG file]”, “player\_logo\_position”: “top-right”, “player\_responsive”: false, “player\_type”: “wowza\_player”, “player\_video\_poster\_image”: “[Base64-encoded string representation of GIF, JPEG, or PNG file]”, “player\_width”: 640, “recording”: true, “remove\_hosted\_page\_logo\_image”: true, “remove\_player\_logo\_image”: true, “remove\_player\_video\_poster\_image”: true, “source\_url”: “[xyz.streamlock.net/vod/mp4:Movie.mov](http://xyz.streamlock.net/vod/mp4:Movie.mov)”, “target\_delivery\_protocol”: “hls-https”, “use\_stream\_source”: false, “username”: “client2” } }

**Response:**  
{ “meta”: { “status”: 401, “code”: “ERR-401-InvalidApiKey”, “title”: “Invalid Api Key Error”, “message”: “Invalid API key.”, “description”: “” }, “request\_id”: “XXXXXXXXXX181be96328feb3de”, “request\_timestamp”: “2019-12-13T09:29:40.275Z” }

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 13, 2019, 1:42pm UTC](https://community.wowza.com/t/invalid-api-key-error/54332/2 "2019-12-13T13:42:44Z")

</div>

This error triggers when the proper keys and headers were not configured properly as shown below.

```auto
curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"{WSC_HOST}/api/${WSC_VERSION}/live_streams"

```

1. Please review [here](https://www.wowza.com/docs/how-to-use-the-wowza-streaming-cloud-rest-api#keys) where to properly locate your API key.

2. Check the examples on the required headers using the keys [here.](https://www.wowza.com/docs/how-to-use-the-wowza-streaming-cloud-rest-api#api-requests)

3. Use the sandbox to practice making a an API call with the keys in the correct format. As you may already know, the sandbox is for practice only, you’ll need to remove “sandbox” from your true production url.

See below url examples:

_In the Wowza Streaming Cloud REST API sandbox environment, the base URL is_

_**[https://api.sandbox.cloud.wowza.com/api/[version]/](https://api.sandbox.cloud.wowza.com/api/%5Bversion%5D/)**_

In the Wowza Streaming Cloud REST API production environment, the base URL is

**[https://api.cloud.wowza.com/api/](https://api.cloud.wowza.com/api/)[_version_]/**

Lastly, here is a tutorial showing you how to use the proper headers and API call structure.

[https://www.youtube.com/watch?v=l9MSuzZi0Go](https://www.youtube.com/watch?v=l9MSuzZi0Go)

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 13, 2019, 2:13pm UTC](https://community.wowza.com/t/invalid-api-key-error/54332/3 "2019-12-13T14:13:52Z")

</div>

Your post was edited to protect your account info. Please do not publicly post your private API keys.
