Skip to main content

Quick Reference Guide

Cheat sheets and common lookup tables for daily use


πŸš€ Most Common Lookups​

Ad Status Quick Reference​

StatusMeaningUser Action
βœ… ACTIVERunning normallyNone needed
⏸️ PAUSEDManually pausedUnpause when ready
❌ DISAPPROVEDPolicy violationReview & fix
⚠️ WITH_ISSUESDelivery problemsCheck targeting
πŸ”„ PENDING_REVIEWAwaiting Meta reviewWait
πŸ’³ PENDING_BILLING_INFOPayment neededAdd payment

ComplyAI Status Quick Reference​

StatusMeaningNext Step
πŸ†• OpenNew disapproved adReview violation
✏️ Edit RequiredChanges neededMake edits
πŸ“€ AppealedAppeal submittedWait for Meta
πŸ† Appeal WonAppeal successfulπŸŽ‰ Done!
❌ Appeal LostAppeal rejectedTry editing
πŸ“ Rejected ArchiveArchivedNo action

Score Interpretation​

Score RangeRisk LevelColorRecommendation
90-100🟒 LowGreenGood to go
70-89🟑 MediumYellowReview suggested
50-69🟠 HighOrangeChanges needed
0-49πŸ”΄ CriticalRedMajor issues

πŸ“Š Account Status Codes​

Meta Account Status​

CodeStatusDescription
1ActiveAccount is active
2DisabledAccount disabled
3UnsettledPayment issues
7Pending ReviewUnder Meta review
8Pending ClosureBeing closed
9In Grace PeriodTemporary hold
100Pending Risk ReviewRisk assessment
101Pending SettlementAwaiting 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​

TableServicePurpose
userscoreUser accounts
organizationscoreCustomer companies
org_business_accountscoreConnected BMs
org_ad_accountscoreConnected ad accounts
org_adscoreAd data
org_ads_scorecoreCompliance scores
facebook_ad_statuscoreComplyAI status
ad_accountsapiDetailed ad account data
activity_eventscoreAudit 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​

RoleView AdsEdit AdsManage UsersAdmin
adminβœ…βœ…βœ…βœ…
clientβœ…βœ…βŒβŒ
developerβœ…βœ…βŒβŒ
viewerβœ…βŒβŒβŒ

πŸ“… Scheduled Tasks​

TaskFrequencyServicePurpose
Sync ad accountsEvery 15 minapiGet new accounts
Sync ad dataEvery 30 minapiUpdate ad creative
Update stale statusDailycoreClean up old statuses
Database backupDaily 2aminfraBackup PostgreSQL
Token refreshWeeklycoreRefresh expiring tokens

🌐 Environment URLs​

EnvironmentFrontendCore APIMain API
Productionapp.gocomply.aicore.gocomply.aiapi.gocomply.ai
Stagingstaging.gocomply.aistaging-core.gocomply.aistaging-api.gocomply.ai
Locallocalhost:3000localhost:5000localhost: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​

CodeMeaning
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate Limited
500Server Error

πŸ› οΈ Troubleshooting Quick Fixes​

ProblemQuick Fix
Token expiredRefresh via BM settings
Webhook not firingCheck subscription status
Missing ad dataForce sync task
Slow dashboardCheck DB connections
500 errorsCheck logs, restart service

πŸ“ Changelog​

DateChange
2024-12Initial quick reference