POST
/
api
/
process-account
/
{accountId}
Process Account
curl --request POST \
  --url https://onlyautomator.com/api/process-account/{accountId}
{
  "message": "Started processing",
  "data": {
    "id": "123",
    "username": "creator_username",
    "name": "Creator Name",
    "user_id": "user_abc123",
    "web_cookies": {
      "key": "value"
    },
    "web_local_storage": {
      "key": "value"
    },
    "web_session_storage": {
      "key": "value"
    },
    "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X)..."
  }
}
Initiates the scraping and data collection process for a specific account. This endpoint adds the account to a processing queue where it will be handled asynchronously.

Security

Security Alert: This endpoint, as currently documented, does not require authentication. Exposing it publicly without protection could allow anyone to trigger processing tasks for any account ID, potentially leading to resource exhaustion or abuse.Recommendation: Implement robust authentication/authorization for this endpoint in production. Options include:
  • API Key: Require a secret API key in the request header.
  • Internal Token: Use a specific service-to-service token.
  • IP Whitelisting: Restrict access to trusted IP addresses (e.g., internal services).
  • User Authentication (if applicable): If only logged-in users should trigger this, implement standard JWT/session authentication.
Do not deploy this endpoint without appropriate security measures.
API Playground Issue? If you encounter issues with the API playground, you can test directly with cURL or Postman:
# Local development
curl -X POST http://localhost:3000/api/process-account/123

# Alternative local
curl -X POST http://localhost:3001/api/process-account/123

# Production
curl -X POST https://onlyautomator.com/api/process-account/123

Path Parameters

accountId
string
required
The unique identifier of the account to process in the database

Response

message
string
Confirmation message that processing has started
data
object
The account data that was queued for processing

201 Created

{
  "message": "Started processing",
  "data": {
    "id": "123",
    "username": "creator_username",
    "name": "Creator Name",
    "user_id": "user_abc123",
    "web_cookies": { "..." },
    "web_local_storage": { "..." },
    "web_session_storage": { "..." },
    "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X)..."
  }
}

404 Not Found

{
  "message": "Account not found"
}

500 Server Error

{
  "message": "Server error"
}

Implementation Details

This endpoint creates a processing task in one of multiple load-balanced queues. The system uses a round-robin approach to distribute tasks across queues to prevent rate limiting and resource exhaustion. The account must already have authentication data (cookies, localStorage, and sessionStorage) stored in the database. This data is typically collected using the OnlyAutomator Chrome Extension.
// Example URLs:
// - Local development: http://localhost:3000/api/process-account/123
// - Alternative local: http://localhost:3001/api/process-account/123
// - Production: https://onlyautomator.com/api/process-account/123

// Example of how to call this endpoint
const processAccount = async (accountId) => {
  try {
    const baseUrl = 'http://localhost:3000'; // or 'https://onlyautomator.com'
    const response = await fetch(`${baseUrl}/api/process-account/${accountId}`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      }
    });
    
    const data = await response.json();
    console.log('Processing started:', data);
    return data;
  } catch (error) {
    console.error('Error processing account:', error);
    throw error;
  }
};

Path Parameters

accountId
string
required

The unique identifier of the account to process

Response

Account processing started

message
string
Example:

"Started processing"

data
object