# Specifying 'Any scope' when creating claim via API

**URL:** <https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653>\
**Category:** API\
**Created:** [January 13, 2025, 9:34pm UTC](https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653 "2025-01-13T21:34:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshuaan7](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@joshuaan7](https://devforum.okta.com/u/joshuaan7)\
**Post date:** [January 13, 2025, 9:34pm UTC](https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653/1 "2025-01-13T21:34:06Z")

</div>

In the UI, when creating a claim for an authorization server, I can include in “Any Scope” for an access token with a value type of “expression”. How can I do specify “Any Scope” when using the API? The documentation says that the conditions.scope only accepts an array of strings, but how can I make it include any scope? I’m referencing [Authorization Server Claims](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/AuthorizationServerClaims/#tag/AuthorizationServerClaims/operation/createOAuth2Claim!c=201&path=conditions/scopes&t=response).

Thanks!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 13, 2025, 10:13pm UTC](https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653/2 "2025-01-13T22:13:50Z")

</div>

Can you try setting the `conditions.scopes` to an empty array? When I go to create a custom claim within the UI and set it to “Any Scope,” I see a request payload to create the claim like this:

```auto
{
    "status":"ACTIVE",
    "name":"any_scope",
    "claimType":"RESOURCE",
    "valueType":"EXPRESSION",
    "value":"\"any\"",
    "group_filter_type":"STARTS_WITH",
    "conditions":{
        "scopes":[]
    },
    "alwaysIncludeInToken":true
}

```

---

<div class="post-metadata">

**Author:** ![joshuaan7](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@joshuaan7](https://devforum.okta.com/u/joshuaan7)\
**Post date:** [January 14, 2025, 2:28pm UTC](https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653/3 "2025-01-14T14:28:48Z")

</div>

Ah I see that, I will give that a shot thank you!

---

<div class="post-metadata">

**Author:** ![joshuaan7](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@joshuaan7](https://devforum.okta.com/u/joshuaan7)\
**Post date:** [January 21, 2025, 6:15pm UTC](https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653/4 "2025-01-21T18:15:30Z")

</div>

Hi andrea, I was able to test this out and it worked, thanks so much

---

<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:** [January 22, 2025, 6:15pm UTC](https://devforum.okta.com/t/specifying-any-scope-when-creating-claim-via-api/31653/5 "2025-01-22T18:15:31Z")

</div>

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