Quick Reference Guide
Cheat sheets and common lookup tables for daily use
π Most Common Lookupsβ
Ad Status Quick Referenceβ
| Status | Meaning | User Action |
|---|---|---|
β
ACTIVE | Running normally | None needed |
βΈοΈ PAUSED | Manually paused | Unpause when ready |
β DISAPPROVED | Policy violation | Review & fix |
β οΈ WITH_ISSUES | Delivery problems | Check targeting |
π PENDING_REVIEW | Awaiting Meta review | Wait |
π³ PENDING_BILLING_INFO | Payment needed | Add payment |
ComplyAI Status Quick Referenceβ
| Status | Meaning | Next Step |
|---|---|---|
π Open | New disapproved ad | Review violation |
βοΈ Edit Required | Changes needed | Make edits |
π€ Appealed | Appeal submitted | Wait for Meta |
π Appeal Won | Appeal successful | π Done! |
β Appeal Lost | Appeal rejected | Try editing |
π Rejected Archive | Archived | No action |
Score Interpretationβ
| Score Range | Risk Level | Color | Recommendation |
|---|---|---|---|
| 90-100 | π’ Low | Green | Good to go |
| 70-89 | π‘ Medium | Yellow | Review suggested |
| 50-69 | π High | Orange | Changes needed |
| 0-49 | π΄ Critical | Red | Major issues |
π Account Status Codesβ
Meta Account Statusβ
| Code | Status | Description |
|---|---|---|
| 1 | Active | Account is active |
| 2 | Disabled | Account disabled |
| 3 | Unsettled | Payment issues |
| 7 | Pending Review | Under Meta review |
| 8 | Pending Closure | Being closed |
| 9 | In Grace Period | Temporary hold |
| 100 | Pending Risk Review | Risk assessment |
| 101 | Pending Settlement | Awaiting payment |
π Common API Endpointsβ
Core API (Port 5000)β
GET /orgs/ β List organizations
GET /adaccounts/ β List ad accounts
GET /ads/ β List ads
GET /notifications/ β List notifications
POST /auth/login β User login
PUT /user/update β Update profile
Main API (Port 5001)β
POST /bm_tokens β Get BM tokens
POST /dynamic_status β Update ad status
GET /adaccounts/ β Ad account data
POST /core_ad_accounts β Get core accounts
Maestro (Port 5002)β
POST /webhook/meta β Meta webhook
GET /results/{task_id} β ML results
POST /analyze/media β Analyze media
ποΈ Database Quick Referenceβ
Most Used Tablesβ
| Table | Service | Purpose |
|---|---|---|
users | core | User accounts |
organizations | core | Customer companies |
org_business_accounts | core | Connected BMs |
org_ad_accounts | core | Connected ad accounts |
org_ads | core | Ad data |
org_ads_score | core | Compliance scores |
facebook_ad_status | core | ComplyAI status |
ad_accounts | api | Detailed ad account data |
activity_events | core | Audit log |
Common Queriesβ
-- Get all active organizations
SELECT * FROM organizations WHERE active = true;
-- Get ads for an organization
SELECT a.*
FROM org_ads a
JOIN org_ad_accounts aa ON a.org_ad_account_id = aa.id
JOIN org_business_accounts ba ON aa.org_business_account_id = ba.id
WHERE ba.organization_id = {org_id};
-- Get disapproved ads with scores
SELECT a.facebook_id, a.name, s.score, s.text_score, s.media_score
FROM org_ads a
JOIN org_ads_score s ON a.id = s.db_ad_id
WHERE a.effective_status = 'DISAPPROVED';
-- Get recent activity
SELECT * FROM activity_events
ORDER BY created_time DESC
LIMIT 50;
π Role Permissionsβ
| Role | View Ads | Edit Ads | Manage Users | Admin |
|---|---|---|---|---|
admin | β | β | β | β |
client | β | β | β | β |
developer | β | β | β | β |
viewer | β | β | β | β |
π Scheduled Tasksβ
| Task | Frequency | Service | Purpose |
|---|---|---|---|
| Sync ad accounts | Every 15 min | api | Get new accounts |
| Sync ad data | Every 30 min | api | Update ad creative |
| Update stale status | Daily | core | Clean up old statuses |
| Database backup | Daily 2am | infra | Backup PostgreSQL |
| Token refresh | Weekly | core | Refresh expiring tokens |
π Environment URLsβ
| Environment | Frontend | Core API | Main API |
|---|---|---|---|
| Production | app.gocomply.ai | core.gocomply.ai | api.gocomply.ai |
| Staging | staging.gocomply.ai | staging-core.gocomply.ai | staging-api.gocomply.ai |
| Local | localhost:3000 | localhost:5000 | localhost:5001 |
π Meta API Field Referenceβ
Common Ad Fieldsβ
id, name, status, effective_status,
account_id, campaign_id, adset_id,
created_time, updated_time,
creative{id,title,body,image_url,video_id}
Common Ad Account Fieldsβ
id, name, account_status, currency,
amount_spent, balance, spend_cap,
business_city, business_country_code,
funding_source, created_time
Common Business Manager Fieldsβ
id, name, permitted_roles,
created_time, primary_page
β‘ Quick Actionsβ
Check if token is validβ
curl "https://graph.facebook.com/debug_token?input_token={TOKEN}&access_token={APP_TOKEN}"
Test webhook endpointβ
curl -X POST "https://api.gocomply.ai/webhook/meta" \
-H "Content-Type: application/json" \
-d '{"test": true}'
Force sync an ad accountβ
from app.tasks import fetch_ad_account_data
fetch_ad_account_data.delay("act_123456789")
Check Celery queue statusβ
celery -A worker inspect active
celery -A worker inspect reserved
π± Mobile Response Codesβ
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
π οΈ Troubleshooting Quick Fixesβ
| Problem | Quick Fix |
|---|---|
| Token expired | Refresh via BM settings |
| Webhook not firing | Check subscription status |
| Missing ad data | Force sync task |
| Slow dashboard | Check DB connections |
| 500 errors | Check logs, restart service |
π Changelogβ
| Date | Change |
|---|---|
| 2024-12 | Initial quick reference |