Feefer API

API reference for authentication, images, user management, and storage.

Base URLhttps://api.feefer.net

Try the API on FoxOS. Register an account and play with the API right in your browser.


Once you register for FoxOS, search for the "Feefer" app!

Make a request

Most endpoints require an access token. Register or log in, then send the complete accessToken value in the Authorization header.

cURL
curl 'https://api.feefer.net/images/fox/random' \
  --header 'Authorization: Bearer <token>'

API reference

Quickstart

Create an account, save your token, and make an authenticated request.

01

Create an account

Choose a username with 3–32 letters, numbers, underscores, dots, or hyphens, and a nonempty password.

Create an account
curl --request POST 'https://api.feefer.net/auth/register' \
  --header 'Content-Type: application/json' \
  --data '{"username":"example_user","password":"choose-a-long-password"}'
02

Save your access token

The response includes accessToken with Bearer already attached. Use the complete value in your Authorization header.

Authorization header
Authorization: Bearer <your-access-token>

Keep your token private. Tokens expire after 30 days by default; log in again when you need a new one.

03

Request an image

Request an image, then open the returned url. The image URL is public, so you can use it directly in your app.

Fetch a random fox
curl 'https://api.feefer.net/images/fox/random' \
  --header 'Authorization: Bearer <token>'
See all 9 categories

Access & permissions

How to authenticate requests and which routes each role can use.

Use your bearer token

Registration and login return an accessToken with the Bearer prefix included. Paste it directly into the Authorization header.

Protected request header
Authorization: Bearer <your-access-token>

Use the latest token from login. A new login can revoke earlier tokens. Missing, revoked, or expired tokens return 401; a banned account or insufficient role returns 403.

Roles

New accounts start with the user role. Each higher role includes the route access below it.

0userRandom image endpoints
1supportUser search + image endpoints
2moderatorSame route access as support
3adminUser management + storage operations
4ownerAdmin route access + higher mutation priority

Permission rules

To ban, rename, or change an account’s role, you must strictly outrank that account. You cannot change yourself. When granting a role, you must also outrank the role you grant.

Admins can grant up to moderator. Owners can grant up to admin. No API role can grant owner. Changes to roles and bans apply immediately to existing valid tokens.

Images

Get random images from 9 categories and download them using their public URLs.

GET/images/{folder}/random
Access token

Get a random image#

Choose one of the categories below. The response includes cached object metadata and a public image URL.

foxbirdshibeweiner-dogslaphugkisssmugpat
  • Catalogs refresh after IMAGE_CATALOG_TTL_MS (default 60 seconds) and after uploads/deletes through this API.
  • Use the URL directly; image bytes are public. IMAGE_CDN_BASE_URL can serve them through a CDN. Empty categories return 503.
Request
curl --request GET 'https://api.feefer.net/images/fox/random' \
  --header 'Authorization: Bearer <token>'
Example response
{
  "name": "fox/example.png",
  "etag": "example-etag",
  "size": 123456,
  "lastModified": "2026-01-01T00:00:00.000Z",
  "url": "https://api.feefer.net/i/fox/example.png"
}
GET/i/{folder}/{filename}
Public

Fetch an image#

Public image bytes with a one-hour cache lifetime and an enforced 25 MiB delivery limit.

foxbirdshibeweiner-dogslaphugkisssmugpat
  • Use an allowed category and a filename containing only letters, numbers, dots, underscores, or hyphens. Nested paths and .. are not allowed.
  • Invalid parameters return 400, missing source objects return 404, and source failures return 502.
Request
curl --request GET 'https://api.feefer.net/i/fox/example.png' \
  --output example.png
Example response
binary image bytes

Authentication

Create an account, get an access token, and start making authenticated requests.

POST/auth/register
Public

Create an account#

Usernames are trimmed, case-sensitive, and 3–32 characters long. Use letters, numbers, underscores, dots, or hyphens.

  • Provide a nonempty password. New accounts receive the user role.
  • Returns 201 Created. Save the complete accessToken value, including its Bearer prefix.
JSON request body
Request body
{
  "username": "example_user",
  "password": "choose-a-long-password"
}
Request
curl --request POST 'https://api.feefer.net/auth/register' \
  --header 'Content-Type: application/json' \
  --data '{
  "username": "example_user",
  "password": "choose-a-long-password"
}'
Example response
{
  "user": {
    "id": "user_id",
    "username": "example_user",
    "role": "user",
    "banned": false
  },
  "accessToken": "Bearer eyJhbGciOi..."
}
POST/auth/login
Public

Log in#

Returns 200 with an access token. Keep the latest token: logging in can revoke earlier tokens.

  • Invalid credentials return 401. A banned account with valid credentials returns 403.
  • Access tokens expire after 30 days by default. Log in again when your token expires.
JSON request body
Request body
{
  "username": "example_user",
  "password": "choose-a-long-password"
}
Request
curl --request POST 'https://api.feefer.net/auth/login' \
  --header 'Content-Type: application/json' \
  --data '{
  "username": "example_user",
  "password": "choose-a-long-password"
}'
Example response
{
  "user": {
    "id": "user_id",
    "username": "example_user",
    "role": "user",
    "banned": false
  },
  "accessToken": "Bearer eyJhbGciOi..."
}

User management

Search accounts, manage roles, and view request counts. Elevated roles required.

POST/admin/ban
Admin +

Ban a user#

Identify the account by userId or username. When both are supplied, userId takes precedence.

  • You cannot ban yourself or an account with an equal or higher role.
  • Already banned accounts return 400. There is no unban endpoint.
JSON request body
Request body
{
  "userId": "user_id"
}
Request
curl --request POST 'https://api.feefer.net/admin/ban' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "user_id"
}'
Example response
{
  "status": 200,
  "message": "User example_user has been banned",
  "user": {
    "id": "user_id",
    "username": "example_user",
    "role": "user",
    "banned": true
  }
}
GET/admin/user/search
Support +

Find a user#

Pass ?username=example_user or ?userId=user_id. When both are supplied, userId takes precedence.

  • Includes the user summary and request counters. Unknown users return 404.
Request
curl --request GET 'https://api.feefer.net/admin/user/search?username=example_user' \
  --header 'Authorization: Bearer <token>'
Example response
{
  "status": 200,
  "user": {
    "id": "user_id",
    "username": "example_user",
    "role": "user",
    "banned": false,
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z",
    "collection": "users"
  },
  "requests": {
    "id": "user_id",
    "auth": 0,
    "admin": 0,
    "images": 12,
    "total": 12,
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z",
    "collection": "requests"
  }
}
GET/admin/users
Admin +

List users#

Returns a page keyed by username, with a user summary and counters for each account.

  • Use limit (default 100, maximum 1000) and follow pagination.nextCursor until it is null.
Request
curl --request GET 'https://api.feefer.net/admin/users?limit=100' \
  --header 'Authorization: Bearer <token>'
Example response
{
  "status": 200,
  "users": {
    "example_user": {
      "user": {
        "id": "user_id",
        "username": "example_user",
        "role": "user",
        "banned": false,
        "createdAt": "2026-01-01T00:00:00.000Z",
        "updatedAt": "2026-01-01T00:00:00.000Z",
        "collection": "users"
      },
      "requests": {
        "id": "user_id",
        "auth": 0,
        "admin": 0,
        "images": 12,
        "total": 12,
        "createdAt": "2026-01-01T00:00:00.000Z",
        "updatedAt": "2026-01-01T00:00:00.000Z",
        "collection": "requests"
      }
    }
  },
  "pagination": {
    "limit": 100,
    "nextCursor": null
  }
}
GET/admin/users/dashboard
Admin +

Get a usage overview#

Returns a page of flat user rows and aggregate counts across every account.

  • Use limit/cursor for rows. Summary totals include users outside the current page; missing counters default to zero.
Request
curl --request GET 'https://api.feefer.net/admin/users/dashboard?limit=100' \
  --header 'Authorization: Bearer <token>'
Example response
{
  "status": 200,
  "summary": {
    "totalUsers": 1,
    "bannedUsers": 0,
    "totalRequests": 12,
    "adminRequests": 0,
    "authRequests": 0,
    "imageRequests": 12
  },
  "pagination": {
    "limit": 100,
    "nextCursor": null
  },
  "users": [
    {
      "id": "user_id",
      "username": "example_user",
      "role": "user",
      "banned": false,
      "createdAt": "2026-01-01T00:00:00.000Z",
      "updatedAt": "2026-01-01T00:00:00.000Z",
      "collection": "users",
      "requestsId": "user_id",
      "auth": 0,
      "admin": 0,
      "images": 12,
      "total": 12,
      "requestsCreatedAt": "2026-01-01T00:00:00.000Z",
      "requestsUpdatedAt": "2026-01-01T00:00:00.000Z",
      "requestsCollection": "requests"
    }
  ]
}
POST/admin/user/edit/role
Admin +

Change a role#

Identify the account by userId or username, then provide a valid role.

  • Your role must outrank both the target account and the role you grant. You cannot edit your own role.
  • Role changes apply immediately to existing valid tokens. No API role can grant owner.
JSON request body
Request body
{
  "userId": "user_id",
  "role": "support"
}
Request
curl --request POST 'https://api.feefer.net/admin/user/edit/role' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "user_id",
  "role": "support"
}'
Example response
{
  "status": 200,
  "message": "User example_user has been changed to support",
  "user": {
    "id": "user_id",
    "username": "example_user",
    "role": "support",
    "banned": false
  }
}
POST/admin/user/edit/username
Admin +

Change a username#

Identify the account by userId or its current username.

  • The new username follows registration rules. A name already in use returns 409.
  • You must outrank the target account and cannot rename yourself.
JSON request body
Request body
{
  "userId": "user_id",
  "newUsername": "new_name"
}
Request
curl --request POST 'https://api.feefer.net/admin/user/edit/username' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "userId": "user_id",
  "newUsername": "new_name"
}'
Example response
{
  "status": 200,
  "message": "User username has been changed to new_name",
  "user": {
    "id": "user_id",
    "username": "new_name",
    "role": "user",
    "banned": false
  }
}

Storage

Upload images, check buckets, and delete objects. Requires admin or owner.

GET/admin/s3/test
Admin +

Check storage#

Pass ?bucketExists=lunar-api to check a bucket, or omit it for a route smoke test.

  • Legacy GET JSON bodies remain supported. A route-only response does not confirm storage availability.
Request
curl --request GET 'https://api.feefer.net/admin/s3/test?bucketExists=lunar-api' \
  --header 'Authorization: Bearer <token>'
Example response
{
  "status": 200,
  "bucketExists": true
}
POST/admin/s3/upload
Admin +

Upload an image#

Supply bucketName and objectName as query parameters.

  • Send raw image bytes, not multipart data. Content-Type must be image/* and the body must be at most 10 MiB.
  • For random-image endpoints, use bucket lunar-api and a direct category path such as fox/example.png.
Request
curl --request POST 'https://api.feefer.net/admin/s3/upload?bucketName=lunar-api&objectName=fox/example.png' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: image/png' \
  --data-binary @example.png
Example response
{
  "status": 200,
  "message": "Image uploaded successfully",
  "bucketName": "lunar-api",
  "objectName": "fox/example.png",
  "etag": "example-etag",
  "versionId": null
}
DELETE/admin/s3/delete
Admin +

Delete an object#

Provide bucketName and either objectName or etag. objectName takes precedence.

  • Etag deletion removes the first matching object; a missing match returns 404. Successful deletes invalidate category catalogs.
JSON request body
Request body
{
  "bucketName": "lunar-api",
  "objectName": "fox/example.png"
}
Request
curl --request DELETE 'https://api.feefer.net/admin/s3/delete' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "bucketName": "lunar-api",
  "objectName": "fox/example.png"
}'
Example response
{
  "status": 200,
  "message": "Object deleted successfully",
  "bucketName": "lunar-api",
  "object": "fox/example.png"
}

System

Liveness checks and documentation formats.

GET/
Public

Check the API#

Public endpoint. A 200 response confirms the API process is responding.

Request
curl --request GET 'https://api.feefer.net/'
Example response
{
  "status": 200,
  "message": "🦊 The API is up!",
  "docs": "/docs"
}
GET/health
Public

Check service liveness#

Returns a timestamp, uptime in seconds, and local response preparation time.

  • This is a liveness check; it does not verify database or storage availability.
Request
curl --request GET 'https://api.feefer.net/health'
Example response
{
  "status": 200,
  "message": "API is up! (Duh). 🦊",
  "timestamp": "2026-01-01T00:00:00.000Z",
  "uptimeSeconds": 1234.56,
  "responseTimeMs": 0
}
GET/ready
Public

Check dependency readiness#

Checks the database migration state and storage bucket. Returns 503 while dependencies are unavailable or shutdown is in progress.

  • Liveness and readiness probes are exempt from traffic quotas.
Request
curl --request GET 'https://api.feefer.net/ready'
Example response
{
  "status": 200,
  "ready": true
}
GET/docs
Public

Browse the documentation#

The browser reference you are reading. No authentication required.

Request
curl --request GET 'https://api.feefer.net/docs'
Example response
<html>...</html>
GET/docs.md
Public

Get the Markdown reference#

A plain Markdown version of the complete API reference.

Request
curl --request GET 'https://api.feefer.net/docs.md'
Example response
# Feefer API reference
...
GET/docs.json
Public

Get the JSON catalog#

A custom endpoint catalog containing examples and notes. This is not an OpenAPI schema.

Request
curl --request GET 'https://api.feefer.net/docs.json'
Example response
{
  "generatedAt": "2026-01-01T00:00:00.000Z",
  "baseUrls": {},
  "roles": [],
  "sections": []
}
GET/openapi.json
Public

Get the OpenAPI specification#

OpenAPI 3.1 generated from the contract objects and Zod schemas used by the routers.

  • Use this specification for schema validation and client generation.
Request
curl --request GET 'https://api.feefer.net/openapi.json'
Example response
{
  "openapi": "3.1.0",
  "info": {
    "title": "Feefer API",
    "version": "3.0.0"
  },
  "paths": {}
}

Errors

HTTP status codes and error response formats.

Read the status code

400

Check your input

A required field is missing, a value is invalid, or the action is not allowed on this target.

401

Check your token

Include the complete Authorization value. Log in again if your token expired or was revoked.

403

Check your permissions

The account may be banned, or your role may not allow this operation.

404

Check the resource

The route, user, or image could not be found.

409

Choose another username

That username is already in use.

429

Too many requests

A request limit was reached. Follow the Retry-After header before retrying.

500

Try again later

The service could not complete the request. Repeated failures may need investigation.

Read a consistent error response

Errors include status, a stable code, and a human-readable message. The error field remains an alias for clients that previously read authentication errors. Validation failures can also include field details. Internal exception details are logged by the server.

Error response
{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Username is required",
  "error": "Username is required"
}

Rate limits

Request quotas, retry headers, and progressive delays.

Request quotas

Limits stack: a login request also counts toward the authentication and global limits. Quotas are per IP unless a username is specified.

ScopeRequestsWindow
All requests1,000 / IP2 minutes
Authentication routes50 / IP15 minutes
Registration3 / IP1 hour
Login8 / IP15 minutes
Login5 / normalized username15 minutes

Successful logins are removed from the two login-specific quotas. They still count toward global and authentication limits, and toward slowdown.

Use the response headers

Check X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix seconds). When limits overlap, these describe the last limiter applied. On a 429 response, wait for the number of seconds in Retry-After.

Expect progressive delays

The API also slows repeated requests before rejecting them. Login delays start after the first request in 15 minutes and grow by 3 seconds, up to 30 seconds. Registration adds 5 seconds after the first request per hour, up to 60 seconds. Authentication-group and global delays can apply as well.