API Reference
Pro Plan Feature
48 Endpoints
30 Events

NewFans Pro API

Build powerful integrations to manage drops, fans, analytics, NFC, and more. RESTful, predictable, well-documented.

Base URL:https://api.newfanspro.com/v1
Auth:Bearer Token
Format:JSON
Version:v1.5.0

Getting Started

Integrate with NewFans Pro in 3 steps

Step 1

Get API Keys

Generate your API keys from the Settings dashboard. You'll get both a secret key and a publishable key.

Step 2

Configure Webhooks

Set up webhook endpoints to receive real-time events when things happen in your account.

Step 3

Make API Calls

Start integrating with our REST API endpoints. Use our SDKs or call the API directly.

Authentication

Secure your API requests with Bearer token authentication

NewFans Pro uses API keys for authentication. Include your key in the Authorization header. Manage keys in Settings → API.

Secret Key
Private

Use for server-side requests only. Never expose in client code or version control.

sk_live_xxxxxxxxxxxxx
Publishable Key
Public

Safe for client-side code. Limited to public read-only operations.

pk_live_xxxxxxxxxxxxx

Permission Scopes

API keys can be scoped to specific permissions. Restrict keys to only the operations your integration needs.

ScopeDescription
drops:readList and retrieve drops
drops:writeCreate, update, and publish drops
fans:readList and retrieve fan profiles
orders:readList and retrieve orders
orders:writeProcess refunds
nfc:readList tags, batches, analytics
nfc:writeCreate batches and manage tags
analytics:readAccess all analytics data
messaging:writeSend push notifications & campaigns
ai:writeUse AI generation features

Example Request

curl https://api.newfanspro.com/v1/drops \\
  -H "Authorization: Bearer sk_live_your_api_key" \\
  -H "Content-Type: application/json"

API Endpoints

48 endpoints across 10 resources

Drops

6 endpoints
List all drops with pagination and filtering
Get a single drop by ID with full details
Create a new drop
Update an existing drop
Delete a drop (draft only, published drops must be archived)
Publish a draft drop and make it live

Fans

5 endpoints
List all fans with filtering and sorting
Get detailed fan profile with engagement metrics
Create a fan record manually
Get a fan's complete purchase history
Get a fan's active entitlements

Orders

4 endpoints
List all orders with advanced filtering
Get an order by ID with line items and payment details
Process a full or partial refund
Get a formatted receipt for an order

NFC

6 endpoints
List NFC tags with status filtering
Create a new batch of NFC codes
Get batch details with claim metrics
Claim an NFC tag (public, idempotent)
Verify NFC tag validity without claiming
Get NFC scan and claim analytics

Analytics

5 endpoints
Get detailed drop-level analytics
Get revenue summary with time-series data
Get dashboard metrics (aggregate overview)
Get fan acquisition and engagement analytics
Export analytics data as CSV or JSON

Fan Club

6 endpoints
List fan club members with engagement data
Get member details with activity history
Send a fan club invitation email
Send bulk fan club invitations (max 500)
Approve a pending join request
Deny a pending join request with optional reason

Messaging

4 endpoints
Send a Pocket push notification to fans
Trigger an email campaign via NewFans DM
List available notification templates
Get message delivery history with status tracking

AI Features

5 endpoints
Generate 3 AI drop plans from a text prompt
Auto-fill remaining drop configuration fields
Get current AI credit balance and usage
Analyze cover art for color extraction and theming
Transcribe audio for metadata extraction

Collaborators

4 endpoints
List collaborators on a drop with split info
Invite a collaborator to a drop
Update collaborator split or role
Remove a collaborator from a drop

Entitlements

3 endpoints
List all entitlements (content access grants)
Manually grant content access to a fan
Revoke an entitlement (remove content access)

Pagination

All list endpoints support cursor-based pagination

Use page and per_page query parameters. Default page size is 25, maximum is 100.

Request Parameters

pagePage number (starting from 1)
per_pageItems per page (1-100, default: 25)
sortSort field (varies by endpoint)
orderSort direction: asc or desc

Response Metadata

{
  "success": true,
  "data": {
    "drops": [...],
    "total": 152,
    "page": 2,
    "per_page": 25,
    "has_more": true,
    "total_pages": 7
  }
}

Webhooks

Receive real-time HTTP notifications for 30 event types

Configure endpoints in Settings → Webhooks. We retry failed deliveries up to 3 times with exponential backoff.

Available Events (30)

drop.createdA new drop was created
drop.publishedA drop was published and went live
drop.updatedA drop's configuration was updated
drop.archivedA drop was archived
order.createdA new order was placed
order.completedPayment was captured and order completed
order.refundedAn order was fully or partially refunded
order.disputedA payment dispute was opened
fan.createdA new fan signed up or was added
fan.subscribedA fan subscribed to email/SMS updates
fan.unsubscribedA fan unsubscribed from updates
fan.birthdayA fan's birthday is today
nfc.claimedAn NFC tag was successfully claimed
nfc.scannedAn NFC tag was scanned (not necessarily claimed)
nfc.batch_createdA new NFC batch was generated
entitlement.grantedContent access was granted to a fan
entitlement.revokedContent access was revoked
entitlement.expiredTime-limited access expired
dispute.createdA payment dispute was opened
dispute.resolvedA dispute was resolved
dispute.evidence_requiredEvidence submission deadline approaching
collaborator.invitedA collaborator invitation was sent
collaborator.acceptedA collaborator accepted their invite
collaborator.declinedA collaborator declined their invite
payout.initiatedA payout was initiated
payout.completedA payout was completed successfully
payout.failedA payout attempt failed
fanclub.member_joinedA fan joined the fan club
fanclub.member_leftA fan left the fan club
fanclub.request_pendingA new join request is pending

Payload Structure

{
  "id": "evt_1234567890",
  "type": "order.completed",
  "api_version": "v1",
  "created": 1679529600,
  "livemode": true,
  "data": {
    "object": {
      "id": "ord_abc123",
      "amount": 2999,
      "currency": "usd",
      "fan_id": "fan_xyz789",
      "drop_id": "drop_def456",
      "status": "completed"
    },
    "previous_attributes": {}
  }
}

Verifying Signatures

All webhook requests include a x-newfans-signature header.

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const timestamp = signature.split(',')[0].split('=')[1];
  const receivedSig = signature.split(',')[1].split('=')[1];
  const signedPayload = `${timestamp}.${payload}`;
  const expectedSig = crypto
    .createHmac('sha256', secret)
    .update(signedPayload)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(receivedSig),
    Buffer.from(expectedSig)
  );
}

Rate Limits

Fair usage limits to maintain service quality

1,000

req/min

Standard
10,000

req/min

Pro Plan
50

req/min

AI Endpoints
Custom

Contact us

Enterprise

Response Headers

X-RateLimit-LimitMaximum requests per window1000
X-RateLimit-RemainingRequests remaining985
X-RateLimit-ResetWindow reset (Unix timestamp)1704067200
Retry-AfterSeconds until retry (429 only)45
async function apiCallWithRetry(fn, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await fn();
    if (response.status !== 429) return response;
    const retryAfter = parseInt(
      response.headers.get('Retry-After') || String(Math.pow(2, attempt) * 1000)
    );
    await new Promise(r => setTimeout(r, retryAfter));
  }
  throw new Error('Max retries exceeded');
}

Error Handling

Conventional HTTP codes with structured error responses

200
OKRequest succeeded
201
CreatedResource created
400
Bad RequestInvalid parameters
401
UnauthorizedMissing/invalid API key
403
ForbiddenInsufficient permissions
404
Not FoundResource not found
422
UnprocessableValidation failed
429
Rate LimitedToo many requests
500
Server ErrorInternal error
{
  "success": false,
  "error": {
    "type": "validation_error",
    "code": "parameter_invalid",
    "message": "The 'amount' parameter must be a positive integer.",
    "param": "amount",
    "details": {
      "received": -5,
      "expected": "positive integer"
    }
  },
  "request_id": "req_abc123xyz"
}

Error Types

TypeDescription
authentication_errorInvalid or missing API key
authorization_errorKey lacks required scope
validation_errorRequest parameters invalid
not_foundResource doesn't exist
rate_limit_errorToo many requests
plan_limit_errorFeature requires upgrade
insufficient_creditsNot enough AI credits
server_errorInternal server error

SDKs & Libraries

Official client libraries for popular languages

🟨
JavaScript / Node.jsv1.2.0
Available
npm install @newfans/sdk
🐍
Pythonv1.1.0
Available
pip install newfans
🔷
TypeScriptv1.2.0
Available
npm install @newfans/sdk
💎
Ruby
Coming Soon
🐹
Go
Coming Soon
🐘
PHP
Coming Soon

Quick SDK Example

import { NewFansClient } from '@newfans/sdk';

const client = new NewFansClient({
  apiKey: process.env.NEWFANS_API_KEY,
});

// List drops
const drops = await client.drops.list({ status: 'active' });

// Create a drop
const newDrop = await client.drops.create({
  title: 'New Album',
  type: 'digital_album',
  pricing: { type: 'fixed', amount: 9.99 }
});

// Send push notification
await client.messaging.sendPush({
  audience: 'all_fans',
  title: 'New Drop!',
  body: 'Check out my latest release'
});

Code Examples

Common integration patterns and recipes

Create & Publish a Drop

Full workflow: create, upload media, then publish

// 1. Create the drop
const drop = await fetch('https://api.newfanspro.com/v1/drops', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_xxx',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Summer Album 2024',
    type: 'digital_album',
    pricing: { type: 'fixed', amount: 14.99 },
    settings: { show_in_pocket: true }
  })
});

const { data: { id: dropId } } = await drop.json();

// 2. Publish when ready
await fetch(`https://api.newfanspro.com/v1/drops/${dropId}/publish`, {
  method: 'POST',
  headers: { 'Authorization': 'Bearer sk_live_xxx' },
  body: JSON.stringify({ notify_fans: true })
});

Generate NFC Batch for Event

Create 500 NFC codes for a live show

const batch = await fetch('https://api.newfanspro.com/v1/nfc/batches', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_xxx',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    count: 500,
    drop_id: 'drop_abc123',
    prefix: 'SHOW2024',
    metadata: { event: 'Summer Tour 2024' }
  })
});

const { data: { batch: newBatch } } = await batch.json();
console.log('Download codes:', newBatch.csv_url);

Export Revenue Analytics

Fetch and export time-series revenue data

const analytics = await fetch(
  'https://api.newfanspro.com/v1/analytics/revenue?' + new URLSearchParams({
    start_date: '2024-01-01',
    end_date: '2024-12-31',
    group_by: 'month'
  }),
  { headers: { 'Authorization': 'Bearer sk_live_xxx' } }
);

const { data } = await analytics.json();

// Or use the export endpoint
const csv = await fetch(
  'https://api.newfanspro.com/v1/analytics/export?format=csv&report=revenue',
  { headers: { 'Authorization': 'Bearer sk_live_xxx' } }
);

API Changelog

Track API updates, new endpoints, and improvements

v1.5.0
2024-03-15
✨ Features
  • Added /v1/entitlements endpoints for direct content access management
  • Added /v1/analytics/export endpoint for data exports
  • Added /v1/ai/transcribe endpoint for audio transcription
  • New webhook events: entitlement.expired, dispute.evidence_required
v1.4.0
2024-02-28
✨ Features
  • Added query parameter filtering for all list endpoints
  • Added fan_club webhook events
  • Increased rate limits for Pro plan users
  • Added scopes to API key configuration
v1.3.0
2024-02-01
⚡ Improvements
  • Improved error response format with request_id tracking
  • Added pagination metadata to all list responses
  • Added Python SDK v1.1.0
  • Webhook retry logic now uses exponential backoff
v1.2.0
2024-01-15
✨ Features
  • Added AI feature endpoints (generate-plan, smart-completion, analyze-cover)
  • Added collaborator management endpoints
  • Added messaging/push endpoint for Pocket notifications
v1.1.0
2024-01-01
⚡ Improvements
  • Added webhook signature verification
  • Added rate limit headers to all responses
  • JavaScript SDK v1.0.0 released
v1.0.0
2023-12-15
🚀 Launch
  • Initial API release with Drops, Fans, Orders, NFC, and Analytics endpoints
  • Webhook system with 20+ event types
  • cURL and JavaScript examples

Need help with your integration?

Our team is here to help you build amazing experiences with the NewFans Pro API.

All systems operational

© 2026 NewFans Pro. All rights reserved. | Terms | Privacy