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.| Endpoint | Method | Description |
|---|---|---|
/api/v2/account-connect | POST | Connect an OnlyFans account to the platform |
/api/v2/get-account | GET | Retrieve connected OnlyFans account information and status |
/api/v2/get-profile | GET | Get detailed profile information and metrics for the account |
/api/v2/account/allowed-features | GET | Get features allowed by the authenticated user’s plan |
/api/v2/update-note | POST | Create or update a CRM note for a specific subscriber (fan) |
/api/v2/update-of-note | POST | Synchronize a note from the OnlyFans platform to the CRM |
/api/v2/update-preference | POST | Update or create preference information for a subscriber |
/api/v2/sync-notes | POST | Synchronize all notes for a subscriber with the backend |
/api/v2/update-country | POST | Update country information for a subscriber |
/api/v2/get-ppv-statistics | GET | Retrieve pay-per-view (PPV) message performance metrics |
/api/v2/get-preferences | GET | Get all preferences recorded for a specific subscriber |
/api/v2/get-transactions | GET | Get transaction history for a specific subscriber |
Proxy Management API
Endpoints for managing and utilizing proxy configurations.| Endpoint | Method | Description |
|---|---|---|
/api/proxy/account/{accountId} | GET | Get current proxy configuration for a specific account |
/api/proxy/account/{accountId}/assign-auto | POST | Automatically assign or update a Webshare proxy for an account |
/api/proxy/account/{accountId}/set-manual | POST | Manually set or update proxy configuration for an account |
/api/proxy/account/{accountId}/preference | PUT | Update proxy preferences (e.g., region, active state) for an account |
/api/proxy/account/{accountId}/disable | POST | Disable proxy usage for an account |
/api/proxy/account/{accountId}/handle-failure | POST | Report a proxy failure and potentially trigger reassignment |
/api/proxy/test-connectivity | POST | Test connectivity of a given proxy configuration |
/api/proxy/webshare/available | GET | Get available Webshare proxies from the pool (Admin/Internal) |
/api/proxy/webshare/available-countries | GET | Get list of countries where Webshare proxies are available |
/api/proxy/webshare/available-cities | GET | Get list of cities for a country where Webshare proxies are available |
/api/whatsmyip | GET | Get 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.| Endpoint | Method | Description |
|---|---|---|
/api/fan/get | GET | Get details for a specific fan |
/api/get-emojis | GET | Get the authenticated user’s custom emoji settings |
/api/create-emoji | POST | Create or update the user’s custom emoji setting |
/api/get-scripts | GET | Get all automation scripts for the authenticated user |
/api/create-script | POST | Create a new automation script |
Marketing API
Endpoints for email marketing and user synchronization.| Endpoint | Method | Description |
|---|---|---|
/api/marketing/sync-users | POST | Synchronize users with email marketing platforms (bulk) |
/api/marketing/sync-user | POST | Synchronize an individual user with marketing platforms |
/api/marketing/test-email-simple | GET | Test sending emails using predefined basic templates |
/api/marketing/templates | GET/POST | Get, create, and manage email templates |
/api/marketing/test-template | POST | Test a specific email template with sample data |
Email Automation (Cron Jobs)
Scheduled tasks for automated email delivery, typically triggered internally.| Endpoint | Method | Description |
|---|---|---|
/api/cron/send-welcome-email | GET | Send welcome email to new users |
/api/cron/send-login-email | GET | Send login reminder emails to users |
/api/cron/send-feedback-email | GET | Send feedback request emails |
/api/cron/send-account-setup-email | GET | Send account setup reminder emails |
Webhooks
Endpoints for receiving events from external services.| Endpoint | Method | Description |
|---|---|---|
/api/webhooks/user-created | POST | Process user creation events (e.g., from Supabase Auth) |
Account Service API (V1 Legacy & General)
General account-related operations.| Endpoint | Method | Description |
|---|---|---|
/api/account/test | GET | Check if the main account service is operational |
/v1/accounts/{id}/process | POST | Process data for an OnlyFans account (V1 API) |
Testing Endpoints
Utility endpoints for testing specific functionalities.| Endpoint | Method | Description |
|---|---|---|
/api/test/sync-user | POST | Test synchronizing a single user with marketing platforms |
Microservice API
Endpoints specific to the backend microservice operations.| Endpoint | Method | Description |
|---|---|---|
/api/test | GET | Health check for the microservice |
/api/process-account/{accountId} | POST | Manually trigger data scraping for a specific account |
Supabase Database API
Direct interaction with the Supabase database via its PostgREST API.| Endpoint | Method | Description |
|---|---|---|
/rest/v1/accounts | GET/POST/PATCH/DELETE | Access and manage account records in the database |
Authentication
Authentication mechanisms depend on the endpoint being accessed:- 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 theAuthorizationheader. - Marketing API Key (Header): Required for some marketing endpoints like
/api/marketing/sync-usersand/api/marketing/test-template(if specific internal logic applies, otherwise JWT). Indicated bymarketingApiKeyin OpenAPI security schemes. - Testing API Key (Query Param): Used for
/api/test/sync-user. The keyapiKeyis passed in the query string. - Cron API Key (Header): Endpoints under
/api/cron/*require a specificAuthorization: Bearer YOUR_CRON_SECRET. - Supabase API Key (Header): Endpoints under
/rest/v1/*require the Supabaseapikeyin the header. - Webhooks: Typically secured via signature verification (e.g., Supabase webhooks check a secret).
Response Format
All API responses are in JSON format.Success Response Example
A successful operation usually returns a2xx HTTP status code. The body structure can vary, but often includes a success or status field and a data object.
Error Response Example
Error responses use4xx or 5xx HTTP status codes and typically follow this structure, as defined by ErrorResponse in the OpenAPI schema:
/api/proxy/account/{accountId}/disable if account 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)
Getting Subscriber Preferences (Extension API v2 - GET)
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.