Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MatthewSabia1/SubPirate-Pro/llms.txt
Use this file to discover all available pages before exploring further.
Overview
These endpoints allow administrators to view and update subscription plan configurations. Access is restricted to users with theis_admin flag set to true in their profile.
Authentication
All admin endpoints require:- Valid authentication via Bearer token (Supabase JWT)
- Admin privileges - user must have
is_admin = truein theprofilestable
Admin Authentication Example
Get All Plans
Retrieve all subscription plans including hidden plans
Request
Response
Returns all plans from theplan_definitions table, ordered by sort_order.
Array of plan definition objects
Plan tier identifier (e.g.,
"free", "pro", "enterprise")Display name of the plan
Plan description text
Monthly price in cents (e.g.,
2900 for $29.00)Annual price in cents
Maximum subreddit analyses allowed per month
Maximum connected Reddit accounts
Maximum active campaigns
Maximum projects
Whether AI posting scheduler is enabled
Whether advanced competitor dashboard is enabled
Whether team collaboration features are enabled
Array of feature descriptions for display
Badge text (e.g.,
"Most Popular")Call-to-action button text
Call-to-action URL
Whether this plan requires contacting sales
Whether plan is visible to public users
Display order (lower numbers first)
Success Response (200)
Update Plan
Update an existing subscription plan
Path Parameters
The tier identifier of the plan to update (e.g.,
"pro", "enterprise")Request Body
Provide only the fields you want to update. All fields are optional.Plan display name
Plan description
Monthly price in cents
Annual price in cents
Maximum analyses per month
Maximum Reddit accounts
Maximum campaigns
Maximum projects
Enable AI posting scheduler
Enable advanced competitor dashboard
Enable team collaboration features
Array of feature strings for display
Badge text (e.g., “Most Popular”)
Call-to-action button text
Call-to-action URL
Whether plan requires contacting sales
Whether plan is visible to public
Display order
Request Example
Response
Returns the updated plan object.The updated plan definition object with all fields
Success Response (200)
Error Responses
401 Unauthorized
Returned when no valid authentication token is provided.403 Forbidden
Returned when the authenticated user does not have admin privileges.400 Bad Request
Returned when the request is malformed or missing required parameters.404 Not Found
Returned when attempting to update a plan tier that doesn’t exist.500 Internal Server Error
Notes
- The
tierfield cannot be changed via this endpoint (it’s the primary key) - The
updated_attimestamp is automatically set when updating a plan - Changes to plan definitions affect all users immediately
- Consider caching implications when updating pricing or limits
- Always test changes in a non-production environment first
Security Considerations
- Admin endpoints use the service role Supabase client to bypass RLS
- Ensure the
is_adminflag in theprofilestable is properly secured - Audit all admin actions for compliance and security monitoring
- Implement additional logging for plan changes in production