# \UsersApi

All URIs are relative to *https://registry.example.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**assign_user_role**](UsersApi.md#assign_user_role) | **POST** /api/v1/users/{id}/roles | Assign role to user
[**change_password**](UsersApi.md#change_password) | **POST** /api/v1/users/{id}/password | Change password
[**create_user**](UsersApi.md#create_user) | **POST** /api/v1/users | Create user
[**create_user_token**](UsersApi.md#create_user_token) | **POST** /api/v1/users/{id}/tokens | Create API token
[**delete_user**](UsersApi.md#delete_user) | **DELETE** /api/v1/users/{id} | Delete user
[**delete_user_token**](UsersApi.md#delete_user_token) | **DELETE** /api/v1/users/{id}/tokens/{token_id} | Revoke API token
[**get_user**](UsersApi.md#get_user) | **GET** /api/v1/users/{id} | Get user by ID
[**list_user_roles**](UsersApi.md#list_user_roles) | **GET** /api/v1/users/{id}/roles | List user roles
[**list_user_tokens**](UsersApi.md#list_user_tokens) | **GET** /api/v1/users/{id}/tokens | List API tokens
[**list_users**](UsersApi.md#list_users) | **GET** /api/v1/users | List users
[**remove_user_role**](UsersApi.md#remove_user_role) | **DELETE** /api/v1/users/{id}/roles/{role_id} | Remove role from user
[**reset_password**](UsersApi.md#reset_password) | **POST** /api/v1/users/{id}/password/reset | Reset user password
[**update_user**](UsersApi.md#update_user) | **PATCH** /api/v1/users/{id} | Update user



## assign_user_role

> assign_user_role(id, assign_user_role_request)
Assign role to user

Assigns an existing role to the specified user. Requires admin privileges.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |
**assign_user_role_request** | [**AssignUserRoleRequest**](AssignUserRoleRequest.md) |  | [required] |

### Return type

 (empty response body)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## change_password

> change_password(id, change_password_request)
Change password

Changes the password for the specified user. Requires the current password for verification.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |
**change_password_request** | [**ChangePasswordRequest**](ChangePasswordRequest.md) |  | [required] |

### Return type

 (empty response body)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## create_user

> models::User create_user(create_user_request)
Create user

Creates a new user account. Requires admin privileges.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**create_user_request** | [**CreateUserRequest**](CreateUserRequest.md) |  | [required] |

### Return type

[**models::User**](User.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## create_user_token

> models::CreateUserToken201Response create_user_token(id, create_user_token_request)
Create API token

Creates a new API token for the specified user. The token value is only returned in the creation response and cannot be retrieved afterwards.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |
**create_user_token_request** | [**CreateUserTokenRequest**](CreateUserTokenRequest.md) |  | [required] |

### Return type

[**models::CreateUserToken201Response**](createUserToken_201_response.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## delete_user

> delete_user(id)
Delete user

Permanently deletes a user account. Requires admin privileges.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |

### Return type

 (empty response body)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## delete_user_token

> delete_user_token(id, token_id)
Revoke API token

Permanently revokes and deletes an API token.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |
**token_id** | **uuid::Uuid** | Token UUID | [required] |

### Return type

 (empty response body)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_user

> models::User get_user(id)
Get user by ID

Returns a single user by their unique identifier.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |

### Return type

[**models::User**](User.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## list_user_roles

> Vec<models::Role> list_user_roles(id)
List user roles

Returns all roles assigned to the specified user.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |

### Return type

[**Vec<models::Role>**](Role.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## list_user_tokens

> Vec<models::ApiToken> list_user_tokens(id)
List API tokens

Returns all API tokens for the specified user. Token values are not included in the response.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |

### Return type

[**Vec<models::ApiToken>**](ApiToken.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## list_users

> models::ListUsers200Response list_users(search, is_active, page, per_page)
List users

Returns a paginated list of users with optional filtering by search term and active status.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**search** | Option<**String**> | Filter users by username, email, or display name. |  |
**is_active** | Option<**bool**> | Filter by active status. |  |
**page** | Option<**i32**> | Page number for pagination |  |[default to 1]
**per_page** | Option<**i32**> | Number of items per page |  |[default to 20]

### Return type

[**models::ListUsers200Response**](listUsers_200_response.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## remove_user_role

> remove_user_role(id, role_id)
Remove role from user

Removes a role assignment from the specified user. Requires admin privileges.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |
**role_id** | **uuid::Uuid** | Role UUID | [required] |

### Return type

 (empty response body)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## reset_password

> models::ResetPassword200Response reset_password(id)
Reset user password

Resets the user's password and returns a temporary password. Requires admin privileges.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |

### Return type

[**models::ResetPassword200Response**](resetPassword_200_response.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## update_user

> models::User update_user(id, update_user_request)
Update user

Partially updates a user's profile. Requires admin privileges or ownership of the account.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User UUID | [required] |
**update_user_request** | [**UpdateUserRequest**](UpdateUserRequest.md) |  | [required] |

### Return type

[**models::User**](User.md)

### Authorization

[apiKeyAuth](../README.md#apiKeyAuth), [bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

