Tracking Links

Create Tracking Link

Creates a tracking link on OnlyFans and stores it in the FansMetric database. Requires permission api_tracking_links_create.

https://public-api.fansmetric.com
POST/v1/{account_id}/tracking-links
Bearer

Authorization

default
AuthorizationBearer <token>

Send your FansMetric API key as a Bearer token in the Authorization header.

In: header

Path Parameters

  • account_id*integer

    OnlyFans numeric account ID.

Request Body

application/json
  • name*string

    Campaign name.

  • tag_idsarray

    FansMetric tag IDs to assign.

  • custom_source_urlstring

    Custom source URL for traffic tracking.

Response Fields

  • data.idinteger

    Newly created OnlyFans campaign ID.

  • data.campaignNamestring

    Campaign name as stored on OnlyFans.

  • data.campaignCodeinteger

    Numeric code used in the tracking link URL.

  • data.campaignUrlstring | null

    Full public tracking-link URL (https://onlyfans.com/{username}/c{campaignCode}). null if the username or code could not be resolved.

  • data.countSubscribersinteger

    Always 0 on creation.

  • data.allCountSubscribersinteger

    Always 0 on creation.

  • data.countTransitionsinteger

    Always 0 on creation.

  • data.createdAtstring | null

    Creation timestamp (RFC 3339).

  • data.endDatestring | null

    null while the campaign is active; set when it is deleted.

  • data.customNamestring | null

    FansMetric display-name override. null on creation — set it via Update Tracking Link.

  • data.customSourceUrlstring | null

    Traffic-source URL stored in FansMetric (the value submitted in custom_source_url).

  • data.notestring | null

    Free-text note. null on creation.

  • data.isHiddenboolean

    FansMetric hide flag. false on creation.

  • data.isRevenueSharedboolean

    Whether an enabled share exposes revenue. false on creation.

  • data.lastScannedAtstring | null

    When the scraper last refreshed this link. null until the first pass.

  • data.user.usernamestring

    Creator username. Empty string if it could not be resolved.

  • data.tags[]array

    Full tag objects for the IDs passed in tag_ids. Each element has id, name, color, created_at — same shape as GET /v1/tags. Resolution is best-effort: if the post-write tag-map fetch fails, tags is [] rather than failing the create. Tags belonging to a different org are silently filtered out, so a submitted ID may not appear.

  • data.revenue.totalstring

    "0.00" on creation.

  • data.revenue.spendersCountinteger

    0 on creation.

  • data.revenue.revenuePerSubscriberstring

    "0" on creation.

  • data.revenue.conversionToSpenderstring

    "0" on creation.

  • data.costobject

    perPromo, perSub, profit, roi — all null until a promo cost is set, which is how you tell "not set" from zero.

  • data.links.related.subscribersstring

    Path to this link's claimers.

  • dataobject | array

    Endpoint-specific payload. See the fields below for this route.

  • _meta._credits.usedinteger

    Credits consumed by this request (currently always 1).

  • _meta._rate_limits.limit_minuteinteger

    Maximum requests per minute for the organization.

  • _meta._rate_limits.remaining_minuteinteger

    Remaining requests in the current minute window.

  • _meta._rate_limits.limit_dayinteger

    Maximum requests per day for the organization.

  • _meta._rate_limits.remaining_dayinteger

    Remaining requests in the current day window.

curl --request POST "https://public-api.fansmetric.com/v1/100000001/tracking-links" \
  --header "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "name": "My Campaign",
  "tag_ids": [1, 2],
  "custom_source_url": "https://reddit.com/r/example"
}'

Response

201
{
"data":{
"id":100000011
"campaignName":"My Campaign"
"campaignCode":102
"campaignUrl":"https://onlyfans.com/creator_XXXXX/c102"
"countSubscribers":0
"allCountSubscribers":0
"countTransitions":0
"createdAt":"2026-05-15T10:00:00Z"
"endDate":null
"customName":null
"customSourceUrl":"https://reddit.com/r/example"
"note":null
"isHidden":false
"isRevenueShared":false
"lastScannedAt":null
"user":{
"username":"creator_XXXXX"
}
"tags":[
0:{
"id":1
"name":"Reddit"
"color":"#FF5733"
"created_at":"2026-01-12T09:14:22Z"
}
1:{
"id":2
"name":"Twitter"
"color":"#1DA1F2"
"created_at":"2026-01-12T09:15:01Z"
}
]
"revenue":{
"total":"0.00"
"spendersCount":0
"revenuePerSubscriber":"0"
"conversionToSpender":"0"
}
"cost":{
"perPromo":null
"perSub":null
"profit":null
"roi":null
}
"links":{
"related":{
"subscribers":"/v1/100000001/tracking-links/100000011/claimers"
}
}
}
"_meta":{
"_credits":{
"used":1
}
"_rate_limits":{
"limit_minute":1000
"remaining_minute":999
"limit_day":50000
"remaining_day":49999
}
}
}