Skip to main content

OnlyAutomator API

The OnlyAutomator API allows you to interact with the various services of our platform, including account management, proxy configurations, email marketing, scheduled tasks, webhooks, and features dedicated to the Chrome extension. This document provides a high-level overview of available endpoints, authentication methods, and general API conventions.

Base URL

All API requests should be made to the primary production URL. For development, specific local URLs are provided:
  • Production: https://onlyautomator.com
  • Local Development (Web App): http://localhost:3000
  • Local Development (Microservice): http://localhost:3001

API Endpoints

The API is organized into logical sections based on functionality:

Extension API (v2)

Endpoints primarily consumed by the OnlyAutomator Chrome Extension.
EndpointMethodDescription
/api/v2/account-connectPOSTConnect an OnlyFans account to the platform
/api/v2/get-accountGETRetrieve connected OnlyFans account information and status
/api/v2/get-profileGETGet detailed profile information and metrics for the account
/api/v2/account/allowed-featuresGETGet features allowed by the authenticated user’s plan
/api/v2/update-notePOSTCreate or update a CRM note for a specific subscriber (fan)
/api/v2/update-of-notePOSTSynchronize a note from the OnlyFans platform to the CRM
/api/v2/update-preferencePOSTUpdate or create preference information for a subscriber
/api/v2/sync-notesPOSTSynchronize all notes for a subscriber with the backend
/api/v2/update-countryPOSTUpdate country information for a subscriber
/api/v2/get-ppv-statisticsGETRetrieve pay-per-view (PPV) message performance metrics
/api/v2/get-preferencesGETGet all preferences recorded for a specific subscriber
/api/v2/get-transactionsGETGet transaction history for a specific subscriber

Proxy Management API

Endpoints for managing and utilizing proxy configurations.
EndpointMethodDescription
/api/proxy/account/{accountId}GETGet current proxy configuration for a specific account
/api/proxy/account/{accountId}/assign-autoPOSTAutomatically assign or update a Webshare proxy for an account
/api/proxy/account/{accountId}/set-manualPOSTManually set or update proxy configuration for an account
/api/proxy/account/{accountId}/preferencePUTUpdate proxy preferences (e.g., region, active state) for an account
/api/proxy/account/{accountId}/disablePOSTDisable proxy usage for an account
/api/proxy/account/{accountId}/handle-failurePOSTReport a proxy failure and potentially trigger reassignment
/api/proxy/test-connectivityPOSTTest connectivity of a given proxy configuration
/api/proxy/webshare/availableGETGet available Webshare proxies from the pool (Admin/Internal)
/api/proxy/webshare/available-countriesGETGet list of countries where Webshare proxies are available
/api/proxy/webshare/available-citiesGETGet list of cities for a country where Webshare proxies are available
/api/whatsmyipGETGet client’s current external IP address as seen by the server

Fan, Emoji, and Script Management

Endpoints for managing fan details, custom emojis, and automation scripts.
EndpointMethodDescription
/api/fan/getGETGet details for a specific fan
/api/get-emojisGETGet the authenticated user’s custom emoji settings
/api/create-emojiPOSTCreate or update the user’s custom emoji setting
/api/get-scriptsGETGet all automation scripts for the authenticated user
/api/create-scriptPOSTCreate a new automation script

Marketing API

Endpoints for email marketing and user synchronization.
EndpointMethodDescription
/api/marketing/sync-usersPOSTSynchronize users with email marketing platforms (bulk)
/api/marketing/sync-userPOSTSynchronize an individual user with marketing platforms
/api/marketing/test-email-simpleGETTest sending emails using predefined basic templates
/api/marketing/templatesGET/POSTGet, create, and manage email templates
/api/marketing/test-templatePOSTTest a specific email template with sample data

Email Automation (Cron Jobs)

Scheduled tasks for automated email delivery, typically triggered internally.
EndpointMethodDescription
/api/cron/send-welcome-emailGETSend welcome email to new users
/api/cron/send-login-emailGETSend login reminder emails to users
/api/cron/send-feedback-emailGETSend feedback request emails
/api/cron/send-account-setup-emailGETSend account setup reminder emails

Webhooks

Endpoints for receiving events from external services.
EndpointMethodDescription
/api/webhooks/user-createdPOSTProcess user creation events (e.g., from Supabase Auth)

Account Service API (V1 Legacy & General)

General account-related operations.
EndpointMethodDescription
/api/account/testGETCheck if the main account service is operational
/v1/accounts/{id}/processPOSTProcess data for an OnlyFans account (V1 API)

Testing Endpoints

Utility endpoints for testing specific functionalities.
EndpointMethodDescription
/api/test/sync-userPOSTTest synchronizing a single user with marketing platforms

Microservice API

Endpoints specific to the backend microservice operations.
EndpointMethodDescription
/api/testGETHealth check for the microservice
/api/process-account/{accountId}POSTManually trigger data scraping for a specific account

Supabase Database API

Direct interaction with the Supabase database via its PostgREST API.
EndpointMethodDescription
/rest/v1/accountsGET/POST/PATCH/DELETEAccess and manage account records in the database

Authentication

Authentication mechanisms depend on the endpoint being accessed:
  1. User Session (JWT via Cookies/Headers): Required for most WebApp and Extension APIs (e.g., /api/v2/*, /api/fan/get, /api/get-emojis, /api/get-scripts, /api/proxy/account/*). The JWT is typically obtained after user login and sent as a Bearer token in the Authorization header.
  2. Marketing API Key (Header): Required for some marketing endpoints like /api/marketing/sync-users and /api/marketing/test-template (if specific internal logic applies, otherwise JWT). Indicated by marketingApiKey in OpenAPI security schemes.
  3. Testing API Key (Query Param): Used for /api/test/sync-user. The key apiKey is passed in the query string.
  4. Cron API Key (Header): Endpoints under /api/cron/* require a specific Authorization: Bearer YOUR_CRON_SECRET.
  5. Supabase API Key (Header): Endpoints under /rest/v1/* require the Supabase apikey in the header.
  6. Webhooks: Typically secured via signature verification (e.g., Supabase webhooks check a secret).
Refer to individual endpoint definitions in the OpenAPI specification for precise security requirements.

Response Format

All API responses are in JSON format.

Success Response Example

A successful operation usually returns a 2xx HTTP status code. The body structure can vary, but often includes a success or status field and a data object.
{
  "success": true, // Or status: "success"
  "data": {
    // Response data specific to the endpoint
  }
}

Error Response Example

Error responses use 4xx or 5xx HTTP status codes and typically follow this structure, as defined by ErrorResponse in the OpenAPI schema:
{
  "success": false, // Or status: "error"
  "error": "Descriptive error message", // Human-readable
  "code": "OPTIONAL_ERROR_CODE",      // Machine-readable
  "details": { /* Optional additional details */ }
}
Example from /api/proxy/account/{accountId}/disable if account not found:
{
  "success": false,
  "error": "Account not found",
  "code": "RESOURCE_NOT_FOUND"
}

Rate Limiting

While specific public rate limits are not strictly defined for all endpoints, the system employs internal queue management and fair-use policies, especially for operations involving external services (like Webshare or email providers). Please use the API responsibly. Automated systems making excessive requests may be subject to throttling or temporary suspension.

Example Usage

Testing an Email Template (GET)

// Example: Test a simple email template
async function testSimpleEmail() {
  const email = "[email protected]";
  const template = "welcome";
  const firstName = "John";
  const url = `https://onlyautomator.com/api/marketing/test-email-simple?email=${email}&template=${template}&firstName=${firstName}`;

  try {
    const response = await fetch(url, {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
        // Add Authorization header if required by this specific endpoint's final implementation
      }
    });
    const data = await response.json();
    if (!response.ok) {
      console.error('API Error:', data);
    } else {
  console.log('Test result:', data);
    }
  } catch (error) {
    console.error('Network or other error:', error);
  }
}

testSimpleEmail();

Getting Subscriber Preferences (Extension API v2 - GET)

// Example: Get subscriber preferences using a JWT
async function getFanPreferences(fanId, jwtToken) {
  const url = `https://onlyautomator.com/api/v2/get-preferences?fanId=${fanId}`;

  try {
    const response = await fetch(url, {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
        'Authorization': `Bearer ${jwtToken}`
  }
    });
    const data = await response.json();
    if (!response.ok) {
      console.error('API Error:', data);
    } else {
  console.log('Preferences:', data);
    }
  } catch (error) {
    console.error('Network or other error:', error);
  }
}

// const fanIdToFetch = "12345";
// const userJwtToken = "your_actual_jwt_token";
// getFanPreferences(fanIdToFetch, userJwtToken);

Implementation Notes

The OnlyAutomator platform leverages a modern stack:
  • Main Backend & WebApp: Next.js, React, TypeScript
  • Microservice (Scraping & Automation): Node.js with Express.js, TypeScript
  • Database: Supabase (PostgreSQL)
  • Task Queuing: Robust queue systems like BullMQ or similar for background jobs.
  • Chrome Extension: React, TypeScript, Vite.

Future Enhancements

We are continuously working to improve and expand the OnlyAutomator API. Future plans include:
  • More granular analytics endpoints.
  • Expanded webhook event coverage.
  • Advanced automation script management APIs.
  • Enhanced CRM functionalities via API.
For the most detailed and up-to-date information on each endpoint, including request/response schemas and security, please refer to the full OpenAPI Specification pages linked within this documentation.