# defaultRelayState param in apps api does not work

**URL:** <https://devforum.okta.com/t/defaultrelaystate-param-in-apps-api-does-not-work/22821>\
**Category:** Questions\
**Created:** [December 16, 2022, 9:23pm UTC](https://devforum.okta.com/t/defaultrelaystate-param-in-apps-api-does-not-work/22821 "2022-12-16T21:23:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apihacker](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@apihacker](https://devforum.okta.com/u/apihacker)\
**Post date:** [December 16, 2022, 9:23pm UTC](https://devforum.okta.com/t/defaultrelaystate-param-in-apps-api-does-not-work/22821/1 "2022-12-16T21:23:10Z")

</div>

I have been (successfully) creating “Custom SAML 2.0 Apps” using the API (via both Postman and exported cURL). It works fine except all values for “defaultRelayState” are ignored. In fact, it i clear that the API engine does not even recognize this (documented) parameter, since the value in the created app is alway null and not even “” when that is specified, as it is in the example ([Apps | Okta Developer](https://developer.okta.com/docs/reference/api/apps/#request-example-9))

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [December 19, 2022, 5:35am UTC](https://devforum.okta.com/t/defaultrelaystate-param-in-apps-api-does-not-work/22821/2 "2022-12-19T05:35:31Z")

</div>

Hello @apihacker,

I just tested and it worked fine for me.  
Can you supply the full cURL command you are using (you don’t need to supply or Org URL).

Okta returns an HTTP Header x-okta-`request`-id, can you supply the value of this as well.

Thank You,

---

<div class="post-metadata">

**Author:** ![apihacker](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@apihacker](https://devforum.okta.com/u/apihacker)\
**Post date:** [December 20, 2022, 5:47am UTC](https://devforum.okta.com/t/defaultrelaystate-param-in-apps-api-does-not-work/22821/3 "2022-12-20T05:47:43Z")

</div>

You are correct. It seems I did not add  
“app”: {} under “settings” in the payload.

The Postman code does have this but the SAML Custom app docs do not:  
[Apps | Okta Developer](https://developer.okta.com/docs/reference/api/apps/#authentication-context-class)

Works after adding that additional json.

You might want to check and fix that item.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [December 21, 2022, 5:47am UTC](https://devforum.okta.com/t/defaultrelaystate-param-in-apps-api-does-not-work/22821/4 "2022-12-21T05:47:48Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
