Moekura API version 0.4.0

Read and change a Moekura site: search and upload posts, edit tags, moderate. Responses are JSON; errors look like {"error": {"status": 404, "message": "Not found"}}.

Send an API key (created in your account settings) as Authorization: Bearer <key>. Without one, requests are made as a logged-out visitor and can do what visitors can on the site.

Authentication

Create an API key on your API keys page and send it with every request:

curl -H "Authorization: Bearer mka_…" https://booru.desuwa.moe/api/v1/me

A key acts as you, with your role's permissions; while you're banned it can only read. The machine-readable description of everything below is at /api/v1/openapi.json (OpenAPI 3.1), for generating clients.

Posts

Searching, viewing and changing posts.

GET /posts

Search posts

Uses the same syntax as the site (see the search help). Blacklists aren't applied: clients filter as they like. Needs view_posts.

Parameters

NameInTypeDescription
tagsquerystring

A search, written as in the site's search box (cat -dog rating:g order:score).

pagequerystring

A page number, or a cursor from a previous response's next or previous. Cursors keep working however deep the results go; numbered pages stop at the site's limit.

limitqueryinteger

Posts per page, up to the site's maximum. Defaults to the site's page size.

Responses

200PostPage

OK

400ErrorBody

The search or page isn't valid

401ErrorBody

The site is private: authenticate

POST /posts

Upload a post

Needs upload. The post is pending when the site reviews uploads and you lack upload_without_approval. Thumbnails are made in the background: file.processed turns true when they're ready.

Request body

UploadRequest as multipart/form-data

Responses

201ApiPost

Created

409ErrorBody

The file was already uploaded; post_id names that post

413ErrorBody

The request is larger than the site allows

422ErrorBody

A field or the file isn't acceptable

GET /posts/{id}

Get a post

Needs view_posts. Pending posts are visible to their uploader and to moderators, deleted ones only to moderators.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200ApiPost

OK

404ErrorBody

Not Found

PATCH /posts/{id}

Edit a post

Needs edit_posts. Tag changes are applied to the post's tags as they are when the change is saved, so edits made meanwhile by others are kept. Every change is recorded in the post's history.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

PostChanges as application/json

Responses

200ApiPost

OK

404ErrorBody

Not Found

422ErrorBody

A change isn't acceptable

PUT /posts/{id}/favorite

Favorite a post

Needs favorite. Favoriting twice is harmless.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200Reactions

OK

404ErrorBody

Not Found

DELETE /posts/{id}/favorite

Unfavorite a post

Needs favorite.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200Reactions

OK

404ErrorBody

Not Found

POST /posts/{id}/flags

Flag a post for deletion

Needs flag. Moderators review flags; a post can't have two open flags from the same user.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

NewFlag as application/json

Responses

204

Flagged

400ErrorBody

No reason, or the post can't be flagged now

GET /posts/{id}/versions

List a post's history

Newest first, at most 500 versions. Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200array of ApiVersion

OK

404ErrorBody

Not Found

PUT /posts/{id}/vote

Vote on a post

Needs vote. A new vote replaces your earlier one.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

Vote as application/json

Responses

200Reactions

OK

400ErrorBody

Bad Request

404ErrorBody

Not Found

Tags

Tags, their categories, aliases and implications.

GET /tag-relations

List tag aliases or implications

Newest first, 50 per page. Needs view_posts.

Parameters

NameInTypeDescription
kind requiredqueryone of alias, implication
statusqueryone of pending, active, rejected, deleted
namequerystring

Only relations where either tag starts with this.

pagequeryinteger

1-based.

Responses

200RelationPage

OK

400ErrorBody

Bad Request

POST /tag-relations

Request an alias or implication

Needs edit_posts. Requests wait for someone with manage_tags, whose own requests take effect at once; either way the relation is then applied to existing posts in the background.

Request body

NewRelation as application/json

Responses

201ApiRelation

Created

422ErrorBody

The tags aren't valid, or the relation would conflict with others

GET /tags

List tags

50 per page. Needs view_posts.

Parameters

NameInTypeDescription
namequerystring

A name prefix, or a pattern with * wildcards.

categoryquerystring

Only tags in this category (artist, …).

orderqueryone of count, name, newest
pagequeryinteger

1-based.

Responses

200TagPage

OK

400ErrorBody

Bad Request

GET /tags/autocomplete

Suggest tags

Up to 10 used tags for a prefix, most used first, including tags an alias matching the prefix points to, and similarly spelled tags when few match. Needs view_posts.

Parameters

NameInTypeDescription
qquerystring

What has been typed of the tag so far.

Responses

200array of Suggestion

OK

401ErrorBody

The site is private: authenticate

GET /tags/{name}

Get a tag

Needs view_posts.

Parameters

NameInTypeDescription
name requiredpathstring

The tag's name

Responses

200ApiTag

OK

404ErrorBody

Not Found

PATCH /tags/{name}

Edit a tag

Needs manage_tags. The change is recorded in the moderation log.

Parameters

NameInTypeDescription
name requiredpathstring

The tag's name

Request body

TagChanges as application/json

Responses

200ApiTag

OK

404ErrorBody

Not Found

422ErrorBody

There is no such category

Users

Users and the account making the request.

GET /favorite-groups

List a user's favorite groups

Their public groups by name, or all of yours. Needs view_posts.

Parameters

NameInTypeDescription
userquerystring

Whose groups (a name); yours when left out.

Responses

200array of ApiFavoriteGroup

OK

404ErrorBody

Not Found

POST /favorite-groups

Create a favorite group

Needs favorite; at most 100 each.

Request body

GroupInput as application/json

Responses

201ApiFavoriteGroupWithPosts

Created

422ErrorBody

Unprocessable Entity

GET /favorite-groups/{id}

Get a favorite group

Public groups, and your own private ones. Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Group number

Responses

PUT /favorite-groups/{id}

Change your favorite group

Fields left out stay as they are.

Parameters

NameInTypeDescription
id requiredpathinteger

Group number

Request body

GroupInput as application/json

Responses

200ApiFavoriteGroupWithPosts

OK

403ErrorBody

Forbidden

422ErrorBody

Unprocessable Entity

DELETE /favorite-groups/{id}

Delete your favorite group

Parameters

NameInTypeDescription
id requiredpathinteger

Group number

Responses

204

No Content

403ErrorBody

Forbidden

404ErrorBody

Not Found

POST /favorite-groups/{id}/posts

Add a post to the end of your favorite group

Adding a post that's already there changes nothing.

Parameters

NameInTypeDescription
id requiredpathinteger

Group number

Request body

GroupPost as application/json

Responses

DELETE /favorite-groups/{id}/posts/{post_id}

Take a post out of your favorite group

Parameters

NameInTypeDescription
id requiredpathinteger

Group number

post_id requiredpathinteger

Post number

Responses

204

No Content

404ErrorBody

Not Found

GET /me

Get your account

Needs authentication.

Responses

200ApiMe

OK

401ErrorBody

Unauthorized

GET /saved-searches

Your saved searches

By query. Search them together with search:all or search:<label>.

Responses

200array of ApiSavedSearch

OK

401ErrorBody

Unauthorized

GET /users/{name}

Get a user

Needs view_posts. Only users who can manage users see inactive accounts.

Parameters

NameInTypeDescription
name requiredpathstring

Case-insensitive

Responses

200ApiUser

OK

404ErrorBody

Not Found

Wiki

Wiki pages about tags, and their history.

GET /wiki-pages

List wiki pages

Most recently changed first, 50 per page. Needs view_posts.

Parameters

NameInTypeDescription
titlequerystring

A title prefix, or a pattern with * wildcards.

pagequeryinteger

1-based.

Responses

200WikiPageList

OK

400ErrorBody

Bad Request

GET /wiki-pages/{title}

Get a wiki page

Needs view_posts.

Parameters

NameInTypeDescription
title requiredpathstring

The tag name the page is about

Responses

200ApiWikiPage

OK

404ErrorBody

Not Found

PUT /wiki-pages/{title}

Create or change a wiki page

Needs edit_wiki. Saving the text the page already has changes nothing.

Parameters

NameInTypeDescription
title requiredpathstring

The tag name the page is about

Request body

WikiChanges as application/json

Responses

200ApiWikiPage

OK

409ErrorBody

The page changed since base_version

422ErrorBody

The title isn't a valid tag name, or the text is empty or too long

GET /wiki-pages/{title}/versions

A wiki page's history

Every version's text, newest first (at most 500). Needs view_posts.

Parameters

NameInTypeDescription
title requiredpathstring

The tag name the page is about

Responses

200array of ApiWikiVersion

OK

404ErrorBody

Not Found

Comments

Comments on posts, their votes and reports.

GET /comments

List comments

Newest first, 50 at a time, on posts you can see. Needs view_posts.

Parameters

NameInTypeDescription
post_idqueryinteger

Only comments on this post.

userquerystring

Only comments by this user (a name).

beforequeryinteger

Only comments older than this one, for the next page.

Responses

200CommentList

OK

404ErrorBody

No such user

GET /comments/{id}

Get a comment

Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Responses

200ApiComment

OK

404ErrorBody

Not Found

PUT /comments/{id}

Change your comment

Needs comment; only the author changes a comment.

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Request body

CommentText as application/json

Responses

200ApiComment

OK

403ErrorBody

Forbidden

422ErrorBody

Unprocessable Entity

DELETE /comments/{id}

Delete your comment

Needs comment; only the author deletes a comment this way (staff hide it instead).

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Responses

204

No Content

403ErrorBody

Forbidden

404ErrorBody

Not Found

POST /comments/{id}/report

Report a comment

Needs flag. Staff find reported comments under Moderation.

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Request body

Reason as application/json

Responses

204

No Content

400ErrorBody

No reason, or already reported

PUT /comments/{id}/vote

Vote on a comment

Needs vote; not on your own comments.

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Request body

CommentVote as application/json

Responses

200CommentScore

OK

404ErrorBody

Not Found

422ErrorBody

Unprocessable Entity

POST /posts/{id}/comments

Comment on a post

Needs comment. Rate limited; deleted posts can't be commented on.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

CommentText as application/json

Responses

201ApiComment

Created

404ErrorBody

Not Found

422ErrorBody

The text is empty or too long, or the post is deleted

429ErrorBody

Too Many Requests

Pools

Ordered collections of posts, and their history.

GET /pools

List pools

Most recently changed first, 50 per page. Needs view_posts.

Parameters

NameInTypeDescription
namequerystring

A name prefix, or a pattern with * wildcards.

categoryquerystring

series or collection.

pagequeryinteger

1-based.

Responses

200PoolList

OK

400ErrorBody

Bad Request

POST /pools

Create a pool

Needs edit_pools.

Request body

NewPool as application/json

Responses

201ApiPoolWithPosts

Created

422ErrorBody

A bad or taken name, or posts that don't exist

GET /pools/{id}

Get a pool

Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Pool number

Responses

200ApiPoolWithPosts

OK

404ErrorBody

Not Found

PUT /pools/{id}

Change a pool

Needs edit_pools. Fields left out stay as they are.

Parameters

NameInTypeDescription
id requiredpathinteger

Pool number

Request body

PoolChanges as application/json

Responses

200ApiPoolWithPosts

OK

409ErrorBody

The pool changed since base_version

422ErrorBody

Unprocessable Entity

DELETE /pools/{id}

Delete a pool

Needs delete_posts; logged. It can be restored.

Parameters

NameInTypeDescription
id requiredpathinteger

Pool number

Responses

204

No Content

404ErrorBody

Not Found

POST /pools/{id}/posts

Add a post to the end of a pool

Needs edit_pools.

Parameters

NameInTypeDescription
id requiredpathinteger

Pool number

Request body

PoolPost as application/json

Responses

200ApiPoolWithPosts

OK

422ErrorBody

Already in the pool, deleted, or the pool is full

POST /pools/{id}/restore

Restore a deleted pool

Needs delete_posts; logged.

Parameters

NameInTypeDescription
id requiredpathinteger

Pool number

Responses

204

No Content

404ErrorBody

Not Found

GET /pools/{id}/versions

A pool's history

Every version, newest first (at most 500). Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Pool number

Responses

200array of ApiPoolVersion

OK

404ErrorBody

Not Found

Notes

Notes (translations) on posts' images, and their history.

GET /notes/{id}

Get a note

Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Note number

Responses

200ApiNote

OK

404ErrorBody

Not Found

PUT /notes/{id}

Change a note

Needs edit_notes. Fields left out stay as they are.

Parameters

NameInTypeDescription
id requiredpathinteger

Note number

Request body

NoteChanges as application/json

Responses

200ApiNote

OK

409ErrorBody

The note changed since base_version

422ErrorBody

Unprocessable Entity

DELETE /notes/{id}

Delete a note

Needs edit_notes. It stays in the history and can be restored.

Parameters

NameInTypeDescription
id requiredpathinteger

Note number

base_versionqueryinteger

Refuse with 409 if the note changed since this version.

Responses

204

No Content

404ErrorBody

Not Found

409ErrorBody

Conflict

GET /notes/{id}/versions

A note's history

Every version, newest first (at most 500). Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Note number

Responses

200array of ApiNoteVersion

OK

404ErrorBody

Not Found

GET /posts/{id}/notes

A post's notes

Oldest first. Needs view_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

include_deletedqueryboolean

Deleted notes too (for those who may edit notes).

Responses

200array of ApiNote

OK

404ErrorBody

Not Found

POST /posts/{id}/notes

Add a note to a post

Needs edit_notes. Not on deleted posts; at most 500 per post.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

NewNote as application/json

Responses

201ApiNote

Created

404ErrorBody

Not Found

422ErrorBody

Empty text, or a box outside the image

Moderation

Reviewing posts and flags, deciding tag relations, bans and the moderation log.

GET /bans

List active bans

Needs ban_users.

Responses

200BanList

OK

403ErrorBody

You can't ban users

POST /comments/{id}/hide

Hide a comment

Needs moderate_comments. Upholds the comment's open reports; logged.

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Request body

Reason as application/json

Responses

200ApiComment

OK

400ErrorBody

Already hidden

POST /comments/{id}/restore

Restore a hidden or deleted comment

Needs moderate_comments; logged.

Parameters

NameInTypeDescription
id requiredpathinteger

Comment number

Responses

200ApiComment

OK

400ErrorBody

Not hidden

GET /flags

List open flags

Needs approve_posts. The posts whose flags have waited longest, by post number, each with its open flags.

Parameters

NameInTypeDescription
limitqueryinteger

Posts to return, up to 100.

Responses

200array of FlaggedPost

OK

403ErrorBody

You can't review flags

GET /moderation/log

Read the moderation log

Needs view_audit_log.

Parameters

NameInTypeDescription
actionquerystring

Only this kind of action (post.delete, user.ban, …).

actorquerystring

Only actions by this user.

post_idqueryinteger

Only actions on this post.

userquerystring

Only actions on this user.

beforequeryinteger

Entries older than this id: a previous page's next_before.

Responses

200LogPage

OK

400ErrorBody

Bad Request

POST /network-bans

Ban a network

Needs ban_users. Requests from the network can read but not change anything, and it can't register or log in.

Request body

NewNetworkBan as application/json

Responses

201ApiNetworkBan

Created

400ErrorBody

The range isn't valid, is too wide, or includes your address

DELETE /network-bans/{id}

Lift a network ban

Needs ban_users.

Parameters

NameInTypeDescription
id requiredpathinteger

Network ban id

Responses

204

Lifted

404ErrorBody

Not Found

POST /posts/{id}/approve

Approve a pending post

Needs approve_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200ApiPost

OK

400ErrorBody

The post isn't pending

POST /posts/{id}/delete

Delete a post

Needs delete_posts. Deleted posts stay visible to moderators and can be restored; open flags on the post are upheld.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

Reason as application/json

Responses

200ApiPost

OK

400ErrorBody

The post is already deleted

POST /posts/{id}/flags/dismiss

Dismiss a post's flags

Needs approve_posts. The post stays, and is no longer flagged.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200Dismissed

OK

400ErrorBody

The post has no open flags

POST /posts/{id}/purge

Purge a deleted post

Needs purge_posts. The post, its files and its history are removed for good by a background job shortly after.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

202

The purge is queued

400ErrorBody

Only deleted posts can be purged

POST /posts/{id}/reject

Reject a pending post

Needs approve_posts. The post is deleted.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Request body

Reason as application/json

Responses

200ApiPost

OK

400ErrorBody

The post isn't pending

POST /posts/{id}/restore

Restore a deleted post

Needs delete_posts.

Parameters

NameInTypeDescription
id requiredpathinteger

Post number

Responses

200ApiPost

OK

400ErrorBody

The post isn't deleted

DELETE /tag-relations/{id}

Remove a tag relation

Ends an active relation (needs manage_tags; posts keep their tags), or withdraws a pending request (its creator may too).

Parameters

NameInTypeDescription
id requiredpathinteger

Relation id

Responses

200ApiRelation

OK

403ErrorBody

Forbidden

POST /tag-relations/{id}/approve

Approve a tag relation

Needs manage_tags. It's then applied to existing posts in the background.

Parameters

NameInTypeDescription
id requiredpathinteger

Relation id

Responses

200ApiRelation

OK

422ErrorBody

It isn't pending, or it conflicts with active relations

POST /tag-relations/{id}/reject

Reject a tag relation

Needs manage_tags.

Parameters

NameInTypeDescription
id requiredpathinteger

Relation id

Responses

200ApiRelation

OK

422ErrorBody

It isn't pending

POST /users/{name}/ban

Ban a user

Needs ban_users and a role ranked above the user's. Banned users can look around as visitors do, but can't change anything.

Parameters

NameInTypeDescription
name requiredpathstring

Case-insensitive

Request body

NewBan as application/json

Responses

204

Banned

403ErrorBody

You can't ban this user

DELETE /users/{name}/ban

Lift a user's ban

Needs ban_users and a role ranked above the user's.

Parameters

NameInTypeDescription
name requiredpathstring

Case-insensitive

Responses

204

Lifted

400ErrorBody

The user isn't banned

Schemas

ApiActiveBan

FieldTypeDescription
reason requiredstring
expires_atdate-time string or null

null for a permanent ban.

ApiBan

FieldTypeDescription
id requiredinteger
user requiredstring
reason requiredstring
bannerstring or null
created_at requireddate-time string
expires_atdate-time string or null

null until lifted.

ApiComment

FieldTypeDescription
id requiredinteger
post_id requiredinteger
creatorstring or null

The author's name, unless their account is gone.

body requiredstring

The text, in the site's wiki markup.

html requiredstring

body as HTML, the way the site shows it.

score requiredinteger
is_deleted requiredboolean

Only staff see deleted comments.

created_at requireddate-time string
edited_atdate-time string or null

ApiCount

How many posts match. Large counts are estimated.

FieldTypeDescription
value requiredinteger
accuracy requiredstring

exact, about (an estimate) or at_least (counting stopped).

ApiFavoriteGroup

FieldTypeDescription
id requiredinteger
creator requiredstring
name requiredstring

Spaces are underscores.

is_public requiredboolean
post_count requiredinteger

All its posts, including those you can't see.

created_at requireddate-time string
updated_at requireddate-time string

ApiFavoriteGroupWithPosts

any

ApiFile

The original file.

FieldTypeDescription
url requiredstring

On private sites this link expires after an hour or two.

media_type requiredstring

jpeg, png, gif, webp, avif, jxl, mp4 or webm.

width requiredinteger
height requiredinteger
size requiredinteger

In bytes.

duration_msinteger or null
frames requiredinteger

More than 1 for animations.

has_audio requiredboolean
sha256 requiredstring

Hex.

md5 requiredstring

Hex.

processed requiredboolean

Whether thumbnails and the perceptual hash are done.

ApiFlag

FieldTypeDescription
creatorstring or null
reason requiredstring
created_at requireddate-time string

ApiMe

The account making the request.

FieldTypeDescription
name requiredstring
role requiredstring
permissions requiredarray of string

What this account may do now (upload, edit_posts, …). While banned, only what visitors may.

settings requiredApiSettings
banApiActiveBan or null

Set while banned.

uploads requiredApiUploadAllowance

ApiNetworkBan

FieldTypeDescription
id requiredinteger
network requiredstring

A CIDR range.

reason requiredstring
bannerstring or null
created_at requireddate-time string
expires_atdate-time string or null

ApiNote

FieldTypeDescription
id requiredinteger
post_id requiredinteger
x requiredinteger

The box, in the original image's pixels.

y requiredinteger
width requiredinteger
height requiredinteger
body requiredstring

In the site's wiki markup.

html requiredstring

body as HTML.

is_active requiredboolean

False once deleted.

version requiredinteger

Counts up with every change; send it back when changing the note.

updaterstring or null
created_at requireddate-time string
updated_at requireddate-time string

ApiNoteVersion

FieldTypeDescription
note_id requiredinteger
post_id requiredinteger
version requiredinteger
updaterstring or null
x requiredinteger
y requiredinteger
width requiredinteger
height requiredinteger
body requiredstring
is_active requiredboolean
created_at requireddate-time string

ApiPool

FieldTypeDescription
id requiredinteger
name requiredstring

Spaces are underscores.

description requiredstring

In the site's wiki markup.

category requiredstring

series or collection.

is_deleted requiredboolean
version requiredinteger

Counts up with every change; send it back when saving.

updaterstring or null
post_count requiredinteger

All its posts, including those you can't see.

created_at requireddate-time string
updated_at requireddate-time string

ApiPoolVersion

FieldTypeDescription
version requiredinteger
updaterstring or null
name requiredstring
description requiredstring
category requiredstring
is_deleted requiredboolean
post_ids requiredarray of integer
created_at requireddate-time string

ApiPoolWithPosts

any

ApiPost

A post with its tags and files.

FieldTypeDescription
id requiredinteger
rating requiredstring

g (general), s (sensitive), q (questionable) or e (explicit).

status requiredstring

active, pending (awaiting approval), flagged or deleted.

source requiredstring
description requiredstring
parent_idinteger or null
score requiredinteger
fav_count requiredinteger
comment_count requiredinteger

Comments that aren't deleted.

last_commented_atdate-time string or null

When the newest of those was written.

note_count requiredinteger

Notes that aren't deleted.

last_noted_atdate-time string or null

When a note was last changed.

uploaderstring or null

The uploader's name, unless their account is gone.

created_at requireddate-time string
tags requiredarray of PostTag

Sorted by name.

file requiredApiFile
variants requiredarray of ApiVariant

Smaller renditions (thumb-<size>, sample, poster for videos), once processing has made them.

ApiRelation

FieldTypeDescription
id requiredinteger
kind requiredstring

alias or implication.

antecedent requiredstring
consequent requiredstring
status requiredstring

pending, active, rejected or deleted.

reason requiredstring

Why it was requested.

creatorstring or null
approverstring or null
created_at requireddate-time string
updated_at requireddate-time string

ApiSavedSearch

FieldTypeDescription
id requiredinteger
query requiredstring

Normalised.

labels requiredarray of string
created_at requireddate-time string

ApiSettings

FieldTypeDescription
per_pageinteger or null

Posts per page on the site; null for the site's default.

theme requiredstring

system, light or dark.

blacklist requiredstring

The blacklist in effect: the account's own, or the site's default.

ApiTag

FieldTypeDescription
id requiredinteger
name requiredstring
category requiredstring
post_count requiredinteger
deprecated requiredboolean

Deprecated tags can't be added to posts.

created_at requireddate-time string

ApiUploadAllowance

How many more posts the account may upload now.

FieldTypeDescription
refusedstring or null

Why uploading is refused now, if it is.

pending_leftinteger or null

Uploads left before the approval queue's limit; null if none applies.

today_leftinteger or null

Uploads left today; null if there's no daily limit.

ApiUser

FieldTypeDescription
name requiredstring
rolestring or null
status requiredstring

active, pending (awaiting approval) or deactivated.

created_at requireddate-time string
uploads requiredinteger
favorites requiredinteger

ApiVariant

FieldTypeDescription
kind requiredstring
url requiredstring
format requiredstring
width requiredinteger
height requiredinteger
size requiredinteger

ApiVersion

One version of a post.

FieldTypeDescription
version requiredinteger

1 for the upload, counting up.

updaterstring or null

Who made the change.

relationVersionRelation or null

Set when a tag alias or implication made the change.

tags requiredarray of string

All tags after the change, sorted.

added requiredarray of string
removed requiredarray of string
rating requiredstring
source requiredstring
description requiredstring
parent_idinteger or null
created_at requireddate-time string

ApiWikiPage

FieldTypeDescription
title requiredstring

The tag name the page is about.

body requiredstring

The page's text, in the site's wiki markup.

html requiredstring

body as HTML, the way the site shows it.

version requiredinteger

Counts up with every change; send it back when saving.

updaterstring or null

Who made the latest change.

created_at requireddate-time string
updated_at requireddate-time string

ApiWikiSummary

FieldTypeDescription
title requiredstring
version requiredinteger
updaterstring or null
updated_at requireddate-time string

ApiWikiVersion

FieldTypeDescription
version requiredinteger
updaterstring or null
body requiredstring
created_at requireddate-time string

BanList

FieldTypeDescription
users requiredarray of ApiBan

Active user bans, newest first (at most 200).

networks requiredarray of ApiNetworkBan

Active network bans.

CommentList

FieldTypeDescription
comments requiredarray of ApiComment

Newest first.

next_beforeinteger or null

before for the next page; absent on the last one.

CommentScore

A comment's score and the viewer's vote.

FieldTypeDescription
score requiredinteger
vote requiredinteger

Your vote: 1, -1, or 0 for none.

CommentText

FieldTypeDescription
body requiredstring

In the site's wiki markup; at most 10,000 characters.

CommentVote

FieldTypeDescription
score requiredinteger

1, -1, or 0 to take your vote back.

Dismissed

FieldTypeDescription
dismissed requiredinteger

How many open flags were dismissed.

ErrorBody

The API's error body.

FieldTypeDescription
error requiredErrorDetail

ErrorDetail

FieldTypeDescription
status requiredinteger

The HTTP status code again.

message requiredstring

What went wrong, for people.

post_idinteger or null

For a duplicate upload, the post that already has the file.

FlaggedPost

FieldTypeDescription
post_id requiredinteger
flags requiredarray of ApiFlag

GroupInput

FieldTypeDescription
namestring or null
is_publicboolean or null

Public (the default) or private.

post_idsarray of integer or null

All of its posts, in order.

GroupPost

FieldTypeDescription
post_id requiredinteger

LogEntry

FieldTypeDescription
id requiredinteger
actorstring or null

Who did it; null for the command line.

action requiredstring
post_idinteger or null
userstring or null

The user acted on.

reason requiredstring
details requiredobject

Anything else recorded, depending on the action.

created_at requireddate-time string

LogPage

FieldTypeDescription
entries requiredarray of LogEntry

Newest first, 50 per page.

next_beforeinteger or null

before for the next page; absent on the last one.

NewBan

FieldTypeDescription
reason requiredstring

Shown to the user while banned.

daysinteger or null

How long, in days; leave out for until lifted.

NewFlag

FieldTypeDescription
reason requiredstring

Why the post should be deleted.

NewNetworkBan

FieldTypeDescription
network requiredstring

An address, or a range like 203.0.113.0/24. It may not include your own address.

reason requiredstring
daysinteger or null

How long, in days; leave out for until lifted.

NewNote

FieldTypeDescription
x requiredinteger

The box, in the original image's pixels; trimmed to the image.

y requiredinteger
width requiredinteger
height requiredinteger
body requiredstring

In the site's wiki markup; at most 10,000 characters.

NewPool

FieldTypeDescription
name requiredstring
descriptionstring
categorystring or null

series (the default) or collection.

post_idsarray of integer

In order.

NewRelation

FieldTypeDescription
kind requiredone of alias, implication
antecedent requiredstring

The tag that's aliased, or that implies the other.

consequent requiredstring

The tag it's aliased to, or that it implies.

reasonstring

Why, for whoever reviews the request.

NoteChanges

FieldTypeDescription
xinteger or null

A new box: all four or none.

yinteger or null
widthinteger or null
heightinteger or null
bodystring or null
is_activeboolean or null

false deletes the note, true restores it.

base_versioninteger or null

The version the changes were based on. If someone has changed the note since, the change is refused with 409. Leave it out to change whatever is there.

PoolChanges

FieldTypeDescription
namestring or null
descriptionstring or null
categorystring or null
post_idsarray of integer or null

All of the pool's posts, in order.

base_versioninteger or null

The version the changes were based on. If someone has changed the pool since, the save is refused with 409. Leave it out to save over whatever is there.

PoolList

FieldTypeDescription
pools requiredarray of ApiPool
next_pageinteger or null

page for the next page; absent on the last one.

PoolPost

FieldTypeDescription
post_id requiredinteger

PostChanges

Changes to a post. Fields left out stay as they are.

FieldTypeDescription
ratingstring or null

g, s, q or e.

sourcestring or null
descriptionstring or null
parent_idinteger or null

Another post's number, or null for none.

tagsarray of string or null

The complete new list of tags. A category prefix (artist:name) sets the category of a tag that's new. Can't be combined with add_tags or remove_tags.

add_tagsarray of string

Tags to add, keeping the others.

remove_tagsarray of string

Tags to take off, keeping the others.

PostPage

A page of search results.

FieldTypeDescription
posts requiredarray of ApiPost
count requiredApiCount
nextstring or null

page for the next page; absent on the last one.

previousstring or null

page for the previous page; absent on the first one.

PostTag

FieldTypeDescription
name requiredstring
category requiredstring

general, artist, copyright, character, meta, or a category the site added.

Reactions

A post's counts and the viewer's part in them.

FieldTypeDescription
fav_count requiredinteger
favorited requiredboolean

Whether you have favorited the post.

score requiredinteger
vote requiredinteger

Your vote: 1, -1, or 0 for none.

Reason

FieldTypeDescription
reasonstring

Shown on the post and in the moderation log.

RelationPage

FieldTypeDescription
relations requiredarray of ApiRelation
next_pageinteger or null

page for the next page; absent on the last one.

SavedSearchInput

FieldTypeDescription
query requiredstring
labelsarray of string

Letters, digits, _ and -; at most 10.

Suggestion

A tag suggested for what was typed so far.

FieldTypeDescription
name requiredstring
category requiredstring
post_count requiredinteger
antecedentstring or null

The alias that matched, when name is its target.

TagChanges

Changes to a tag. Fields left out stay as they are.

FieldTypeDescription
categorystring or null

The category's name (general, artist, …).

deprecatedboolean or null

Deprecated tags can't be added to posts.

TagPage

FieldTypeDescription
tags requiredarray of ApiTag
next_pageinteger or null

page for the next page; absent on the last one.

UploadRequest

The fields of an upload, for the description only: the handler reads the multipart body as the upload form does.

FieldTypeDescription
filefile or null

The file. Send either this or url.

urlstring or null

A link to download the file from, instead of sending it. It also becomes the source when none is given.

rating requiredstring

g, s, q or e.

tagsstring or null

Whitespace-separated. A category prefix (artist:name) sets the category of a tag that's new.

sourcestring or null
descriptionstring or null

VersionRelation

FieldTypeDescription
kind requiredstring

alias or implication.

antecedentstring or null
consequentstring or null

Vote

FieldTypeDescription
score requiredinteger

1 (up), -1 (down), or 0 to take your vote back.

WikiChanges

FieldTypeDescription
body requiredstring

The new text, in the site's wiki markup.

base_versioninteger or null

The version the text was based on, 0 for a new page. If someone has changed the page since, the save is refused with 409. Leave it out to save over whatever is there.

WikiPageList

FieldTypeDescription
pages requiredarray of ApiWikiSummary
next_pageinteger or null

page for the next page; absent on the last one.