> 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/get-a-user.md).

# Get a user

Returns a single user by identifier, including inactive and guest users.

```json
{"openapi":"3.1.0","info":{"title":"Admin API","version":"1.0.0"},"tags":[{"name":"User Search","description":"Administrative, read-only endpoints for **finding users** by email address, name, phone number, or order number and reading a single user's profile.\n\n## Core Capabilities\n\n* List users, 10 per page by default, ordered by `id` ascending unless `sort` is given.\n* Find a user by email address, by name, by phone number, or by the number of an order the user placed.\n* Read one user by identifier.\n* Every record carries the user's profile, communication permissions, and account type — registered and guest users, active and inactive, are all returned.\n\nOnly `GET` is supported; `POST`, `PUT`, `PATCH`, and `DELETE` return `405`.\n\n## Filtering\n\nFilters can be combined; a user must satisfy all of them.\n\n| Parameter | Match |\n|-----------|-------|\n| `id` | Exact user identifier. |\n| `q` | Same as `email`. It is **not** a free-text search. |\n| `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. |\n| `first_name`, `last_name` | Case-insensitive **partial** match — `ann` finds `Anna` and `Joanne`. |\n| `phone` | **Exact** match; the value must be written the way it is stored. |\n| `order_number` | Partial match on the numbers of the user's orders. A user appears once even when several orders match. |\n\n## Ordering\n\nUse `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).\n\n## Dynamic Settings & Environment Variables\n\nNo 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."}],"servers":[{"description":"Omnitron Remote Proxy (external access — recommended)","url":"https://{omnitron_url}/api/v1/remote/{channel_id}","variables":{"omnitron_url":{"default":"sandbox.akinon.com","description":"Omnitron server URL (e.g., {omnitron.akinon.com})"},"channel_id":{"default":"1","description":"The channel identifier the remote request is routed through"}}},{"description":"Commerce API Server (internal / direct access only)","url":"https://{commerce_url}/api/v1","variables":{"commerce_url":{"default":"sandbox.akinon.com","description":"Internal commerce server URL, reachable only from within the Omnitron network"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Token credential sent in the Authorization header, in the form: `Token <your-token>`. Requires a staff (admin) account."}},"parameters":{"userSearchId":{"name":"id","in":"path","required":true,"description":"The unique identifier of the user.","schema":{"type":"integer"}}},"schemas":{"UserSearch":{"type":"object","description":"A user's profile and communication permissions.","properties":{"pk":{"type":"integer","description":"Unique identifier of the user."},"username":{"type":"string","description":"Username of the user."},"first_name":{"type":"string","description":"First name of the user."},"last_name":{"type":"string","description":"Last name of the user."},"email":{"type":"string","description":"Email of the user; empty string when not set."},"is_active":{"type":"boolean","description":"Whether the account is active."},"date_joined":{"type":"string","format":"date-time","description":"When the user registered."},"last_login":{"type":["string","null"],"format":"date-time","description":"When the user last logged in; `null` when the user never has."},"email_allowed":{"type":"boolean","description":"Whether the user has opted in to email communication."},"sms_allowed":{"type":"boolean","description":"Whether the user has opted in to SMS communication."},"whatsapp_allowed":{"type":["boolean","null"],"description":"Whether the user has opted in to WhatsApp communication; `null` when never set."},"call_allowed":{"type":["boolean","null"],"description":"Whether the user has opted in to phone call communication; `null` when never set."},"gender":{"oneOf":[{"$ref":"#/components/schemas/UserGender"},{"type":"null"}]},"attributes":{"type":"object","additionalProperties":true,"description":"Additional free-form data stored on the user, as key-value pairs."},"phone":{"type":["string","null"],"description":"Phone number of the user."},"date_of_birth":{"type":["string","null"],"format":"date","description":"Date of birth of the user."},"attributes_kwargs":{"type":"object","additionalProperties":true,"description":"Settings of the additional data stored in `attributes`, as key-value pairs."},"user_type":{"oneOf":[{"$ref":"#/components/schemas/UserType"},{"type":"null"}]},"modified_date":{"type":["string","null"],"format":"date-time","description":"When the user record was last modified."}}},"UserGender":{"type":"string","description":"The gender of the user.","enum":["male","female","not_to_say"]},"UserType":{"type":"string","description":"The type of the user account.\n\n| Value | Description |\n|-------|-------------|\n| `registered` | A user who created an account. |\n| `guest` | An account created automatically for a customer who placed an order without registering. |","enum":["registered","guest"]},"Error":{"type":"object","description":"An error response.","properties":{"detail":{"type":"string","description":"A human-readable description of the error."}},"additionalProperties":true}},"responses":{"Unauthorized":{"description":"Authentication credentials were not provided or are invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The authenticated user does not have administrator privileges.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UserSearchNotFound":{"description":"The requested user or result page does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/user_search/{id}/":{"get":{"tags":["User Search"],"operationId":"getUserSearch","summary":"Get a user","description":"Returns a single user by identifier, including inactive and guest users.","parameters":[{"$ref":"#/components/parameters/userSearchId"}],"responses":{"200":{"description":"The requested user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearch"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/UserSearchNotFound"}}}}}}
```


---

# 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/get-a-user.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.
