Search Organization Users By Organization Id And Roles Search Term Using POST

Search Organization Users By Organization Id And Roles Search Term Using POST

Search all users who have at least one of the specified roles and/or resource.
Search by resource can be exact match or by resource starting with given term. At most one of the filters resource or resourceStartsWith may be provided.
For all users found by these search criteria the result contains all users roles, no matter if they are part of the search criteria or not.
To search by resource starting with given term provide resourceStartsWith.
If resource is empty then unscoped role assignments will be returned.
When role is provided and resource is null all role assignments will be returned.
When filterResults flag is true the result is filtered by search parameters from the request: resource, resourceStartsWith and roles names.
In this case the result contains just the roles that match the search criteria.
Paginated results - by default start index of results is 1 and default number of search results per page is 200.
Searching access restricted to Organization Owners, Read-only operators and Service Owners (for organizations that have access to the service).

Access Policy

Role User Accounts Service Accounts (Client Credentials Applications)
Organization Admin ✔️ ✔️
Organization Owner ✔️ ✔️
Project Admin ✔️ ✔️
Request
URI
POST
https://{api_host}/csp/gateway/am/api/orgs/{orgId}/users/search
COPY
Path Parameters
string
orgId
Required

Unique identifier (GUID) of the organization.

Query Parameters
boolean
filterResults
Optional

Indicates if the response should be filtered by search parameters from the request: resource, resourceStartsWith and roles names (default: false).


Request Body
SearchUsersByRolesRequest of type(s) application/json
Required
"SearchUsersByRolesRequest Object"
boolean
expandProfile
Optional

Indicates if the response should be expanded with the user profile (default: false).

object
rolesSearchTerm
Optional

Defines the roles properties which are used for search.

string
resource
Optional
Constraints: minLength: 0 maxLength: 200

Resource to search for resource-scoped role assignments.

string
resourceStartsWith
Optional
Constraints: minLength: 0 maxLength: 200

Resource to search for resource-scoped role assignments starting with given term. This field is deprecated. Consider using "resource" along with "searchType".

string
searchType
Optional

Defines the searching capability of the "resource" field value.

Possible values are : EXACT_MATCH, CONTAINS, STARTS_WITH, ENDS_WITH,
integer As int32 As int32
pageLimit
Optional
Constraints: maximum: 200

Maximum number to return in response. Default value is 200.

integer As int32 As int32
pageStart
Optional
Constraints: minimum: 1

Start index for querying. Default value is 1.

string
userSearchTerm
Optional
Constraints: minLength: 0 maxLength: 120

The string to be searched within email or firstName or lastName or username.Max search length is 120 characters. If it contains space separated terms, then the searchTerm is matched against possible firstName and lastName combinations. This search term is case insensitive.

boolean
includeGroupIdsInRoles
Optional

Indicates if the inherited roles in the response should indicate group information (default: false).

boolean
excludeRoles
Optional

Indicates if the response should exclude the roles of the user (default: false).

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns PagedPostResponseExpandedTypedUserDto of type(s) application/json;charset=utf-8
{
    "itemsPerPage": 25,
    "totalResults": 2000,
    "startIndex": 5,
    "results": [
        {
            "user": {
                "firstName": "string",
                "lastName": "string",
                "userProfile": {
                    "locale": "string",
                    "language": "string",
                    "alternativeEmail": "string"
                },
                "userId": "string",
                "email": "string",
                "acct": "string",
                "domain": "string",
                "accessible": false,
                "username": "string",
                "idpId": "string"
            },
            "organizationRoles": [
                {
                    "displayName": "string",
                    "name": "string",
                    "resource": "string",
                    "createdBy": "string",
                    "lastUpdatedDate": "string",
                    "expiresAt": 3609941597,
                    "groups": [
                        {
                            "domain": "string",
                            "displayName": "string",
                            "id": "string",
                            "ownerOrgId": "string",
                            "sharedOrgIds": [
                                "string"
                            ],
                            "groupType": "string",
                            "usersCount": 0,
                            "description": "string"
                        }
                    ],
                    "createdDate": "string",
                    "membershipType": "string",
                    "groupIds": [
                        "string"
                    ],
                    "lastUpdatedBy": "string"
                }
            ],
            "serviceRoles": [
                {
                    "serviceRoleNames": [
                        "string"
                    ],
                    "serviceDefinitionId": "string",
                    "serviceRoles": [
                        {
                            "name": "string",
                            "resource": "string",
                            "createdBy": "string",
                            "lastUpdatedBy": "string",
                            "expiresAt": 3609941597,
                            "groups": [
                                {
                                    "domain": "string",
                                    "displayName": "string",
                                    "id": "string",
                                    "ownerOrgId": "string",
                                    "sharedOrgIds": [
                                        "string"
                                    ],
                                    "groupType": "string",
                                    "usersCount": 0,
                                    "description": "string"
                                }
                            ],
                            "createdDate": "string",
                            "membershipType": "string",
                            "groupIds": [
                                "string"
                            ],
                            "lastUpdatedDate": "string"
                        }
                    ]
                }
            ],
            "customRoles": [
                {
                    "name": "string",
                    "resource": "string",
                    "createdBy": "string",
                    "lastUpdatedBy": "string",
                    "expiresAt": 3609941597,
                    "groups": [
                        {
                            "domain": "string",
                            "displayName": "string",
                            "id": "string",
                            "ownerOrgId": "string",
                            "sharedOrgIds": [
                                "string"
                            ],
                            "groupType": "string",
                            "usersCount": 0,
                            "description": "string"
                        }
                    ],
                    "createdDate": "string",
                    "membershipType": "string",
                    "groupIds": [
                        "string"
                    ],
                    "lastUpdatedDate": "string"
                }
            ],
            "orgId": "string"
        }
    ]
}
integer As int32 As int32
itemsPerPage
Optional

Number of items per page.

integer As int32 As int32
totalResults
Optional

Total number of results if available

integer As int32 As int32
startIndex
Optional

Start index of the results.

array of object
results
Optional

Partial list of returned results.


400

At least one role search term must be specified

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


401

The user is not authorized to use the API

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


403

The user is forbidden to use the API

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


404

Organization with this identifier is not found.

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


409

The request could not be processed due to a conflict

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


429

The user has sent too many requests

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


500

An unexpected error has occurred while processing the request

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/csp/gateway/am/api/orgs/{orgId}/users/search
                
Organization Operations
GET
Get Sub Organizations By Organization Id Using GET
POST
Activate Organization Refresh Tokens Using POST
Deprecated
GET
Get Organization Roles By Organization Id Using GET
POST
Search Organization Users By Organization Id And Roles Search Term Using POST
GET
Get Users In Organization By Organization Id And User Search Term Using GET
Deprecated
DELETE
Revoke User Invitation By Organization Id And User Invitation Id Using DELETE
GET
Get User Invitation By Organization Id And User Invitation Id Using GET
POST
Deactivate Organization Refresh Tokens With Api Token Path Using POST
POST
Assign Roles To Clients On Organization Using POST
DELETE
Remove Clients From Organization By Organization Id Using DELETE
GET
Get Organization Clients By Organization Id Using GET
POST
Deactivate Organization Refresh Tokens Using POST
Deprecated
PATCH
Update Organization By Organization Id Using PATCH
GET
Get Organization By Id Using GET
DELETE
Remove Users From Organization By Organization Id Using DELETE
GET
Get Organization Users By Organization Id Using GET
POST
Activate Organization Refresh Tokens With Api Token Path Using POST
POST
Invite Users Using POST
GET
Get Organization Invitations By Organization Id Using GET
POST
Link Org To Idp Using POST
DELETE
Delete Organization Idp Registration Using DELETE
GET
Get Org Linked Idp Details Using GET
GET
Get Groups In Organizations By Organization Id And Group Search Term Using GET