List, search, and manage files over HTTP
Use your instance's API reference at /api/docs or its OpenAPI document at /api/docs/json for request and response schemas. See API keys for authentication.
List and search files
GET /api/v1/files defaults to scope=personal. Use scope=all with canManageFiles to list every file, or scope=uploader&uploaderUuid=<uuid> with canManageUsers to list one uploader's files. The uploader response includes the selected user. In v7, these scopes replace the admin=true query parameter and the GET /api/v1/users/:uuid/files route.
Set sort to newest, oldest, name-asc, name-desc, largest, or smallest to sort before pagination. The default is newest. The optional ip parameter filters within the selected scope. Filtering one uploader's files by IP also requires canManageFiles.
POST /api/v1/search accepts {"scope":{"kind":"all"}} or {"scope":{"kind":"uploader","uploaderUuid":"<uuid>"}} in the JSON body, with the same permission requirements as the file list. Omit scope to search your own files. Search applies filename, type, upload date, IP filters, and sorting before pagination. The count field reports the total matching files.
Use {"ip":"192.0.2.1"} to search your own uploads by IP, or combine ip with scope. In a shared folder, a user who lacks canManageFiles can search by IP among their own uploads. Searching one uploader by IP requires both canManageUsers and canManageFiles. Searching all files by IP requires canManageFiles.
Record where a file came from
Send source fields as multipart text fields to POST /api/v1/upload or as JSON properties to POST /api/v1/upload-sessions. Resumable sessions retain the fields through completion. The MCP upload tool accepts the same fields. Bulk upload omits source metadata.
const body = new FormData();
body.append('source', 'https://www.pixiv.net/artworks/123456');
body.append('sourceCreator', 'Artist name');
body.append('file', file, filename);
| Field | Accepted value |
|---|---|
source | URL, artist name, archive reference, or other text up to 2,048 characters. Prefer the original post or artwork permalink when available. |
sourceCreator | Creator or artist name up to 200 characters. |
sourceCreatorUrl | HTTP or HTTPS creator profile URL up to 2,048 characters. |
sourceTitle | Original post or artwork title up to 500 characters. |
sourceNotes | Plain text up to 4,000 characters. |
sourcePublishedDate | Original publication date as YYYY-MM-DD, with no time or timezone. The upload date is independent. |
All fields are optional. The API trims inputs and stores a blank or omitted value as null on a new file. The owner can update fields with PATCH /api/v1/files/:uuid. Send null or a blank value to clear a field and omit it to leave it unchanged. Public shares omit source metadata, including on folder covers. The server stores the supplied references without fetching them or inferring any source details.
Re-uploading a file as its authenticated owner fills missing source fields and preserves existing values. Anonymous duplicate uploads leave the metadata unchanged. When upgrading a source checkout, apply database migrations before starting the API. Existing source references stay intact and newly added fields start empty.
MCP clients can use files_update_source with the files:write scope to update existing files. Uploading metadata with a new file uses files:upload. Read source fields through files_get or the file list and search tools.
Search by source or creator
Send filters in POST /api/v1/search, or use the same fields with the MCP files_search tool.
{
"source": { "kind": "contains", "value": "artist" },
"sourceDomain": "example.com",
"sourceCreator": { "kind": "exact", "value": "Artist name" }
}
sourcesupports a case-insensitivecontainsmatch or a case-sensitiveexactmatch of the whole stored reference, such ashttps://example.com/post/123.sourceDomainaccepts a hostname without a scheme, port, or path. It matches HTTP and HTTPS source hostnames, ignoring case, ports, a trailing dot, and thewww.prefix on stored sources. Other subdomains match separately.sourceCreatorsupportscontainsandexact, both case-insensitive.
Filters apply before counting and pagination and respect the same scope permissions as other searches. Existing sources can be searched without reindexing.
Regenerate thumbnails
POST /api/v1/files/bulk-regenerate-thumbnails accepts up to 1,000 file UUIDs. Regeneration requires ownership or canManageFiles, enabled thumbnail generation, and FFmpeg. Quarantined files, unsupported formats, and files the caller cannot manage are skipped. HTTP 200 returns regenerated, failed, and skipped arrays of UUIDs.
See processing status and limits for retries and background job behavior.