# API Issue Error 422 Root Key

**URL:** <https://community.wowza.com/t/api-issue-error-422-root-key/54771>\
**Category:** Wowza Video (Formerly Streaming Cloud)\
**Created:** [March 9, 2020, 2:17pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771 "2020-03-09T14:17:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Hackney1](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Alex\_Hackney1](https://community.wowza.com/u/Alex_Hackney1)\
**Post date:** [March 9, 2020, 2:17pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/1 "2020-03-09T14:17:25Z")

</div>

Getting an error 422

```auto
"{"meta":{"status":422,"code":"ERR-422-NoWrappingKey","title":"No Wrapping Key Error","message":"The JSON data you tried to push isn't wrapped in a root key.","description":""},"request_id":"9f009a583a9c50f29546653012189e6d","request_timestamp":"2020-03-08T06:36:41.550Z"}"

```

My json is though:

```auto
"{"live_stream":{"aspect_ratio_height":1080,"aspect_ratio_width":1920,...

```

I’m sure it’s something silly but I’m lost on it lol.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [March 9, 2020, 2:37pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/2 "2020-03-09T14:37:50Z")

</div>

Are you trying to create a live stream? My guess is you are missing your keys in your header - [https://www.wowza.com/docs/how-to-broadcast-a-live-stream-by-using-the-wowza-streaming-cloud-rest-api](https://www.wowza.com/docs/how-to-broadcast-a-live-stream-by-using-the-wowza-streaming-cloud-rest-api)

```auto
curl -X POST \
-H "Content-Type: application/json" \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
-d '{
   "live_stream": {
     "aspect_ratio_height": 1080,
     "aspect_ratio_width": 1920,
     "billing_mode": "pay_as_you_go",
     "broadcast_location": "us_west_california",
     "closed_caption_type": "none",
     "delivery_method": "push",
     "encoder": "wowza_gocoder",
     "hosted_page": true,
     "hosted_page_sharing_icons": true,
     "name": "MyLiveStream",
     "player_responsive": true,
     "player_type": "wowza_player",
     "transcoder_type": "transcoded"
   }
}' "${WSC_HOST}/api/${WSC_VERSION}/live_streams"

```

---

<div class="post-metadata">

**Author:** ![Alex\_Hackney1](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Alex\_Hackney1](https://community.wowza.com/u/Alex_Hackney1)\
**Post date:** [March 9, 2020, 2:55pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/3 "2020-03-09T14:55:13Z")

</div>

In this scenario yes, but I can pull a list of live streams with no issue. So it’s not a key issue.

---

<div class="post-metadata">

**Author:** ![Alex\_Hackney1](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@Alex\_Hackney1](https://community.wowza.com/u/Alex_Hackney1)\
**Post date:** [March 9, 2020, 3:14pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/4 "2020-03-09T15:14:09Z")

</div>

In this scenario yes, but I can pull a list of live streams with no issue. So it’s not a key issue.

---

<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:** [March 9, 2020, 3:34pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/5 "2020-03-09T15:34:05Z")

</div>

Can you share more details of your workflow since that error code could apply to a few different scenarios? Are you trying to create stream target using the REST API from Engine to Cloud? Or a stream target within Cloud?

More info needed on what you’re trying to accomplish please, so we can try and help. Thank you.

Usually the specific wrapper mention in the error code means an issue with this line: `stream_target_wowza`.

The first call in the reference [article](https://www.wowza.com/docs/how-to-send-a-stream-from-wowza-streaming-engine-to-a-wowza-cdn-hls-target-by-using-the-wowza-streaming-engine-and-wowza-streaming-cloud-rest-apis) should look like this:

```auto
curl -X POST \<br>-H "Content-Type: application/json" \<br>-H "wsc-api-key: ${WSC_API_KEY}" \<br>-H "wsc-access-key: ${WSC_ACCESS_KEY}" \<br>-d '{<br> "stream_target_wowza": {<br> "name": "MyCloudHLStarget",<br> "provider": "akamai_cupertino"<br> }<br>}' "${WSC_HOST}/api/${WSC_VERSION}/stream_targets/wowza"

```

But, again just a guess without more info, but please check that article if it applies to your workflow.

---

<div class="post-metadata">

**Author:** ![Amara\_Graham](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/amara_graham/32/381_2.png) [@Amara\_Graham](https://community.wowza.com/u/Amara_Graham)\
**Post date:** [August 31, 2020, 3:26pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/6 "2020-08-31T15:26:06Z")

</div>

[@JEAN-MARC PERELMUTER](http://community.wowza.com/community/questions/55121/api-issue-error-422-root-key.html#) We are migrating to a new forum platform soon and hope you’ll find the UX easier to navigate. I’ve had similar issues.

I see you are using the beta version (1.6) based on your screenshot. Is this happening in 1.5 as well?

---

<div class="post-metadata">

**Author:** ![JEAN-MARC\_PERELMUTER](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@JEAN-MARC\_PERELMUTER](https://community.wowza.com/u/JEAN-MARC_PERELMUTER)\
**Post date:** [August 29, 2020, 6:53pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/7 "2020-08-29T18:53:13Z")

</div>

Hi @Amara Graham / @Rose Power,

We are experiencing the same issue with all POST requests to the API endpoints. All get requests are working perfectly.

Here’s the screenshot of the Headers and Parameters. I hope you resolve this as soon as possible. Thank you

PARAMETERS:

Also please fix the User Experience issue in this forum. Please hide the Reply Form when the user is not logged in. I re-wrote this response - it is somewhat frustrating. Thanks

---

<div class="post-metadata">

**Author:** ![JEAN-MARC\_PERELMUTER](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@JEAN-MARC\_PERELMUTER](https://community.wowza.com/u/JEAN-MARC_PERELMUTER)\
**Post date:** [August 31, 2020, 3:07pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/8 "2020-08-31T15:07:59Z")

</div>

I got it working. For those who are using Laravel HTTP client, you can try this:

```auto
// Create Stream Target
$response = Http::withHeaders([
            'wsc-api-key' => $apiKey,
            'wsc-access-key' => $accessKey,
            'Content-Type' => 'application/json'
        ])->post( WOWZA_API_URL."/stream_targets/fastly", [
                'stream_target_fastly' => [
                    'name' => 'MyStreamTargets'
                ]
        ],
);

```

But please fix the user experience issue in this forum. Also when you try to remove the attached image when writing a post or reply, it scrolls back to top instead of staying on the editor section. Thanks

---

<div class="post-metadata">

**Author:** ![Barry\_Owen](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/barry_owen/32/2003_2.png) [@Barry\_Owen](https://community.wowza.com/u/Barry_Owen)\
**Post date:** [January 12, 2022, 6:21pm UTC](https://community.wowza.com/t/api-issue-error-422-root-key/54771/9 "2022-01-12T18:21:15Z")

</div>

FWIW - I have seen this response when I forgot to specify the content type header as json.
