> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/user-search.md).

# User Search

Administrative, read-only endpoints for **finding users** by email address, name, phone number, or order number and reading a single user's profile.

### Core Capabilities

* List users, 10 per page by default, ordered by `id` ascending unless `sort` is given.
* Find a user by email address, by name, by phone number, or by the number of an order the user placed.
* Read one user by identifier.
* Every record carries the user's profile, communication permissions, and account type — registered and guest users, active and inactive, are all returned.

Only `GET` is supported; `POST`, `PUT`, `PATCH`, and `DELETE` return `405`.

### Filtering

Filters can be combined; a user must satisfy all of them.

| Parameter                 | Match                                                                                                                                                                                                                                                                                             |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                      | Exact user identifier.                                                                                                                                                                                                                                                                            |
| `q`                       | Same as `email`. It is **not** a free-text search.                                                                                                                                                                                                                                                |
| `email`                   | Case-insensitive **exact** match on the email addresses registered to the account (verified or not). Leading and trailing spaces are ignored. A user whose profile shows an email address that is not among the registered addresses (for example, a user created by a data import) is not found. |
| `first_name`, `last_name` | Case-insensitive **partial** match — `ann` finds `Anna` and `Joanne`.                                                                                                                                                                                                                             |
| `phone`                   | **Exact** match; the value must be written the way it is stored.                                                                                                                                                                                                                                  |
| `order_number`            | Partial match on the numbers of the user's orders. A user appears once even when several orders match.                                                                                                                                                                                            |

### Ordering

Use `sort` with a field of the returned record, such as `pk`, `date_joined`, `last_login`, or `last_name`; prefix with `-` for descending order. An unknown field name is ignored and the default order applies. `id` is not accepted as a sort field; use `pk` instead (`sort=-id` is ignored and the results stay in ascending order).

### Dynamic Settings & Environment Variables

No dynamic settings (`dj_dynamic_settings`) affect these endpoints. The validation settings used when a user is saved (`PHONE_NUMBER_UNIQUE_VALIDATOR_ACTIVE`, `USER_PROFILE_VALIDATIONS`) apply only to user updates, never to reading.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/user-search.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
