# \UsersApi All URIs are relative to *https://dev.to/api* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_org_users**](UsersApi.md#get_org_users) | **GET** /api/organizations/{username}/users | Organization's users [**get_user**](UsersApi.md#get_user) | **GET** /api/users/{id} | A User [**get_user_all_articles**](UsersApi.md#get_user_all_articles) | **GET** /api/articles/me/all | User's all articles [**get_user_articles**](UsersApi.md#get_user_articles) | **GET** /api/articles/me | User's articles [**get_user_me**](UsersApi.md#get_user_me) | **GET** /api/users/me | The authenticated user [**get_user_published_articles**](UsersApi.md#get_user_published_articles) | **GET** /api/articles/me/published | User's published articles [**get_user_unpublished_articles**](UsersApi.md#get_user_unpublished_articles) | **GET** /api/articles/me/unpublished | User's unpublished articles [**post_admin_users_create**](UsersApi.md#post_admin_users_create) | **POST** /api/admin/users | Invite a User [**suspend_user**](UsersApi.md#suspend_user) | **PUT** /api/users/{id}/suspend | Suspend a User [**unpublish_user**](UsersApi.md#unpublish_user) | **PUT** /api/users/{id}/unpublish | Unpublish a User's Articles and Comments ## get_org_users > Vec get_org_users(username, page, per_page) Organization's users This endpoint allows the client to retrieve a list of users belonging to the organization It supports pagination, each page will contain `30` users by default. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **username** | **String** | | [required] | **page** | Option<**i32**> | Pagination page | |[default to 1] **per_page** | Option<**i32**> | Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable. | |[default to 30] ### Return type [**Vec**](User.md) ### Authorization No authorization required ### 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 > Vec get_user(id) A User This endpoint allows the client to retrieve a single user, either by id or by the user's username. For complete documentation, see the v0 API docs: https://developers.forem.com/api/v0#tag/users/operation/getUser ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **id** | **String** | | [required] | ### Return type [**Vec**](User.md) ### Authorization [api-key](../README.md#api-key) ### 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_all_articles > Vec get_user_all_articles(page, per_page) User's all articles This endpoint allows the client to retrieve a list of all articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. It will return both published and unpublished articles with pagination. Unpublished articles will be at the top of the list in reverse chronological creation order. Published articles will follow in reverse chronological publication order. By default a page will contain 30 articles. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **page** | Option<**i32**> | Pagination page | |[default to 1] **per_page** | Option<**i32**> | Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable. | |[default to 30] ### Return type [**Vec**](ArticleIndex.md) ### Authorization [api-key](../README.md#api-key) ### 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_articles > Vec get_user_articles(page, per_page) User's articles This endpoint allows the client to retrieve a list of published articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. Published articles will be in reverse chronological publication order. It will return published articles with pagination. By default a page will contain 30 articles. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **page** | Option<**i32**> | Pagination page | |[default to 1] **per_page** | Option<**i32**> | Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable. | |[default to 30] ### Return type [**Vec**](ArticleIndex.md) ### Authorization [api-key](../README.md#api-key) ### 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_me > Vec get_user_me() The authenticated user This endpoint allows the client to retrieve information about the authenticated user ### Parameters This endpoint does not need any parameter. ### Return type [**Vec**](User.md) ### Authorization [api-key](../README.md#api-key) ### 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_published_articles > Vec get_user_published_articles(page, per_page) User's published articles This endpoint allows the client to retrieve a list of published articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. Published articles will be in reverse chronological publication order. It will return published articles with pagination. By default a page will contain 30 articles. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **page** | Option<**i32**> | Pagination page | |[default to 1] **per_page** | Option<**i32**> | Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable. | |[default to 30] ### Return type [**Vec**](ArticleIndex.md) ### Authorization [api-key](../README.md#api-key) ### 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_unpublished_articles > Vec get_user_unpublished_articles(page, per_page) User's unpublished articles This endpoint allows the client to retrieve a list of unpublished articles on behalf of an authenticated user. \"Articles\" are all the posts that users create on DEV that typically show up in the feed. They can be a blog post, a discussion question, a help thread etc. but is referred to as article within the code. Unpublished articles will be in reverse chronological creation order. It will return unpublished articles with pagination. By default a page will contain 30 articles. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **page** | Option<**i32**> | Pagination page | |[default to 1] **per_page** | Option<**i32**> | Page size (the number of items to return per page). The default maximum value can be overridden by \"API_PER_PAGE_MAX\" environment variable. | |[default to 30] ### Return type [**Vec**](ArticleIndex.md) ### Authorization [api-key](../README.md#api-key) ### 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) ## post_admin_users_create > post_admin_users_create(user_invite_param) Invite a User This endpoint allows the client to trigger an invitation to the provided email address. It requires a token from a user with `super_admin` privileges. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **user_invite_param** | Option<[**UserInviteParam**](UserInviteParam.md)> | | | ### Return type (empty response body) ### Authorization [api-key](../README.md#api-key) ### 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) ## suspend_user > suspend_user(id) Suspend a User This endpoint allows the client to suspend a user. The user associated with the API key must have any 'admin' or 'moderator' role. This specified user will be assigned the 'suspended' role. Suspending a user will stop the user from posting new posts and comments. It doesn't delete any of the user's content, just prevents them from creating new content while suspended. Users are not notified of their suspension in the UI, so if you want them to know about this, you must notify them. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **id** | **i32** | The ID of the user to suspend. | [required] | ### Return type (empty response body) ### Authorization [api-key](../README.md#api-key) ### 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) ## unpublish_user > unpublish_user(id) Unpublish a User's Articles and Comments This endpoint allows the client to unpublish all of the articles and comments created by a user. The user associated with the API key must have any 'admin' or 'moderator' role. This specified user's articles and comments will be unpublished and will no longer be visible to the public. They will remain in the database and will set back to draft status on the specified user's dashboard. Any notifications associated with the specified user's articles and comments will be deleted. Note this endpoint unpublishes articles and comments asychronously: it will return a 204 NO CONTENT status code immediately, but the articles and comments will not be unpublished until the request is completed on the server. ### Parameters Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **id** | **i32** | The ID of the user to unpublish. | [required] | ### Return type (empty response body) ### Authorization [api-key](../README.md#api-key) ### 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)