BetterFans Link: the OnlyFans APIBetterFans Link

Going live

Link a real creator with a hosted link, understand grants, and switch your code to a live key.

Product page: OnlyFans agency API

Going live takes three things: a linked creator account, a live key, and, if you write, writes turned on for that account.

A creator can connect their own OnlyFans or Fansly account through a hosted link: a page we host where they sign in themselves. BetterFans Link works only with creator accounts linked to your workspace.

  1. Create a link. In the dashboard, open Linking and create a link, or call Create link with a live key:

    curl -X POST https://betterfans.link/v1/links \
      -H "Authorization: Bearer $BFL_KEY" \
      -H "Content-Type: application/json" \
      -d '{"note": "Jess Rivers", "platform": "onlyfans"}'

    Set platform to onlyfans or fansly, or leave it out to let the creator pick.

  2. Send the url from the response to the creator. It works for 24 hours.

  3. The creator opens it and signs in. On OnlyFans they type their email and password and answer anything OnlyFans asks for: a captcha, a two-factor code or a selfie check. On Fansly they type their username or email and password, then the code from their email or authenticator app when Fansly asks for one.

  4. When they finish, the link status becomes connected, accountId is set and your workspace gets an account.connected webhook.

Follow progress with Get link or the Linking page. The link a creator guide covers each status and what to tell the creator.

Owners, admins and developers can create links. See roles.

Grants

Linking gives your workspace a grant: permission to read that account and to ask for writes on it. A few rules follow from that.

  • Two workspaces can hold grants on the same OnlyFans account, for example an agency and the creator's own workspace. Each sees the account and neither sees the other.
  • A Fansly account can be connected in one place at a time. Linking one that is already connected elsewhere fails with account_in_use.
  • Removing an account from your workspace revokes your grant. It never deletes the synced history, and the creator can link it again with a new hosted link.
  • An account your workspace has no grant for does not exist as far as your keys are concerned. Every route returns 404 account_not_found, never 403.
  • In test mode there are no grants to manage. The sandbox creators are visible to every workspace.

The first sync

A newly linked account shows syncing for up to 30 minutes while its history fills in. Reads work during that time, but totals can be low until the sync finishes. When status becomes healthy, the history is in place. See account status.

Switch to a live key

Turn off Test mode in the dashboard header, open Developers, then API keys, and create a key. Live keys start with bfl_live_.

  • Give it only the scopes it needs. A reporting script needs read. Only code that asks for writes needs write.
  • Limit it to the accounts it needs, if it serves one creator. A key limited to some accounts gets 404 for the others.
  • Set an expiry if the key is for a contractor or a short project.

Then replace your test key with the live key. Sandbox account ids do not exist in live mode, so read account ids from List accounts instead of hard coding them. See keys and scopes.

Turn on writes

Writes are off for every newly linked account. While they are off, creating an action for that account fails with 403 writes_disabled and nothing waits for approval. Reads keep working.

An owner or admin turns writes on per account: open the account in the dashboard, then Settings, and switch on API writes. Turning them on does not let anything through by itself. Each write still waits for an owner or admin to approve it, unless the key has auto-approve on.

Make sure someone who can approve will see pending actions. The Approvals page in the dashboard lists them, and the action.pending webhook can notify your team. See writes and approvals.

Checklist

  • The creator's account shows healthy on the Accounts page.
  • Your code reads account ids from GET /v1/accounts.
  • Your code handles account_unavailable by reading without fresh=true or waiting, not by retrying in a loop.
  • The live key has only the scopes and accounts it needs, and it lives in a secret store, not in code.
  • Live webhook endpoints are created in live mode and verify signatures.
  • If you write, writes are on for the account and an owner or admin watches the Approvals page.

On this page