GET
/
api
/
v2
/
account
/
allowed-features
Get Allowed Features
curl --request GET \
  --url https://onlyautomator.com/api/v2/account/allowed-features \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "data": {
    "plan": "pro",
    "planName": "Professional",
    "features": {
      "max_accounts": 123,
      "max_scripts": 123,
      "analytics": true,
      "advanced_analytics": true,
      "automation": true,
      "bulk_messaging": true,
      "scheduled_posts": true,
      "ai_suggestions": true,
      "custom_emojis": true,
      "api_access": true,
      "dedicated_support": true,
      "webhook_integrations": true
    }
  }
}

Get Allowed Features

Returns a list of features and functionalities available to the authenticated user based on their current subscription plan.

Authentication

This endpoint requires authentication via bearer token representing a valid user session managed by Supabase Auth (cookies).Testing Note: Due to the requirement for a live user session, this endpoint cannot be successfully tested directly using the ‘Send’ button in this documentation with a static token.To test:
  1. Call this endpoint from your web application after logging in.
  2. Use curl or a similar tool with a valid, current user JWT obtained from your browser’s session after logging in.
Retrieving JWT Token for Testing: To test endpoints requiring a user session with tools like curl, you need the JWT access token stored by Supabase Auth in your browser.
  1. Log in to your application normally in your browser.
  2. Open Developer Tools (usually F12).
  3. Go to the Application tab (it might be called Storage in Firefox).
  4. Under the Storage section, find Cookies and select your application’s domain (e.g., http://localhost:3000 or https://onlyautomator.com).
  5. Look for a cookie named similar to sb-access-token (the exact name might vary slightly based on Supabase configuration).
  6. Copy the entire value of this cookie. This is your Bearer token.
  7. Use this copied value in the Authorization: Bearer <your_copied_token> header for your curl or other API tool requests.
Note: This token has a limited lifetime and you’ll need to copy a fresh one after it expires.

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer YOUR_JWT_TOKEN

Response

status
number
HTTP status code (e.g., 200).
message
string
A descriptive message about the result (e.g., “Features retrieved successfully”).
features
object
An object containing feature flags and limits available based on the user’s subscription.

Error Codes

Status CodeDescriptionExample Message
401Invalid or missing authentication token.”Not authorized”
404User subscription info not found.”Subscription details not found”
500Internal server error during processing.”Failed to retrieve features”

Code Examples

// Using fetch
const getAllowedFeatures = async (apiToken) => {
  const response = await fetch(`https://onlyautomator.com/api/v2/account/allowed-features`, {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${apiToken}`
    }
  });

  if (!response.ok) {
     const errorData = await response.json();
     throw new Error(`API Error (${response.status}): ${errorData.error || 'Unknown error'}`);
  }
  return await response.json();
};

// Example usage
getAllowedFeatures('your_api_token')
  .then(data => {
    console.log('Subscription plan:', data.features.plan);
    console.log('Can use automation:', data.features.can_use_automation);
    console.log('Accounts limit:', data.features.accounts_limit);
  })
  .catch(error => console.error('Error fetching features:', error));

Notes

  • The response includes feature flags and limits that correspond to the user’s current subscription plan.
  • This endpoint is useful for client applications to enable/disable UI elements based on the user’s subscription.
  • The features returned may change as new functionality is added to the platform or subscription plans are modified.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token for authentication (JWT)

Response

Allowed features retrieved successfully.

status
string
Example:

"success"

data
object

An object describing the allowed features based on the user's plan.