# Search

## Search for the users eligible to act as \*Approvers\*.

> Search for the users who can be assigned to the approvals.\
> \
> In case of any validation problem, the below \`errorCodes\` can be returned:\
> &#x20; \- \*\*APPROVAL-400008\*\*: Requested user has no permissions to the resource.\
> &#x20; \- \*\*APPROVAL-400011\*\*: Requested user is not assigned to any company.\
> &#x20; \- \*\*APPROVAL-404002\*\*: Provided resource does not exist.\
> &#x20; \- \*\*APPROVAL-404003\*\*: Requested user is not assigned to any legal entity.\
> \
> \*\*\*\
> \*\*Required scopes\*\*\
> \* \`approval.approval\_read\_own\`<br>

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"tags":[{"name":"Search"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"CustomerAccessToken":[]}],"components":{"securitySchemes":{"CustomerAccessToken":{"type":"http","scheme":"bearer","description":"To generate a customer access token, go to the [Logging in a customer](https://developer.emporix.io/api-references/api-guides/companies-and-customers/customer-management/api-reference/authentication-and-authorization#post-customer-tenant-login) endpoint."}},"responses":{"ApprovalSearchUsersResponse_200":{"description":"Approval permitted response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/approvalSearchUsersResponse"}}}},"approvals_response_BadRequest_400":{"description":"Bad request due to validation, incorrect parameters, etc.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}},"common_response_Unauthorized_401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"common_response_Forbidden_403":{"description":"Access forbidden. The caller is not allowed to access this resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/coreErrorMessage"}}}}},"schemas":{"approvalSearchUsersResponse":{"title":"Search approval users response","description":"Base schema search approval users response.","type":"array","items":{"$ref":"#/components/schemas/user"}},"user":{"title":"user schema","type":"object","properties":{"userId":{"type":"string","description":"An identifier of the user."},"firstName":{"type":"string","description":"First name of the user."},"lastName":{"type":"string","description":"Last name of the user."}},"required":["userId","firstName","lastName"]},"coreErrorMessage":{"type":"object","properties":{"code":{"type":"integer","description":"HTTP Status Code."},"status":{"type":"string","description":"HTTP Status."},"message":{"type":"string","description":"Error message."},"errorCode":{"type":"string","description":"code of the error."},"details":{"description":"Details information.","type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}}},"searchUsersRequest":{"title":"Search approver users request","type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/resourceType"},"resourceId":{"type":"string","description":"An identifier of the resource for approval."},"action":{"$ref":"#/components/schemas/approvalAction"}},"required":["resourceType","resourceId","action"]},"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]}},"requestBodies":{"approvalSearchUsersRequestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/searchUsersRequest"}}}}},"parameters":{"path_tenant":{"name":"tenant","in":"path","required":true,"description":"Your Emporix tenant name.\n**Note**: The tenant name should always be written in lowercase.\n","schema":{"pattern":"^[a-z][a-z0-9]+$","minLength":3,"maxLength":16,"type":"string"}}}},"paths":{"/approval/{tenant}/search/users":{"post":{"summary":"Search for the users eligible to act as *Approvers*.","responses":{"200":{"$ref":"#/components/responses/ApprovalSearchUsersResponse_200"},"400":{"$ref":"#/components/responses/approvals_response_BadRequest_400"},"401":{"$ref":"#/components/responses/common_response_Unauthorized_401"},"403":{"$ref":"#/components/responses/common_response_Forbidden_403"}},"description":"Search for the users who can be assigned to the approvals.\n\nIn case of any validation problem, the below `errorCodes` can be returned:\n  - **APPROVAL-400008**: Requested user has no permissions to the resource.\n  - **APPROVAL-400011**: Requested user is not assigned to any company.\n  - **APPROVAL-404002**: Provided resource does not exist.\n  - **APPROVAL-404003**: Requested user is not assigned to any legal entity.\n\n***\n**Required scopes**\n* `approval.approval_read_own`\n","operationId":"POST-approval-search-users","requestBody":{"$ref":"#/components/requestBodies/approvalSearchUsersRequestBody"},"parameters":[{"$ref":"#/components/parameters/path_tenant"}],"tags":["Search"]}}}}
```
