Authentication & scopes
With tokens.manage, create one named API token for each script or service in Profile → Integrations. Give it only the permissions it uses. You can revoke a connection without interrupting your other tools.
An AI agent usually needs no token: it signs in through your browser, and you choose its permissions on the screen Flare shows. Create a token for an agent only when its client cannot sign in, or when you want its access to end on a date you set.
A token works with the REST API, with the MCP server that agents connect to, or with both, depending on its scopes. The scope reference says which.
Create a token
- In Profile → Integrations, choose New token to open the creation dialog. Choose a name of 1–80 characters. Use the name to identify the machine, service, or purpose.
- Select one or more scopes from the table below. The form offers a scope only while your role allows at least one of its operations, as listed in Scopes and account roles. For example,
urls:writeappears with eitherlinks.createorlinks.delete. While the instance's MCP server is on, the form also has an Agent access box; checking it adds the scopes only agents use and groups the list under Files, Short links, and Account. See tokens for agents. - Review Expires after, which starts at 90 days. Choose 30 days, 90 days, 1 year, or Never; Never keeps the token active until revoked.
- If it uploads files, optionally bind it to one of your saved upload profiles.
- Create the token and save the displayed
flr_…secret in your tool's secret store.
The full value is shown once. Flare stores a hash rather than the recoverable token. If you lose it, revoke the token and create a replacement. Each account can have 50 active named tokens. Expired and revoked tokens do not count toward that limit. Token and webhook changes for one account run one at a time, so concurrent requests cannot exceed it. The integrations screen retrieves the latest 100 token records and shows creation, expiration, revocation, and last-use information. Each token also lists the scopes it can still use with your current role, and the upload profile it's bound to, if any. The bound profile is the outlined chip with a sliders icon; the filled chips are scopes. A token an agent can use also has an outlined Agent access chip.
Send a token
Authorization: Bearer flr_YOUR_TOKENcurl --fail-with-body \
-H "Authorization: Bearer $FLARE_TOKEN" \
"$FLARE_URL/api/files?limit=10"For that listing request, the token needs files:read. Authentication schemes are case-insensitive (Bearer and bearer work); the secret itself is case-sensitive. Tokens belong in the header, not in the URL.
A named flr_ bearer token uses its own authority even if browser cookies accompany the request. A signed-in administrator's cookie does not add permissions to a named token on these routes. Scripts, servers and command-line clients can call Flare as shown. A web app running in a browser on another site also needs the instance to allow its origin; see call Flare from a web app. The docs builder does not act as an authenticated proxy to your instance.
Call Flare from a web app
Browsers refuse to let a page read answers from another site unless that site allows it with CORS headers. Flare sends none by default, so a web app on its own origin, such as a PWA at https://app.example.com or a dev server at http://localhost:5173, gets TypeError: Failed to fetch and a CORS error in the console, even with a valid token. The same request from curl works.
The instance operator turns cross-origin access on with FLARE_CORS_ORIGINS and restarts Flare:
FLARE_CORS_ORIGINS=https://app.example.com,http://localhost:5173Then the app sends a named token in the Authorization header, as any client does:
const flare = 'https://files.example.com'
const token = 'flr_YOUR_TOKEN' // from the person using the app, never hardcoded
const response = await fetch(`${flare}/api/files?limit=10`, {
headers: { Authorization: `Bearer ${token}` },
})
if (!response.ok) throw new Error((await response.json()).error)
const { data } = await response.json()
// File content follows the file's own access rules, not the token,
// so this works for public files.
const bytes = await fetch(`${flare}/api/files/${data[0].id}/download`)
const blob = await bytes.blob()What other sites can reach:
- Every method a named token can call, listed in the scope reference. The token's scopes and its owner's role permissions apply exactly as they do elsewhere. Browsers send a preflight
OPTIONSrequest first; Flare answers it for these routes and caches it in the browser for 10 minutes. - File content for anonymous visitors, with
GETandHEAD:/{userUrlId}/{filename}/raw,/{userUrlId}/{filename}/direct,/api/files/{path}, and/api/files/{id}/download,/thumbnailand/ocr. Public files work, password-protected ones with thepasswordquery value. Private files stay unavailable to other sites: named tokens don't unlock file content, and a page can't read an answer that Flare's session cookie authorized. - Response headers an app needs:
Retry-Afteron API routes, andAccept-Ranges,Content-DispositionandContent-Rangeon file content.
What stays on Flare's own pages:
- The session cookie never works for another site. Flare doesn't send
Access-Control-Allow-Credentials. A request withoutcredentials: 'include'carries no Flare cookie and answers401. With it, a browser can still send the cookie, for example between two ports oflocalhostor two subdomains of one site, but it won't let the page read the answer, and a change the cookie authorizes is refused with403by the browser-session write rule. Such aGETdoes reach Flare, so it can count a file view, as an<img>tag on that page already could. A signed-in person visiting a hostile page doesn't let it read their files or act as them. - Routes named tokens can't call get no CORS headers, whatever the setting: account settings, organization, tags, folders, file changes, invites, roles, audit and the rest of the endpoint inventory. The legacy upload token works from another site only on the named-token routes it can also call, such as uploads.
The token sits in the app's storage in the visitor's browser, where any script the app runs can read it. Create a separate token for the app with only the scopes it uses, set an expiration, and revoke it from Profile → Integrations if the app or device is lost.
On S3 storage, /api/files/{id}/download redirects to a signed storage URL, and the browser follows it. The bucket needs its own CORS rule for the app's origin to read that answer; Flare's setting doesn't reach the bucket. The same applies to presigned chunk part URLs, as chunked uploads describe. Builds before this setting existed sent no CORS headers, so browser apps on other sites could not use the API at all.
Browser-session writes
Flare's own pages call these routes with the browser's session cookie. A browser also attaches that cookie to requests other pages send, so a request the cookie authenticates that changes something, with any method except GET, HEAD and OPTIONS, must come from Flare's pages:
- Its
Originheader must be the origin ofNEXTAUTH_URL, or the address the app itself serves, such ashttp://localhost:3000in development. A request without anOriginheader, such as one a script sends, passes. A browser request markedSec-Fetch-Site: cross-sitedoesn't. Otherwise the answer is403withCross-origin requests are not allowed. - A JSON body must be sent as
Content-Type: application/json, and an image upload asmultipart/form-data. Another type answers415, such asUse application/json.
Named tokens and the legacy upload token are never checked this way, because a browser doesn't attach them on its own. Send their JSON as application/json all the same, as the examples here do.
Earlier builds skipped the origin check on POST /api/files, POST /api/files/chunks, POST /api/files/chunks/{uploadId}/complete, POST /api/files/{id}/expiry, POST /api/urls and POST /api/profile/upload-token, and read their JSON whatever type it was sent as. A page on another subdomain of the same site could therefore upload files, create short links, schedule expirations or replace the upload token in a signed-in visitor's account. They also checked the origin and type of legacy-token requests to the folder and tag routes, which now accept those like other token requests.
Scope reference
| Scope | Name in the token form | Works with | What it allows |
|---|---|---|---|
files:upload | Upload files | REST API and MCP | REST: POST /api/files; POST, GET, PUT /api/files/chunks; GET, PUT /api/files/chunks/{uploadId}/part/{partNumber}; POST /api/files/chunks/{uploadId}/complete. MCP: upload files and create pastes, and with files:content, extract and create archives. |
files:read | Read files | REST API and MCP | REST: GET /api/files; GET /api/files/types; GET /api/files/timeline. MCP: search and list files, folders, and tags. |
files:content | Read file contents | MCP | Read text, see images and the text in them, look inside archives, and get download links, private files included. |
files:organize | Organize files | MCP | Create, rename, and remove folders and tags, move and tag files, and schedule or cancel an expiry. |
files:share | Change sharing | MCP | Change files' visibility and passwords, create or revoke folder links, and schedule an expiry that makes files private, on a file or, through account settings and upload profiles, for later uploads. Also needed to make later uploads public through an upload profile. |
files:delete | Delete files | MCP | Delete files permanently, and schedule an expiry that deletes them, on a file or, through account settings and upload profiles, for later uploads. |
urls:read | Read short links | REST API and MCP | REST: GET /api/urls. MCP: list short links. |
urls:write | Manage short links | REST API and MCP | REST: POST /api/urls; PATCH and DELETE /api/urls/{id}. MCP: create, redirect and delete short links. |
account:write | Change account settings | MCP | Change the account's display name, vanity ID, upload defaults, theme, link embed, and avatar, and create, change, and delete upload profiles. Never the email address, the password, or anything else about signing in. |
invites:write | Manage invites | MCP | List, create, and revoke invite links, as far as the role's invites.create and invites.manage allow. Giving an invite roles also needs admin:users. |
admin:read | View administration | MCP | Administration scope. List and read users and roles, read the instance settings with every secret hidden, check for updates, and search the audit log. |
admin:users | Manage users and roles | MCP | Administration scope. Create, change, and delete users and roles, sign users out, and give invites roles. Never a password, an email address, or a key permission. |
admin:content | Moderate content | MCP | Administration scope. With the account argument, list, read, change the sharing of, and delete another account's files, and list and delete its short links. |
admin:settings | Change instance settings | MCP | Administration scope. Registration and invite limits, storage and quotas, the footer credit, OCR, the classic theme, the email policy without the SMTP connection, test emails, and the appearance studio. |
mcp | Agent access | MCP | Marks the token as one an agent may use: the MCP endpoint accepts no named token without it. By itself it allows only get_account. An agent that signs in never holds it and does not need it. |
Works with says where Flare honors a scope. The REST API does not honor a scope marked MCP: a token holding files:delete still cannot delete a file through DELETE /api/files/{id}, and one holding files:content still cannot download a private file through /api/files/{id}/download. Likewise, account:write does not open PUT /api/profile or the upload profile routes to a token. Those scopes take effect only through the MCP tools. In the other direction, a token works on the MCP endpoint only while it carries mcp, so the tokens your scripts already use cannot drive an agent.
An agent that signs in through the browser is granted scopes from this same table, every one except mcp, on the consent screen. Its access token is not a named token: it works on the MCP endpoint only, and the REST API answers it with 401 whatever scopes it holds.
The four administration scopes, admin:read, admin:users, admin:content, and admin:settings, exist only while an administrator has turned on administration through MCP. While it is off, no token or sign-in can be given one, and a credential that holds one cannot use it. Turning it off takes them away from every token and connection for good. No preset includes them, and neither does invites:write.
Scopes are independent. files:upload does not include listing, and urls:write does not include listing. Select both relevant scopes when a service needs both capabilities. Some MCP tools need several: extracting and creating archives need files:content and files:upload, and the account export needs files:read, files:content, and urls:read, which is every read scope.
The {uploadId} and {id} path segments in these routes accept letters, digits, _, and -, which covers every ID Flare returns. A path whose ID contains any other character is outside the allowlist: a named token gets 401, and a browser session or the legacy upload token gets 403.
files:read returns your file metadata, including private files. It does not authorize private file downloads, thumbnails, or OCR routes. Those use the file's sharing rules and browser session. files:upload does not provide a chunk cancellation or uploaded-parts listing endpoint.
Over the REST API, named tokens do not authorize the following operations, whatever their scopes:
- Creating or revoking tokens, managing webhooks, or retrieving the account upload token.
- Enrolling or disabling two-factor authentication, replacing recovery codes, or registering/managing passkeys.
- Editing accounts, server settings, branding, email policy, or users.
- Creating or editing upload profiles, folders, or tags.
- Deleting files or editing existing files' visibility, passwords, or expiration.
- Using owner-library archive routes to browse, download entries, extract, or create archives; these require the owner's browser session. Separate share-page browsing and entry downloads use file visibility/password checks and reject bearer headers too.
This remains true when the token's owner is an administrator. See all route boundaries if you are investigating a request used by the dashboard.
An agent connected through the MCP server can organize, share, and delete its owner's files, look inside, extract, and create archives, change its owner's account settings and upload profiles, and manage invites, with the MCP scopes above. With an administration scope, where the instance allows it, it can also manage users and roles, moderate other accounts' content, and change some instance settings. It still cannot do the first two items in this list, set or change anyone's email address or password, grant a key permission, or change custom code, logos, the SMTP connection, or sign-in settings; the MCP coverage table has the whole boundary.
Tokens for agents
An agent normally signs in through the browser and holds no named token. Such a connection is listed under Connected agents in the Agents card, not under API tokens, does not count toward the limit of 50 tokens (an account can have 50 signed-in agents besides), and is ended with Disconnect.
For a client that cannot sign in, Connect an agent → Use a token instead in Profile → Integrations creates a token with Agent access and the actions you pick, and shows the setup for your client; Connect an agent walks through it. You can also check Agent access in New token, which then shows the scopes that only agents use. Both appear only while an administrator has the MCP server turned on, and both make ordinary named tokens: they count toward the limit of 50, expire and are revoked the same way, and are listed with an outlined Agent access chip.
Flare applies these rules when a token for agents is created, each with a 400 and a message that names the scopes:
- The MCP server must be on. Otherwise:
The MCP server is turned off on this instance, so tokens cannot have Agent access. - A scope that works only with MCP needs Agent access on the same token, since it would do nothing without it.
- Every scope must be one your role can use now. A token cannot be given
files:deletewhile your role lacksfiles.delete, for example. - An administration scope needs administration through MCP to be on. Otherwise the message begins
Administration through MCP is turned off on this instance, so agents cannot haveand names the scopes. - A token with an administration scope must expire within 90 days. Never, or a later date, is refused with
A token with administration permissions must expire within 90 days. Choose an earlier expiration date.The form keeps to this by itself: while an administration permission is ticked, Expires after says Tokens with administration permissions must expire within 90 days., 1 year and Never are unavailable, and a longer choice moves to 90 days. Untick them all and the earlier choice comes back.
A token made only of REST scopes is created exactly as before. Turning the MCP server off later keeps tokens and their scopes; the MCP endpoint stops answering, and the token's REST scopes keep working.
Scopes and account roles
A scope restricts the token; it does not grant a permission missing from the owner's current roles. Every request must satisfy both checks. For the REST API:
| Token operation | Named-token scope | Current account permission |
|---|---|---|
| List files, MIME types, or timeline | files:read | files.read |
| Upload, upload parts, or finalize | files:upload | files.upload |
| List short links | urls:read | links.read |
| Create a short link | urls:write | links.create |
| Delete an owned short link | urls:write | links.delete |
MCP tools follow the same rule with their own table, the authorization matrix.
tokens.manage controls issuing, rotating, and revoking credentials, including tokens for agents, and signing agents in: the consent screen refuses an account without it, and so do Edit permissions and Disconnect. Removing it alone does not disable already-issued named tokens, agents that already signed in, or the legacy upload credential while the owner still holds the required operation permissions. Revoke/rotate the credential or remove its operation grants to stop its use.
Everyone initially grants these personal capabilities. A role change can revoke them on the next request without waiting for token expiration. Granting the permission again restores the authority of an otherwise valid token; revoke it too if it should never be used again. Administrator satisfies account permission checks but does not expand a named token's selected scopes or supported routes.
Additional operation rules still apply: without files.share, new uploads become private; without folders.manage or tags.manage, uploads targeting a folder or applying tags are rejected, including options inherited from a profile. An expiring upload also needs files.delete for a deletion action or files.share for a make-private action, including inherited expiration. Profile bindings, ownership, verification, size, and storage limits remain in force. Over the REST API, roles and account administration remain browser-session-only even when the token owner can administer the instance; the administration scopes work only through MCP tools.
Bind uploads to a profile
A profile binding makes the token use one saved upload profile. For example, an “Internal screenshots” profile can produce private files, randomize URL names, and set a one-week lifetime. Bind your screenshot automation token to that profile to enforce those options.
The token must include files:upload, and the selected profile must belong to the same account. With a bound token:
- Omitting
X-Upload-Profileautomatically selects the bound profile. - Choosing another profile or
nonefails with403. - Overriding resolved profile options with different values fails with
403. - Setting an explicit
expiresAtfails with403, includingnull. - Chunk requests can only access upload sessions created with that bound profile.
Bindings apply to the profile's resolved sharing, expiration, naming, style, and tag options. A folder is a request-only destination and is still selectable from the account's folders. Upload passwords are also request-only; they are not saved upload-profile options. Avoid sending redundant option fields for bound tokens: send the file and let the selected profile supply its policy.
New uploads use the profile's current settings. Chunked uploads keep the option snapshot selected when they start. Removing a bound profile does not turn the token into an unrestricted token; uploads fail until the connection is replaced with a valid configuration.
A bound token that has Agent access stays bound through the MCP server: the files its archive calls create are published with the profile, and it cannot create, change, or delete upload profiles or change the account's upload defaults, even when it holds account:write. Otherwise it could rewrite the settings it was bound to.
Named tokens and the account upload token
Flare also has an older account upload token. Generated ShareX, iTake, Flameshot, Spectacle, and Bash configurations use it for compatibility. Regenerating it invalidates existing generated configurations, so download them again afterward.
GET /api/profile/upload-token returns { "uploadToken": "…" }, and POST replaces the token and returns the new one. Both answer with Cache-Control: private, no-store, like the generated configurations, so browsers and shared caches don't keep the credential; earlier versions sent no caching header. A password reset replaces the token too when the administrator turned on Rotate upload tokens after a password reset.
The legacy credential is accepted by the shared account authentication helper and does not have the named-token scope allowlist. Its supported route surface is therefore broader than files:upload on routes that use that helper, but current role permissions still restrict each request. It still does not satisfy routes that explicitly require a browser session or an administrator session. Prefer scoped named tokens for new custom integrations.
Two-factor authentication and passkeys
Account sign-in security protects interactive browser sign-in. API tokens and the legacy upload credential continue working without a code or passkey ceremony; enabling two-factor authentication or Require passkey to sign in does not revoke them or add an interactive step. A passkey requirement blocks password and SSO browser sign-in but preserves integrations under their existing permissions. Review existing integrations and revoke/rotate any credential you no longer trust.
Security management requires a browser session and fresh identity proof. Neither named tokens nor the legacy upload credential can authorize those endpoints. The session security contract documents their separate boundaries. The named-token OpenAPI document and request builder intentionally keep their existing supported operations.
Rotate or revoke a token
For planned rotation, create a replacement, update the tool's stored credential, and run a small test. Then revoke the old token in Profile → Integrations. Revocation takes effect on subsequent authentication. Upload finalization also checks whether a named token expired or was revoked while bytes were being transferred. Revoking a token that has Agent access disconnects its agent on the next call and ends the upload and download URLs it was given. An agent that signed in has no token to rotate: its client renews its own access, and Disconnect ends it.
The last-used timestamp is best-effort activity metadata, not a full audit log. Never put bearer tokens into a public repository, a screenshot, a URL, or a support report. A token is a credential even when it can only upload.
Troubleshoot a 401 or 403
| Symptom | What to check |
|---|---|
401 Unauthorized on every request | Confirm the complete token, header, instance URL, expiration, and revocation status. Make sure your reverse proxy forwards Authorization. |
Upload works but listing returns 401 | Add files:read by creating a replacement token with the required scopes. |
| Named token works on files but not account settings | The route is outside the named-token allowlist. Use the dashboard for account administration. |
| A previously working account loses API access | Check whether the administrator now requires email verification. A user who must verify their email cannot use named or legacy token authentication until eligible again. Also check current role grants: removing an operation’s permission stops both kinds of token. |
403 says you lack permission | Ask the administrator to review the owner’s current role grants. Token scope alone does not grant account authority. |
403 mentions an upload profile | Remove conflicting overrides, select the bound profile, and confirm it still exists. |
A web app on another site gets Failed to fetch | The instance hasn't allowed the app's origin. Ask the operator to add it to FLARE_CORS_ORIGINS, written exactly as the browser sends it, such as http://localhost:5173. Session-only routes never work from another site, and a page can't read answers the session cookie authorized. |
An agent gets 401 from /api/mcp | With a token: it has no Agent access, or it was revoked or expired. After signing in: the connection was disconnected or ended, so sign in again from the client. A 404 there means the MCP server is off. See the agent troubleshooting table. |
403 says an upload token expired or was revoked | The credential became invalid before upload finalization. Replace it and begin again. |
Missing credentials, unknown tokens, expired tokens, revoked tokens, missing scopes, and required email verification intentionally share a generic 401 response. The server does not reveal which authentication check failed to an unauthenticated caller. An authenticated request lacking a current role permission returns 403; restoring that role grant can restore access without issuing another token.
Browser-session revocation and audit access
Active sessions tracks interactive sign-ins only. Revoking one or all browser sessions does not revoke named API tokens or rotate the legacy upload credential. Retire those separately in Profile when responding to compromised access. Tokens are never accepted by the session-history or audit API, even when their owner has Administrator or audit.read. Recorded token-authorized activity identifies the account and applicable operation without retaining the token secret.