> For the complete documentation index, see [llms.txt](https://docs.partssource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.partssource.com/api-customer/preview/users.md).

# Users

Users

## Search users

> Searches users using structured query syntax. Supports field-level filtering with operators.

```json
{"openapi":"3.0.1","info":{"title":"Customer API","version":"v1"},"tags":[{"name":"users","description":"Users"}],"servers":[{"url":"https://api.partssource.com/customer","description":"Production Environment"}],"security":[{"customer-api-authorizer":[],"api-key":[]}],"components":{"securitySchemes":{"customer-api-authorizer":{"type":"apiKey","description":"AWS Cognito JWT token. Include as 'Authorization: Bearer {token}' header.","name":"Authorization","in":"header"}},"schemas":{"UserSearchListResponseApiResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserSearchListResponse"},"correlationId":{"type":"string","nullable":true},"timestamp":{"type":"string","format":"date-time"}},"additionalProperties":false},"UserSearchListResponse":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/UserProfile"},"nullable":true},"pagination":{"$ref":"#/components/schemas/PaginationInfo"}},"additionalProperties":false},"UserProfile":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the user contact record.","format":"int64"},"userName":{"type":"string","description":"Login user ID for authentication.","nullable":true},"email":{"type":"string","description":"User's email address.","nullable":true},"firstName":{"type":"string","description":"User's first name.","nullable":true},"lastName":{"type":"string","description":"User's last name.","nullable":true},"companies":{"type":"array","items":{"$ref":"#/components/schemas/UserCompany"},"description":"List of companies the user is associated with.","nullable":true}},"additionalProperties":false,"description":"User profile information."},"UserCompany":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the company.","format":"int64"},"name":{"type":"string","description":"Company name.","nullable":true},"rootCompanyId":{"type":"integer","description":"Root company identifier for the company hierarchy.","format":"int64"},"shippingAddresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"List of shipping addresses for the company.","nullable":true},"billingAddresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"List of billing addresses for the company.","nullable":true}},"additionalProperties":false,"description":"Company information associated with a user."},"Address":{"required":["city","id","line1","state","zip"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the address","format":"int64"},"line1":{"minLength":1,"type":"string","description":"First line of the address"},"line2":{"type":"string","description":"Second line of the address (optional)","nullable":true},"city":{"minLength":1,"type":"string","description":"City name"},"state":{"minLength":1,"type":"string","description":"State or province"},"zip":{"minLength":1,"type":"string","description":"ZIP or postal code"}},"additionalProperties":false,"description":"Address information for shipping or billing"},"PaginationInfo":{"required":["hasMore","limit","offset","total"],"type":"object","properties":{"total":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32"},"limit":{"maximum":2147483647,"minimum":1,"type":"integer","format":"int32"},"offset":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32"},"hasMore":{"type":"boolean"}},"additionalProperties":false},"ApiProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true},"correlationId":{"type":"string","nullable":true},"errors":{"type":"array","items":{"type":"string"},"nullable":true},"timestamp":{"type":"string","format":"date-time"},"service":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/users/search":{"get":{"tags":["users"],"summary":"Search users","description":"Searches users using structured query syntax. Supports field-level filtering with operators.","operationId":"SearchUsersGet","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"maximum":100,"minimum":1,"type":"integer","format":"int32","default":50}},{"name":"offset","in":"query","schema":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32","default":0}}],"responses":{"200":{"description":"Search results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchListResponseApiResponse"}}}},"400":{"description":"Invalid query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProblemDetails"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiProblemDetails"}}}}}}}}}
```

## Search users (deprecated)

> Deprecated: Use GET /users or GET /users/search instead. Returns a paginated list of users matching the supplied criteria.

```json
{"openapi":"3.0.1","info":{"title":"Customer API","version":"v1"},"tags":[{"name":"users","description":"Users"}],"servers":[{"url":"https://api.partssource.com/customer","description":"Production Environment"}],"security":[{"customer-api-authorizer":[],"api-key":[]}],"components":{"securitySchemes":{"customer-api-authorizer":{"type":"apiKey","description":"AWS Cognito JWT token. Include as 'Authorization: Bearer {token}' header.","name":"Authorization","in":"header"}},"schemas":{"UserSearchRequest":{"type":"object","properties":{"filters":{"$ref":"#/components/schemas/UserSearchFilters"},"pagination":{"$ref":"#/components/schemas/UserSearchPagination"}},"additionalProperties":false},"UserSearchFilters":{"type":"object","properties":{"email":{"type":"string","nullable":true},"emailContains":{"type":"string","nullable":true},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true}},"additionalProperties":false},"UserSearchPagination":{"type":"object","properties":{"sortBy":{"$ref":"#/components/schemas/UserSortBy"},"sortDir":{"$ref":"#/components/schemas/SortDirection"},"limit":{"type":"integer","format":"int32"},"offset":{"type":"integer","format":"int32"}},"additionalProperties":false},"UserSortBy":{"enum":["Id","FirstName","LastName","Email","UserName"],"type":"string","description":"\n\nPossible values:\n- `Id`\n- `FirstName`\n- `LastName`\n- `Email`\n- `UserName`"},"SortDirection":{"enum":["Asc","Desc"],"type":"string","description":"\n\nPossible values:\n- `Asc`\n- `Desc`"},"UserSearchListResponseApiResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserSearchListResponse"},"correlationId":{"type":"string","nullable":true},"timestamp":{"type":"string","format":"date-time"}},"additionalProperties":false},"UserSearchListResponse":{"type":"object","properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/UserProfile"},"nullable":true},"pagination":{"$ref":"#/components/schemas/PaginationInfo"}},"additionalProperties":false},"UserProfile":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the user contact record.","format":"int64"},"userName":{"type":"string","description":"Login user ID for authentication.","nullable":true},"email":{"type":"string","description":"User's email address.","nullable":true},"firstName":{"type":"string","description":"User's first name.","nullable":true},"lastName":{"type":"string","description":"User's last name.","nullable":true},"companies":{"type":"array","items":{"$ref":"#/components/schemas/UserCompany"},"description":"List of companies the user is associated with.","nullable":true}},"additionalProperties":false,"description":"User profile information."},"UserCompany":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the company.","format":"int64"},"name":{"type":"string","description":"Company name.","nullable":true},"rootCompanyId":{"type":"integer","description":"Root company identifier for the company hierarchy.","format":"int64"},"shippingAddresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"List of shipping addresses for the company.","nullable":true},"billingAddresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"List of billing addresses for the company.","nullable":true}},"additionalProperties":false,"description":"Company information associated with a user."},"Address":{"required":["city","id","line1","state","zip"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the address","format":"int64"},"line1":{"minLength":1,"type":"string","description":"First line of the address"},"line2":{"type":"string","description":"Second line of the address (optional)","nullable":true},"city":{"minLength":1,"type":"string","description":"City name"},"state":{"minLength":1,"type":"string","description":"State or province"},"zip":{"minLength":1,"type":"string","description":"ZIP or postal code"}},"additionalProperties":false,"description":"Address information for shipping or billing"},"PaginationInfo":{"required":["hasMore","limit","offset","total"],"type":"object","properties":{"total":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32"},"limit":{"maximum":2147483647,"minimum":1,"type":"integer","format":"int32"},"offset":{"maximum":2147483647,"minimum":0,"type":"integer","format":"int32"},"hasMore":{"type":"boolean"}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/users/search":{"post":{"tags":["users"],"summary":"Search users (deprecated)","description":"Deprecated: Use GET /users or GET /users/search instead. Returns a paginated list of users matching the supplied criteria.","operationId":"SearchUsers","parameters":[{"name":"q","in":"query","description":"Optional structured query string. When provided, body filters are ignored.","schema":{"type":"string"}}],"requestBody":{"description":"Search request containing filters and pagination options.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/UserSearchRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UserSearchRequest"}}}},"responses":{"200":{"description":"Search results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSearchListResponseApiResponse"}}}},"400":{"description":"Validation errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"500":{"description":"Internal server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}},"deprecated":true}}}}
```

## Lookup user by ID or username

> Retrieves a single user profile using CONTACT\_ID (userId) or LOGIN\_USER\_ID (userName).

```json
{"openapi":"3.0.1","info":{"title":"Customer API","version":"v1"},"tags":[{"name":"users","description":"Users"}],"servers":[{"url":"https://api.partssource.com/customer","description":"Production Environment"}],"security":[{"customer-api-authorizer":[],"api-key":[]}],"components":{"securitySchemes":{"customer-api-authorizer":{"type":"apiKey","description":"AWS Cognito JWT token. Include as 'Authorization: Bearer {token}' header.","name":"Authorization","in":"header"}},"schemas":{"UserLookupResponseApiResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserLookupResponse"},"correlationId":{"type":"string","nullable":true},"timestamp":{"type":"string","format":"date-time"}},"additionalProperties":false},"UserLookupResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/UserProfile"}},"additionalProperties":false},"UserProfile":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the user contact record.","format":"int64"},"userName":{"type":"string","description":"Login user ID for authentication.","nullable":true},"email":{"type":"string","description":"User's email address.","nullable":true},"firstName":{"type":"string","description":"User's first name.","nullable":true},"lastName":{"type":"string","description":"User's last name.","nullable":true},"companies":{"type":"array","items":{"$ref":"#/components/schemas/UserCompany"},"description":"List of companies the user is associated with.","nullable":true}},"additionalProperties":false,"description":"User profile information."},"UserCompany":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the company.","format":"int64"},"name":{"type":"string","description":"Company name.","nullable":true},"rootCompanyId":{"type":"integer","description":"Root company identifier for the company hierarchy.","format":"int64"},"shippingAddresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"List of shipping addresses for the company.","nullable":true},"billingAddresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"},"description":"List of billing addresses for the company.","nullable":true}},"additionalProperties":false,"description":"Company information associated with a user."},"Address":{"required":["city","id","line1","state","zip"],"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier for the address","format":"int64"},"line1":{"minLength":1,"type":"string","description":"First line of the address"},"line2":{"type":"string","description":"Second line of the address (optional)","nullable":true},"city":{"minLength":1,"type":"string","description":"City name"},"state":{"minLength":1,"type":"string","description":"State or province"},"zip":{"minLength":1,"type":"string","description":"ZIP or postal code"}},"additionalProperties":false,"description":"Address information for shipping or billing"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}},"paths":{"/users/lookup":{"get":{"tags":["users"],"summary":"Lookup user by ID or username","description":"Retrieves a single user profile using CONTACT_ID (userId) or LOGIN_USER_ID (userName).","operationId":"LookupUser","parameters":[{"name":"userId","in":"query","description":"Unique CONTACT_ID value assigned to the user.","schema":{"type":"string"}},{"name":"userName","in":"query","description":"LOGIN_USER_ID associated with the user.","schema":{"type":"string"}}],"responses":{"200":{"description":"User located successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLookupResponseApiResponse"}}}},"400":{"description":"Invalid lookup parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"User not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}}}
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.partssource.com/api-customer/preview/users.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
