api:users
Table of Contents
- 01. Record field format
- 02. Associated attributes
- 03. Index
- 04. Show
- 05. Create
- 06. Update
- 07. Destroy
- 08. See also
- 09. External links
This page has details for how to interact with user records through the API.
01 Record field format
| Name | Type | Details |
|---|---|---|
id | integer | >0 |
name | string | |
level | integer | [10, 20, 30, 31, 32, 35, 37, 40, 50, 60] |
inviter_id | integer | >0 |
post_update_count | integer | |
note_update_count | integer | |
post_upload_count | integer | |
favorite_count | integer | |
unread_dmail_count | integer | |
is_deleted | boolean | |
bit_prefs | integer | Each bit stores a boolean value. See Bit fields below for more information. |
theme | string | [auto, light, dark] |
favorite_tags | string | |
blacklisted_tags | string | |
comment_threshold | integer | |
time_zone | string | |
per_page | integer | 1 - 200 |
default_image_size | string | [large, original] |
custom_style | string | |
upload_points | integer | |
bcrypt_password_hash | integer | |
totp_secret | integer | |
backup_codes | integer | |
last_forum_read_at | timestamp | |
last_logged_in_at | timestamp | |
last_ip_addr | inet | |
created_at | timestamp | |
updated_at | timestamp |
User levels
| Name | Level |
|---|---|
| Anonymous | 0 (Used internally when browsing anonymously) |
| Restricted | 10 |
| Member | 20 |
| Gold | 30 |
| Platinum | 31 |
| Builder | 32 |
| Contributor | 35 |
| Approver | 37 |
| Moderator | 40 |
| Admin | 50 |
| Owner | 60 |
Bit fields
| Name | Type | Bit position |
|---|---|---|
is_banned | status | 0 |
receive_email_notifications | setting | 2 |
new_post_navigation_layout | setting | 5 |
enable_private_favorites | setting | 6 |
show_deleted_children | setting | 11 |
disable_categorized_saved_searches | setting | 15 |
disable_tagged_filenames | setting | 17 |
disable_mobile_gestures | setting | 20 |
enable_safe_mode | setting | 21 |
enable_desktop_mode | setting | 22 |
disable_post_tooltips | setting | 23 |
requires_verification | status | 28 |
is_verified | status | 29 |
show_deleted_posts | setting | 30 |
02 Associated attributes
The following is the list of relations that can be included in the API results (see Help:Common URL parameters for more info):
| Name | Type | Number | Availability | Details |
|---|---|---|---|---|
inviter | user | single | optional | |
bans | ban | multiple | optional |
03 Index
Returns multiple user records.
| HTTP Method | GET |
| Base URL | /users.json |
| Type | read request |
| Description | The default order is created at descending. |
Search attributes
Search parameters take the following format (see Help:Common URL parameters for more info):
search[FIELD]=VALUE
The following are the base fields along with their associated type. Check the syntax pages for all of the available variations.
- Number syntax
idlevelpost_upload_countpost_update_countnote_update_countfavorite_countcreated_atupdated_at- String syntax
name- Boolean syntax
is_deleted- Post syntax
posts- User syntax
inviter- Chaining syntax
commentspost_appealspost_approvalsforum_topicsforum_postsforum_post_votestag_aliasestag_implicationsfeedbackbansartist_versionsartist_commentary_versionsnote_versionswiki_page_versions
Special search parameters
The following are additional search fields.
name_matches- Case-insensitive wildcard search on the name field.any_name_matches- Case-insensitive search on current or previous usernames.name_or_past_name_matches- Case-insensitive search. Returns either the current holder of the name, or previous users if no users currently have that name.min_level- Minimum user level to include.max_level- Maximum user level to include.is_banned- Uses boolean syntax (Help:Boolean syntax).current_user_first- Shows the current user first, then all other users by ID desc.
Search order
Using the search parameter order with one of the following values changes the order of the results.
name- Alphabetical on the name field.post_upload_countpost_update_countnote_count
04 Show
Returns a single user record.
| HTTP Method | GET |
| Base URL | /users/$id.json |
| Type | read request |
| Description | $id is the user ID.Can also be reached by using the /profile endpoint for the current user. |
05 Create
Creates a single user record.
| HTTP Method | POST |
| Base URL | /users.json |
| Type | write request |
Create parameters
User parameters take the following format (see Help:API Write Requests for more info):
user[FIELD]=VALUE
- Required:
namepasswordpassword_confirmation- Optional:
email
06 Update
Updates a single user record.
| HTTP Method | PUT/PATCH |
| Base URL | /users/$id.json |
| Type | write request |
| Description | $id is the user ID. |
Update parameters
- Optional:
comment_thresholddefault_image_sizefavorite_tagsblacklisted_tagstime_zoneper_pagecustom_stylethemereceive_email_notificationsalways_resize_imagesenable_post_navigationnew_post_navigation_layoutenable_private_favoritesenable_sequential_post_navigationshow_deleted_postsstyle_usernamesenable_auto_completeshow_deleted_childrendisable_categorized_saved_searchesdisable_tagged_filenamesdisable_cropped_thumbnailsdisable_mobile_gesturesenable_safe_modeenable_desktop_modedisable_post_tooltips
Restricted to Admins
| HTTP Method | PUT/PATCH |
| Base URL | /admin/users/$id.json |
| Type | write request |
| Description | $id is the user ID. |
- Optional
level
07 Destroy
Deletes a single user record.
| HTTP Method | DELETE |
| Base URL | /users/$id.json |
| Type | write request |
| Description | $id is the user ID. |
Most account users can only delete their own account. Only the Owner-level user can delete any account.
