API Reference

PicFast exposes a REST API at /api/v1. All endpoints require authentication unless marked as public. The API accepts JWT access tokens or scoped API tokens (prefixed img_) via the Authorization: Bearer header.

System

MethodPathAuthDescription
GET/healthNoHealth check (database + storage)
GET/metricsNoPrometheus metrics endpoint
GET/api/v1/configNoPublic site configuration
GET/api/v1/versionNoServer version info
GET/openapi.yamlNoOpenAPI spec (YAML)
GET/openapi.jsonNoOpenAPI spec (JSON)
GET/docsNoScalar API docs UI (interactive)

Setup

MethodPathAuthDescription
GET/api/v1/setup/statusNoCheck if first-run setup is needed (no admin exists)
POST/api/v1/setupNoCreate the first admin account (only available when no users exist)

Auth

MethodPathAuthDescription
POST/api/v1/auth/registerNoRegister a new account
POST/api/v1/auth/loginNoLog in, returns JWT + refresh token
POST/api/v1/auth/refreshNoRefresh access token
POST/api/v1/auth/logoutJWTRevoke all refresh tokens
POST/api/v1/auth/verify-emailNoVerify email with token
POST/api/v1/auth/resend-verificationNoResend verification email

User

MethodPathAuthDescription
GET/api/v1/users/meJWTGet current user profile
PUT/api/v1/users/meJWTUpdate profile (name, password, settings)

API Tokens

MethodPathAuthDescription
GET/api/v1/api-tokensJWTList your API tokens
POST/api/v1/api-tokensJWTCreate API token (scopes, expiration)
DELETE/api/v1/api-tokens/{id}JWTDelete an API token

Images

MethodPathAuthDescription
POST/api/v1/imagesJWT / tokenUpload an image (multipart)
GET/api/v1/imagesJWT / tokenList your images (paginated, filterable by album_id)
GET/api/v1/images/{key}JWT / tokenGet image details by key
PATCH/api/v1/images/{key}JWT / tokenUpdate image (album_id, permission)
DELETE/api/v1/images/{key}JWT / tokenDelete an image by key

Upload fields

POST /api/v1/images accepts multipart/form-data:

FieldTypeDescription
filefileImage file (required)
album_idintAlbum ID to group the image
permissionint0 = private, 1 = public (default)
expires_instringDuration like 24h, 7d
strategy_idintStorage backend to use

Albums

MethodPathAuthDescription
GET/api/v1/albumsJWT / tokenList your albums
POST/api/v1/albumsJWT / tokenCreate an album
PUT/api/v1/albums/{id}JWT / tokenUpdate album (name, intro)
DELETE/api/v1/albums/{id}JWT / tokenDelete an album

Strategies

MethodPathAuthDescription
GET/api/v1/strategiesJWT / tokenList strategies available to your group

Guest upload

MethodPathAuthDescription
POST/api/v1/uploadOptionalGuest upload (when enabled in admin settings)

ShareX

MethodPathAuthDescription
GET/api/v1/sharex/configNoDownload ShareX .sxcu config file
POST/api/v1/sharex/uploadOptionalShareX-compatible upload endpoint

Admin API

All admin endpoints require a JWT with admin role. Prefix: /api/v1/admin.

MethodPathDescription
GET/admin/usersList users (filter by keyword, status)
GET / PUT / DELETE/admin/users/{id}View, update, or delete a user
GET / POST/admin/groupsList or create groups
GET / PUT / DELETE/admin/groups/{id}View, update, or delete a group
GET / POST/admin/strategiesList or create storage strategies
GET / PUT / DELETE/admin/strategies/{id}View, update, or delete a strategy
GET/admin/imagesList all images (filter by keyword, email, extension)
DELETE/admin/images/{id}Delete any image by ID
GET/admin/moderation/pendingList images pending moderation
POST/admin/moderation/{id}/approveApprove an image
POST/admin/moderation/{id}/rejectReject an image (optional reason)
GET / PUT/admin/settingsView or update site settings (runtime hot-reload)
GET/admin/audit-logsList audit logs (filter by action, resource_type)
GET/admin/observability/summarySystem overview (uptime, health, DB pool, usage stats)

AI agent integration (MCP)

PicFast ships an MCP server for AI agent integration (Claude, Cursor, VS Code Copilot). See the dedicated MCP Integration page for setup instructions, tool reference, and configuration.

OpenAPI spec

The full machine-readable API spec is available at:

  • /openapi.yaml — YAML format
  • /openapi.json — JSON format
  • /docs — Interactive Scalar UI for live API testing