# Search

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

> Searches for the users who can be assigned to the approvals. The user must be a \*Requestor\* or an \*Approver\* to have the required \`approval.approval\_read\_own\` scope.\
> \
> 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.<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":"Searches for the users who can be assigned to the approvals. The user must be a *Requestor* or an *Approver* to have the required `approval.approval_read_own` scope.\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","operationId":"POST-approval-search-users","requestBody":{"$ref":"#/components/requestBodies/approvalSearchUsersRequestBody"},"parameters":[{"$ref":"#/components/parameters/path_tenant"}],"tags":["Search"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references-1/readme/approval-api-reference/search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
