Use the Server API
Upload whole folders with the Frameleaf CLI: API keys, dry run and albums Watch on YouTube
The Frameleaf Server API lets your scripts and tools upload media, organize albums, search your library and automate administration on your own server. Create a scoped API key, try the examples below, then explore the full reference.
Browse endpoints · Browse schemas · Download the OpenAPI specification
Connect to your server
Section titled “Connect to your server”Use your Frameleaf address followed by /api, for example https://photos.example.com/api. The API uses your server’s accounts and access rules. These pages cover the self-hosted endpoints for API-key integrations.
To connect an AI assistant to your library, use Connect AI assistants. Manage its permissions in Connected apps.
The reference shows its API version, and GET /api/server/version returns your running server version, so you can match the two.
Create an API key
Section titled “Create an API key”- Sign in to the Frameleaf web app.
- Open Settings, then Your sign-in & privacy, then API keys.
- Create a key with a descriptive name and only the permissions your script needs.
- Copy the key when it’s shown and store it privately. Delete it when you no longer need the integration.
Send the key in the x-api-key header, and keep it out of public URLs, browser scripts and source repositories. A key has at most the access of the account that owns it, and administrative operations need administrator access.
For the examples below, set FRAMELEAF_API_URL to your server address including /api, and provide FRAMELEAF_API_KEY through your shell’s secret or environment facility.
Read your albums
Section titled “Read your albums”Requires album.read.
curl --fail-with-body \ --header "x-api-key: $FRAMELEAF_API_KEY" \ "$FRAMELEAF_API_URL/albums"See Albums for ownership filters, album creation and sharing.
Upload a photo
Section titled “Upload a photo”Requires asset.upload. Uploads use multipart form data; let your HTTP client set the boundary. Use the file’s real creation and modification timestamps in ISO 8601 format.
curl --fail-with-body \ --header "x-api-key: $FRAMELEAF_API_KEY" \ --form 'fileCreatedAt=2026-10-01T12:30:00.000Z' \ --form 'fileModifiedAt=2026-10-01T12:30:00.000Z' \ "$FRAMELEAF_API_URL/assets"A new upload returns 201; a duplicate returns 200. Use the returned asset ID in later requests. See Assets for the complete request and response. For folders and large imports, the Frameleaf CLI is usually easier than writing an uploader.
Features you reach through the API
Section titled “Features you reach through the API”A few things the server does have no page in the web app. Scripts can use them through the API. Each one is in the endpoint reference.
A record of every original
Section titled “A record of every original”The server keeps a record of every original it has accepted, so nothing goes missing unnoticed. For each one it can say where the original is now: kept, in the Trash, removed (by whom and when), sharing an identical file with another, or missing. The record outlives the photo and the account.
| Request | What it returns | Needs |
|---|---|---|
GET /users/me/ledger/summary |
Your totals, including any originals the server can’t account for | asset.read |
GET /users/me/ledger |
Your originals and where each is now, newest change first. Filter with state, and page with cursor and size |
asset.read |
GET /admin/ledger/summary |
The server’s totals, with how many originals each account is missing. No file is named | An administrator, server.statistics |
People read only their own record. Photos that are Locked are listed only while they’re unlocked.
The check after an upgrade
Section titled “The check after an upgrade”After each upgrade the server compares the library with how it was just before. GET /admin/upgrade-check returns the latest comparison: everything where it was, or each difference found, such as a drive that isn’t mounted or fewer photos than before. It needs an administrator. See The check after an upgrade.
Don’t upload again what I deleted
Section titled “Don’t upload again what I deleted”An account can ask that photos and videos it permanently deletes aren’t accepted as uploads again, for example when a phone still holds them. It’s off by default, and only the account itself can turn it on.
- Turn it on by setting
backup.skipDeleted.enabledtotruein your own preferences, withPUT /users/me/preferences. It applies to what you delete from then on, never to earlier deletions. GET /users/me/upload-skipslists what is being refused, by checksum, latest first.POST /users/me/upload-skips/allowwith a list ofchecksumslets those items be uploaded again.
While it’s on, an upload of one of those files is refused with 409 and the code deleted_by_owner. A file that is still in your library, or still in your Trash, is never refused, and another person’s upload of the same file isn’t affected. Nothing is deleted or hidden on the phone or computer: the server only declines the upload.
Changes made by Frameleaf Assistant
Section titled “Changes made by Frameleaf Assistant”Frameleaf Assistant can make an album, add to one, tag, favourite, or cull bursts, and only after you confirm. Every change can be undone for 30 days.
| Request | What it does | Needs |
|---|---|---|
POST /assistant/actions |
Works out what a change would do for a fixed list of items and stores it as a proposal. Nothing in the library changes: the answer is the count, a sample of the items and what was left out | asset.update |
POST /assistant/actions/{id}/apply |
Confirms the proposal and makes the change | asset.update |
POST /assistant/actions/{id}/undo |
Puts back what the change did, within 30 days. An item changed since is left alone and reported as skipped | asset.update |
GET /assistant/actions |
Lists your Assistant changes | asset.read |
Locked items and other people’s items are always left out, and no change deletes anything or moves it to the Trash.
Account activity
Section titled “Account activity”GET /users/me/activity returns your own account activity, and GET /admin/activity returns everyone’s for an administrator, optionally for one person with userId. See Activity log.
Read requests and responses
Section titled “Read requests and responses”Each endpoint page lists its HTTP method, path, authentication, API-key permission and parameter locations. Replace {id} in a path with the actual identifier. JSON requests need Content-Type: application/json; file uploads use multipart form data.
Schema links explain nested objects, allowed enum values, formats and required fields. An omitted field and a field set to null can mean different things. Keep identifiers as strings, and follow each endpoint’s pagination fields to page through large results.
Handle failures
Section titled “Handle failures”| Status | What to do |
|---|---|
400 |
Check required fields, formats and allowed values. |
401 |
Check that the key is valid and the request includes its header. |
403 |
Check the key’s permissions and the owning account’s access. |
404 |
Check the ID, route and server version. A resource may be unavailable to your account. |
409 |
Refresh current state before retrying a conflicting update. |
413 |
Check server and reverse-proxy upload limits. |
429 |
Respect Retry-After when returned and slow your requests. |
5xx |
Check server health; retry reads with a delay. Check the result of a write before repeating it. |
For destructive operations such as permanent deletion and database restoration, test your script on a small sample first, keep backups, and check a write’s result before retrying it.
© 2026 Frameleaf Inc. All rights reserved.
Frameleaf and the Frameleaf logo are Trademarks of Frameleaf Inc.
