OnlyAutomator API

The OnlyAutomator API allows you to interact with the various services of our platform, including email marketing, scheduled tasks, webhooks, account management, and the Chrome extension features.

Base URL

All API requests should be made to:
https://onlyautomator.com
For development environment:
http://localhost:3000
For microservice development:
http://localhost:3001

API Endpoints

Extension API (v2)

EndpointMethodDescription
/api/v2/account-connectPOSTConnect an OnlyFans account to the platform
/api/v2/get-accountGETRetrieve account information and connection status
/api/v2/get-profileGETGet detailed profile information and metrics
/api/v2/account/allowed-featuresGETGet features allowed by user’s plan
/api/v2/fan/{fanId}GETGet details for a specific fan
/api/v2/emojisGETGet user’s custom emoji settings
/api/v2/emojiPOSTCreate or update user’s emoji setting
/api/v2/scriptsGETGet all scripts for the user
/api/v2/scriptPOSTCreate a new script
/api/v2/update-notePOSTCreate or update a note for a subscriber
/api/v2/update-of-notePOSTSynchronize a note from OnlyFans platform
/api/v2/update-preferencePOSTUpdate subscriber preference information
/api/v2/sync-notesPOSTSynchronize notes between extension and backend
/api/v2/update-countryPOSTUpdate subscriber country information
/api/v2/get-ppv-statisticsGETRetrieve PPV message performance metrics
/api/v2/get-preferencesGETGet all preferences for a subscriber
/api/v2/get-transactionsGETGet transaction history for a subscriber

Proxy Management

EndpointMethodDescription
/api/proxy/account/{accountId}GETGet proxy configuration for an account
/api/proxy/account/{accountId}/assign-autoPOSTAutomatically assign a Webshare proxy
/api/proxy/account/{accountId}/set-manualPOSTManually set proxy configuration
/api/proxy/account/{accountId}/preferencePUTUpdate proxy preferences
/api/proxy/account/{accountId}/disablePOSTDisable proxy for an account
/api/proxy/account/{accountId}/handle-failurePOSTReport and handle proxy failure
/api/proxy/webshare/availableGETGet available Webshare proxies
/api/whatsmyipGETGet client’s IP address as seen by the server

Marketing

EndpointMethodDescription
/api/marketing/send-emailPOSTSend marketing email to audience/users
/api/marketing/sync-usersGET/POSTPreview or sync users to Resend audience
/api/marketing/test-email-simpleGETTest sending emails with basic templates
/api/marketing/templatesGETGet all available email templates
/api/marketing/test-templatePOSTTest a specific email template with sample data

Email Automation (Cron Jobs)

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

EndpointMethodDescription
/api/webhooks/user-createdPOSTWebhook for processing user creation events

Account

EndpointMethodDescription
/api/account/testGETCheck if the account service is operational
/api/account/processPOSTProcess a specific account

Testing

EndpointMethodDescription
/api/test/sync-userGET/POSTTest syncing a single user to Resend

Microservice API

EndpointMethodDescription
/api/testGETHealth check for the microservice
/api/process-account/{accountId}POSTProcess account data through the microservice

Database

EndpointMethodDescription
/rest/v1/accountsGET/POST/PATCH/DELETEAccess accounts data via Supabase API

Authentication

Authentication methods vary:
  1. User Session (JWT via Cookies): Required for most WebApp APIs (/api/fan/*, /api/emoji/*, /api/scripts/*, /api/allowed-features, /api/v2/*, etc.). Obtain token from browser session after login.
  2. Marketing API Key (Header): Required for /api/marketing/send-email, /api/marketing/sync-users. Uses Authorization: Bearer YOUR_MARKETING_API_SECRET.
  3. Testing API Key (Query Param): Required for /api/test/sync-user. Uses ?apiKey=YOUR_MARKETING_SYNC_API_KEY.
  4. Cron API Key (Header): Required for /api/cron/* endpoints. Uses Authorization: Bearer YOUR_CRON_SECRET.
  5. Webhooks: Use signature verification (e.g., Supabase webhooks).

Response Format

All responses are in JSON format. Successful responses typically include relevant data, while error responses include an error message and sometimes additional details.

Success Response Example

{
  "status": "success",
  "data": {
    // Response data specific to the endpoint
  }
}

Error Response Example

{
  "status": "error",
  "error": {
    "code": "validation_error",
    "message": "The 'fanId' parameter is required"
  }
}

Rate Limiting

The service implements internal queue management to prevent rate limiting on external platforms. Please use the API responsibly to avoid overloading the service.

Example Usage

Here’s a simple example of using the API to test an email template:
// Example: Test an email template
fetch('https://onlyautomator.com/api/marketing/test-email-simple?email=test@example.com&template=welcome&firstName=John', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json'
  }
})
.then(response => response.json())
.then(data => {
  console.log('Test result:', data);
})
.catch(error => {
  console.error('Error:', error);
});
Example of using the Chrome Extension API:
// Example: Get subscriber preferences
fetch('https://onlyautomator.com/api/v2/get-preferences?fanId=12345', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_JWT_TOKEN'
  }
})
.then(response => response.json())
.then(data => {
  console.log('Preferences:', data);
})
.catch(error => {
  console.error('Error:', error);
});

Implementation Notes

The API is built using several technologies:
  • Main backend: Next.js
  • Microservice: Express.js and TypeScript
  • Data storage: Supabase (PostgreSQL)
  • Queue system: Better-Queue
  • Chrome Extension: React, TypeScript, and Vite

Future Enhancements

In upcoming versions, we plan to:
  1. Improve documentation with more examples
  2. Add endpoints for automation management
  3. Implement webhooks for more events
  4. Add endpoints for statistics and analytics
  5. Expand Chrome Extension API capabilities
For more detailed information on each endpoint, please refer to their specific documentation pages.