# \UsersApi

All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**assign_role**](UsersApi.md#assign_role) | **POST** /api/v1/users/{id}/roles | Assign role to user
[**change_current_user_password**](UsersApi.md#change_current_user_password) | **POST** /api/v1/users/me/password | Change the authenticated caller's own password.
[**change_password**](UsersApi.md#change_password) | **POST** /api/v1/users/{id}/password | Change user password
[**create_current_user_api_token**](UsersApi.md#create_current_user_api_token) | **POST** /api/v1/users/me/tokens | Create an API token for the authenticated caller.
[**create_user**](UsersApi.md#create_user) | **POST** /api/v1/users | Create user
[**create_user_api_token**](UsersApi.md#create_user_api_token) | **POST** /api/v1/users/{id}/tokens | Create API token
[**delete_user**](UsersApi.md#delete_user) | **DELETE** /api/v1/users/{id} | Delete user
[**force_password_change**](UsersApi.md#force_password_change) | **POST** /api/v1/users/{id}/force-password-change | Force a user to change their password on next login (admin only). Sets must_change_password=true and invalidates existing sessions so the user is prompted immediately on their next login.
[**get_current_user_record**](UsersApi.md#get_current_user_record) | **GET** /api/v1/users/me | Get the authenticated caller's own user record.
[**get_user**](UsersApi.md#get_user) | **GET** /api/v1/users/{id} | Get user details
[**get_user_roles**](UsersApi.md#get_user_roles) | **GET** /api/v1/users/{id}/roles | Get user roles
[**list_current_user_tokens**](UsersApi.md#list_current_user_tokens) | **GET** /api/v1/users/me/tokens | List the authenticated caller's own API tokens.
[**list_user_tokens**](UsersApi.md#list_user_tokens) | **GET** /api/v1/users/{id}/tokens | List user's API tokens
[**list_users**](UsersApi.md#list_users) | **GET** /api/v1/users | List users
[**reset_password**](UsersApi.md#reset_password) | **POST** /api/v1/users/{id}/password/reset | Reset user password (admin only) Generates a new temporary password and sets must_change_password=true
[**revoke_current_user_api_token**](UsersApi.md#revoke_current_user_api_token) | **DELETE** /api/v1/users/me/tokens/{token_id} | Revoke one of the authenticated caller's own API tokens.
[**revoke_role**](UsersApi.md#revoke_role) | **DELETE** /api/v1/users/{id}/roles/{role_id} | Revoke role from user
[**revoke_user_api_token**](UsersApi.md#revoke_user_api_token) | **DELETE** /api/v1/users/{id}/tokens/{token_id} | Revoke API token
[**update_user**](UsersApi.md#update_user) | **PATCH** /api/v1/users/{id} | Update user



## assign_role

> assign_role(id, assign_role_request)
Assign role to user

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User ID | [required] |
**assign_role_request** | [**AssignRoleRequest**](AssignRoleRequest.md) |  | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

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

[[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_current_user_password

> change_current_user_password(change_password_request)
Change the authenticated caller's own password.

Resolves the subject to `auth.user_id`, so the shared `change_password_inner` requires the current password (non-admin self path) exactly as `POST /users/:id/password` does. Registered in `self_password_router` so it inherits the password-change rate limit (#1026).

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**change_password_request** | [**ChangePasswordRequest**](ChangePasswordRequest.md) |  | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

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

[[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 user password

### Parameters


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

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

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

[[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_current_user_api_token

> models::ApiTokenCreatedResponse create_current_user_api_token(create_user_api_token_request)
Create an API token for the authenticated caller.

The #1315 admin-only-scope enforcement is applied inside `create_api_token_inner`, so a non-admin cannot mint `*`/`admin`/`delete:*`/ `write:users` tokens via this alias any more than via `/users/:id/tokens`.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**create_user_api_token_request** | [**CreateUserApiTokenRequest**](CreateUserApiTokenRequest.md) |  | [required] |

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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::CreateUserResponse create_user(create_user_request)
Create user

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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_api_token

> models::ApiTokenCreatedResponse create_user_api_token(id, create_user_api_token_request)
Create API token

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User ID | [required] |
**create_user_api_token_request** | [**CreateUserApiTokenRequest**](CreateUserApiTokenRequest.md) |  | [required] |

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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

### Parameters


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

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)


## force_password_change

> models::ForcePasswordChangeResponse force_password_change(id)
Force a user to change their password on next login (admin only). Sets must_change_password=true and invalidates existing sessions so the user is prompted immediately on their next login.

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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_current_user_record

> models::AdminUserResponse get_current_user_record()
Get the authenticated caller's own user record.

### Parameters

This endpoint does not need any parameter.

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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::AdminUserResponse get_user(id)
Get user details

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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_roles

> models::RoleListResponse get_user_roles(id)
Get user roles

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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_current_user_tokens

> models::ApiTokenListResponse list_current_user_tokens()
List the authenticated caller's own API tokens.

### Parameters

This endpoint does not need any parameter.

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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

> models::ApiTokenListResponse list_user_tokens(id)
List user's API tokens

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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::UserListResponse list_users(search, is_active, is_admin, page, per_page)
List users

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**search** | Option<**String**> |  |  |
**is_active** | Option<**bool**> |  |  |
**is_admin** | Option<**bool**> |  |  |
**page** | Option<**i32**> |  |  |
**per_page** | Option<**i32**> |  |  |

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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::ResetPasswordResponse reset_password(id)
Reset user password (admin only) Generates a new temporary password and sets must_change_password=true

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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)


## revoke_current_user_api_token

> revoke_current_user_api_token(token_id)
Revoke one of the authenticated caller's own API tokens.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**token_id** | **uuid::Uuid** | API token ID | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)


## revoke_role

> revoke_role(id, role_id)
Revoke role from user

### Parameters


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

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)


## revoke_user_api_token

> revoke_user_api_token(id, token_id)
Revoke API token

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | User ID | [required] |
**token_id** | **uuid::Uuid** | API token ID | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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::AdminUserResponse update_user(id, update_user_request)
Update user

### Parameters


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

### Return type

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

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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)

