Campaigns API ============= The Campaigns API provides endpoints for managing marketing campaigns, tasks, and related functionality. App Endpoints ------------- .. note:: Please note that App Endpoints are not available through the API. They require an application to be created in the backend admin, this application will retrieve full views using a client id and secret, not structured data. Get Leaderboard ~~~~~~~~~~~~~~~ Retrieve the leaderboard for campaigns. .. http:post:: /api/get/leaderboard/ **Request Body:** .. code-block:: text campaign_id=123 **Response:** .. code-block:: json { "leaderboard": [ { "user_id": 456, "username": "influencer1", "score": 1500, "rank": 1, "completed_tasks": 15 } ] } Get Campaigns ~~~~~~~~~~~~~ Retrieve a list of available campaigns. .. http:post:: /api/get/campaigns/ **Request Body:** .. code-block:: text filter=active category=fashion network=instagram **Response:** .. code-block:: json { "campaigns": [ { "id": 123, "type": "influencer", "name": "Summer Fashion Campaign", "tagline": "Show off your summer style", "description": "Promote our latest summer collection", "image_logo": "https://example.com/logo.jpg", "image_post": "https://example.com/post.jpg", "hashtags": ["#summer", "#fashion"], "date_end": { "year": 2024, "month": 8, "day": 31, "hour": 23, "minute": 59, "second": 59 }, "networks": ["instagram", "facebook"], "currency": "USD", "tasks": { "time": 72, "time_type": "hours", "bonus": { "active": true, "promo_reach": 50, "promo_engagement_rate": 25, "promo_best_post": 100 }, "minimum_reward": 25 }, "tasks_featured": true, "tasks_leaderboard": true } ] } Get Campaign ~~~~~~~~~~~~ Retrieve detailed information about a specific campaign. .. http:post:: /api/get/campaign/ **Request Body:** .. code-block:: text id=123 **Response:** .. code-block:: json { "id": 123, "type": "influencer", "name": "Summer Fashion Campaign", "tagline": "Show off your summer style", "description": "Promote our latest summer collection", "image_logo": "https://example.com/logo.jpg", "image_post": "https://example.com/post.jpg", "hashtags": ["#summer", "#fashion"], "date_end": { "year": 2024, "month": 8, "day": 31, "hour": 23, "minute": 59, "second": 59 }, "networks": ["instagram", "facebook"], "currency": "USD", "tasks": { "time": 72, "time_type": "hours", "bonus": { "active": true, "promo_reach": 50, "promo_engagement_rate": 25, "promo_best_post": 100 }, "minimum_reward": 25 }, "tasks_featured": true, "tasks_leaderboard": true, "publisher": { "social_users_available": { "instagram": true, "facebook": false }, "social_pages_available": { "instagram": true, "facebook": true }, "social_walls_available": { "instagram": false, "facebook": true }, "social_channels_available": { "instagram": false, "facebook": false } }, "attachment": "https://example.com/attachment.pdf" } Get Tasks ~~~~~~~~~ Retrieve tasks for a specific campaign. .. http:post:: /api/get/tasks/ **Request Body:** .. code-block:: text campaign_id=123 **Response:** .. code-block:: json { "tasks": [ { "id": 456, "type": "post", "title": "Create Instagram Post", "description": "Post about our summer collection", "requirements": "Include hashtags and tag our brand", "deadline": "2024-08-31T23:59:59Z", "status": "pending", "bonus": { "reach": 50, "engagement_rate": 25, "best_post": 100 }, "payments": { "minimum": 25, "post": 30, "total": 30 }, "info": { "title": "Task Requirements", "content": "Detailed task requirements..." }, "campaign": { "id": 123, "name": "Summer Fashion Campaign", "type": "influencer", "tagline": "Show off your summer style", "description": "Promote our latest summer collection", "image_logo": "https://example.com/logo.jpg", "image_post": "https://example.com/post.jpg", "hashtags": ["#summer", "#fashion"], "date_end": { "year": 2024, "month": 8, "day": 31, "hour": 23, "minute": 59, "second": 59 }, "date_end_text": "August 31, 2024 - 23:59:59", "networks": ["instagram", "facebook"], "currency": "USD" } } ] } Campaign Actions ~~~~~~~~~~~~~~~~ Join Campaign ^^^^^^^^^^^^^ Join a campaign as an influencer. .. http:post:: /api/action/campaign/join/ **Request Body:** .. code-block:: json { "campaign_id": 123 } **Response:** .. code-block:: json { "status": "success", "message": "Successfully joined campaign" } Task Actions ~~~~~~~~~~~~ Complete Task ^^^^^^^^^^^^^ Mark a task as completed. .. http:post:: /api/action/task/complete/ **Request Body:** .. code-block:: text task_id=456 post_url=https://instagram.com/p/example screenshots=https://example.com/screenshot1.jpg **Response:** .. code-block:: json { "status": "success", "message": "Task completed successfully", "payment": 30 } Leave Task ^^^^^^^^^^ Leave a task (cancel participation). .. http:post:: /api/action/task/leave/ **Request Body:** .. code-block:: text task_id=456 **Response:** .. code-block:: json { "status": "success", "message": "Task left successfully" } Network Approval ^^^^^^^^^^^^^^^^ Submit network for approval. .. http:post:: /api/action/network/approval/ **Request Body:** .. code-block:: text network_type=instagram network_id=user123 network_url=https://instagram.com/user123 **Response:** .. code-block:: json { "status": "success", "message": "Network submitted for approval" } Public Campaigns ~~~~~~~~~~~~~~~~ Get Public Campaigns ^^^^^^^^^^^^^^^^^^^^^ Retrieve public campaigns (no authentication required). .. http:post:: /api/get/public/campaigns/ **Request Body:** .. code-block:: text filter=active category=fashion **Response:** .. code-block:: json { "campaigns": [ { "id": 123, "name": "Summer Fashion Campaign", "tagline": "Show off your summer style", "image_logo": "https://example.com/logo.jpg", "networks": ["instagram", "facebook"], "currency": "USD", "minimum_reward": 25 } ] } Backend Endpoints ----------------- .. note:: Backend Endpoints are available through the API with a Bearer token. Campaigns List ~~~~~~~~~~~~~~ Get All Campaigns ^^^^^^^^^^^^^^^^^ Retrieve a list of all campaigns with detailed information. .. http:post:: /api/campaigns/ **Request Body:** This endpoint accepts one of three mutually exclusive parameter options: **Option 1: Filter by Advertiser** .. code-block:: text advertiser_id=1 Returns all campaigns created by the specified advertiser. **Option 2: Filter by User** .. code-block:: text user_id=149 Returns all campaigns available to the specified user. **Option 3: All Campaigns** .. code-block:: text (No parameters) Returns all campaigns in the system. .. note:: Only one parameter option can be used at a time. If multiple parameters are provided, the behavior is advertiser takes precedence. **Response:** .. code-block:: json [ { "id": 1, "type": "standard", "name": "campaign name", "tagline": "Tagline", "description": "

Test descriptions for the show us your pet campaign

Requirements

", "image_logo": "/static/media/campaigns/advertiser_1/2025-07-14__08-07-06__bdefault_campaign_base.jpg", "image_post": "/static/media/campaigns/advertiser_1/2025-07-14__08-07-06__bistockphoto-536315459-612x612.jpg", "hashtags": [ "hashtag" ], "date_end": { "year": 2025, "month": 7, "day": 16, "hour": 16, "minute": 14, "second": 34 }, "networks": [ "facebook", "instagram" ], "currency": "USD", "tasks": { "time": 24, "time_type": "hours", "bonus": { "active": true, "promo_reach": 0.0, "promo_engagement_rate": 0.0, "promo_best_post": 0.0 }, "minimum_reward": 100.0 }, "tasks_featured": [], "tasks_leaderboard": [], "publisher": { "social_users_available": {}, "social_pages_available": {}, "social_walls_available": {}, "social_channels_available": {}, "social_extras_available": {} } } ] Task List ~~~~~~~~~ Retrieve a list of all tasks for a specific campaign. .. http:post:: /api/tasks/ **Request Body:** ** Option 1: Filter by Campaign** .. code-block:: text campaign_id=123 Returns all tasks for the specified campaign. ** Option 2: Filter by Advertiser** .. code-block:: text advertiser_id=1 Returns all tasks for the specified advertiser. ** Option 2: Filter by Status** .. code-block:: text status=rejected status=accepted status=pending status=under_review status=paid Returns all tasks with the specified status. ** Option 4: All Tasks** .. code-block:: text (No parameters) Returns all tasks in the system. .. note:: Only one parameter option can be used at a time. If multiple parameters are provided, the behavior is advertiser takes precedence. **Response:** .. code-block:: json [ { "id": 13, "type": "Profile: John Smith", "networks": [ "facebook" ], "status": "accepted", "status_name": "Accepted", "media": { "url": "https://domain.com/static/media/campaigns/advertiser_1/campaign_30_task_13__518399733_455624556235_6872532075791311775_n.jpg", "link": "https://www.facebook.com/455624556235/posts/10166012740139478" }, "allow_complete": false, "allow_leave": false, "allow_countdown": false, "allow_payments": true, "allow_bonus": false, "is_disabled": true, "is_allowed_complete": false, "date_completed_minimum": "July 07, 2025 - 20:11:08", "date_completed_maximum": "July 07, 2025 - 20:11:06", "date_end": { "year": 2025, "month": 7, "day": 23, "hour": 20, "minute": 10, "second": 6 }, "bonus": { "reach": false, "engagement_rate": false, "best_post": false }, "payments": { "minimum": 2.82, "post": 0.0, "total": 0.0 }, "campaign": { "id": 30, "name": "#Fridayvibes", "type": "standard", "tagline": "Friday Vibes", "description": "

Requirements:


", "image_logo": "https://domain.com/static/media/campaigns/advertiser_1/2025-07-22__11-07-37__bfri2.jpg", "image_post": "https://domain.com/static/media/campaigns/advertiser_1/2025-07-22__11-07-37__bfday.jpg", "hashtags": [ "Fridayvibes" ], "date_end": { "year": 2025, "month": 7, "day": 30, "hour": 19, "minute": -1, "second": 0 }, "date_end_text": "July 07, 2025 - 19:00:00", "networks": [ "facebook" ], "currency": "USD", "tasks": { "bonus": { "active": true, "promo_reach": 0.0, "promo_engagement_rate": 0.0, "promo_best_post": 0.0 }, "minimum_reward": 2.82 } } } ] Advertiser id ^^^^^^^^^^^^^ Retrieve the advertiser id using the email address. .. http:post:: /api/advertiser/check/ **Request Body:** .. code-block:: text email=advertiser_dev@taglife.dev **Response:** .. code-block:: json { "id": 1, "message": "Advertiser already exists" } User id ^^^^^^^^ Retrieve the user id using the email address. .. http:post:: /api/user/check/ **Request Body:** .. code-block:: text email=user@example.com **Response:** .. code-block:: json { "id": 123, "message": "User already exists" } Advertiser Statistics ~~~~~~~~~~~~~~~~~~~~~ Financial Statistics ^^^^^^^^^^^^^^^^^^^^^ .. http:post:: /api/advertiser/stats/financial/ **Request Body:** .. code-block:: text advertiser_id=123 date_from=2024-01-01 date_to=2024-12-31 **Response:** .. code-block:: json { "total_spent": 5000, "total_campaigns": 10, "average_cpm": 25, "currency": "USD" } Maximum Limit ^^^^^^^^^^^^^ .. http:post:: /api/advertiser/maximum-limit/ **Request Body:** .. code-block:: text advertiser_id=123 **Response:** .. code-block:: json { "maximum_limit": 10000, "currency": "USD" } Invoices ^^^^^^^^ .. http:post:: /api/advertiser/invoices/ **Request Body:** .. code-block:: text advertiser_id=123 invoice_status=paid date_from=2024-01-01 date_to=2024-12-31 **Response:** .. code-block:: json { "invoices": [ { "id": 789, "amount": 500, "currency": "USD", "date": "2024-08-01", "status": "paid" } ] } Campaign Statistics ~~~~~~~~~~~~~~~~~~~ General Statistics ^^^^^^^^^^^^^^^^^^ .. http:post:: /api/campaigns/stats/general/ **Request Body:** .. code-block:: json { "date_from": "2024-01-01", "date_to": "2024-12-31" } **Response:** .. code-block:: json { "total_campaigns": 50, "active_campaigns": 15, "completed_campaigns": 30, "pending_campaigns": 5 } Status Statistics ^^^^^^^^^^^^^^^^^ .. http:post:: /api/campaigns/stats/status/ **Response:** .. code-block:: json { "draft": 5, "pending": 10, "active": 15, "paused": 3, "completed": 30, "cancelled": 2 } Network Statistics ^^^^^^^^^^^^^^^^^^ .. http:post:: /api/campaigns/stats/networks/ **Response:** .. code-block:: json { "instagram": 25, "facebook": 20, "twitter": 10, "tiktok": 5 } Single Campaign Statistics ~~~~~~~~~~~~~~~~~~~~~~~~~~ Network Statistics ^^^^^^^^^^^^^^^^^^ .. http:post:: /api/campaign/stats/networks/ **Request Body:** .. code-block:: text campaign_id=123 **Response:** .. code-block:: json { "instagram": { "posts": 50, "reach": 10000, "engagement": 500 }, "facebook": { "posts": 30, "reach": 8000, "engagement": 400 } } Cost Statistics ^^^^^^^^^^^^^^^ .. http:post:: /api/campaign/stats/costs/ **Request Body:** .. code-block:: text campaign_id=123 **Response:** .. code-block:: json { "total_spent": 2500, "average_cpm": 25, "currency": "USD" } Campaign Management ~~~~~~~~~~~~~~~~~~~ Settings ^^^^^^^^ .. http:post:: /api/campaign/settings/ **Request Body:** .. code-block:: text campaign_id=123&settings[post_rate]=30&settings[has_bonus]=true&settings[promo_reach_bonus]=50 **Response:** .. code-block:: json { "status": "success", "message": "Settings updated successfully" } Status ^^^^^^ .. http:post:: /api/campaign/status/ **Request Body:** .. code-block:: text campaign_id=123&status=active **Response:** .. code-block:: json { "status": "success", "message": "Campaign status updated" } Pre-register ^^^^^^^^^^^^ .. http:post:: /api/campaign/pre-register/ **Request Body:** .. code-block:: text campaign_id=123 **Response:** .. code-block:: json { "status": "success", "message": "Campaign pre-registered" } Post-register ^^^^^^^^^^^^^ .. http:post:: /api/campaign/post-register/ **Request Body:** .. code-block:: text campaign_id=123 **Response:** .. code-block:: json { "status": "success", "message": "Campaign post-registered" } Publisher Statistics ~~~~~~~~~~~~~~~~~~~~ Status Statistics ^^^^^^^^^^^^^^^^^ .. http:post:: /api/publishers/stats/status/ **Response:** .. code-block:: json { "active": 150, "inactive": 50, "suspended": 10 } Activity Statistics ^^^^^^^^^^^^^^^^^^^ .. http:post:: /api/publishers/stats/activity/ **Request Body:** .. code-block:: text date_from=2024-01-01 date_to=2024-12-31 **Response:** .. code-block:: json { "total_posts": 500, "total_reach": 100000, "total_engagement": 5000 } User Management ~~~~~~~~~~~~~~~~ Status ^^^^^^^ .. http:post:: /api/user/status/ **Request Body:** .. code-block:: text user_id=456 **Response:** .. code-block:: json { "status": "active", "joined_date": "2024-01-01", "total_campaigns": 10 } Ban Status ^^^^^^^^^^ .. http:post:: /api/user/status/ban/ **Request Body:** .. code-block:: text user_id=456 banned=true reason=Violation of terms **Response:** .. code-block:: json { "status": "success", "message": "User ban status updated" } Notifications ^^^^^^^^^^^^^ .. http:post:: /api/user/notification/ **Request Body:** .. code-block:: text user_id=456 message=New campaign available type=campaign **Response:** .. code-block:: json { "status": "success", "message": "Notification sent" } Force Logout ^^^^^^^^^^^^ .. http:post:: /api/user/force-logout/ **Request Body:** .. code-block:: text user_id=456 **Response:** .. code-block:: json { "status": "success", "message": "User logged out" } Custom Social Wall ^^^^^^^^^^^^^^^^^^ .. http:post:: /api/user/add-custom-social-wall/ **Request Body:** .. code-block:: text user_id=456 wall_url=https://example.com/wall network=instagram **Response:** .. code-block:: json { "status": "success", "message": "Custom social wall added" } Task Management ~~~~~~~~~~~~~~~ Status ^^^^^^^ .. http:post:: /api/task/status/ **Request Body:** .. code-block:: text task_id=456 **Response:** .. code-block:: json { "status": "pending", "assigned_date": "2024-08-01", "deadline": "2024-08-31" } Payments ^^^^^^^^ .. http:post:: /api/task/payments/ **Request Body:** .. code-block:: text task_id=456 **Response:** .. code-block:: json { "payment": 30, "payment_post": 25, "payment_bonus_reach": 5, "currency": "USD" } Actions ^^^^^^^ .. http:post:: /api/task/actions/ **Request Body:** .. code-block:: json { "task_id": 456, "action": "approve" } **Response:** .. code-block:: json { "status": "success", "message": "Task approved" } Custom Tasks ^^^^^^^^^^^^ .. http:post:: /api/task/custom/ **Request Body:** .. code-block:: json { "campaign_id": 123, "title": "Custom Task", "description": "Custom task description", "requirements": "Custom requirements" } **Response:** .. code-block:: json { "status": "success", "task_id": 789, "message": "Custom task created" } User Statistics ~~~~~~~~~~~~~~~ Sex Statistics ^^^^^^^^^^^^^^ .. http:post:: /api/users/stats/sex/ **Response:** .. code-block:: json { "male": 60, "female": 40 } Age Statistics ^^^^^^^^^^^^^^ .. http:post:: /api/users/stats/age/ **Response:** .. code-block:: json { "18-24": 30, "25-34": 40, "35-44": 20, "45+": 10 } Preferences Statistics ^^^^^^^^^^^^^^^^^^^^^^ .. http:post:: /api/users/stats/preferences/ **Response:** .. code-block:: json { "fashion": 25, "beauty": 20, "technology": 15, "food": 10, "travel": 10, "other": 20 } General Statistics ~~~~~~~~~~~~~~~~~~ Pending Statistics ^^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/stats/pending/ **Response:** .. code-block:: json { "pending_campaigns": 5, "pending_tasks": 50, "pending_approvals": 20 } Financial Statistics ^^^^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/stats/financial/ **Request Body:** .. code-block:: json { "date_from": "2024-01-01", "date_to": "2024-12-31" } **Response:** .. code-block:: json { "total_revenue": 10000, "total_payouts": 8000, "currency": "USD" } Estimated Publishers ^^^^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/stats/estimated-publishers/ **Response:** .. code-block:: json { "estimated_publishers": 500, "active_publishers": 300 } Potential Publishers ^^^^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/stats/potential-publishers/ **Response:** .. code-block:: json { "potential_publishers": 200, "conversion_rate": 0.4 } Lists ~~~~~ Locations ^^^^^^^^^ .. http:post:: /api/general/lists/locations/ **Response:** .. code-block:: json { "countries": [ { "id": 1, "name": "United States", "cities": [ { "id": 1, "name": "New York" } ] } ] } Advertisers ^^^^^^^^^^^ .. http:post:: /api/general/lists/advertisers/ **Response:** .. code-block:: json { "advertisers": [ { "id": 1, "name": "Fashion Brand", "email": "contact@fashionbrand.com" } ] } Allowed Countries ^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/lists/allowed-countries/ **Response:** .. code-block:: json { "countries": [ { "id": 1, "name": "United States", "currency_code": "USD" } ] } Allowed Cities ^^^^^^^^^^^^^^ .. http:post:: /api/general/lists/allowed-cities/ **Response:** .. code-block:: json { "cities": [ { "id": 1, "name": "New York" } ] } Allowed Categories ^^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/lists/allowed-categories/ **Response:** .. code-block:: json { "categories": [ { "id": 1, "name": "Fashion" } ] } Allowed Campaigns ^^^^^^^^^^^^^^^^^ .. http:post:: /api/general/lists/allowed-campaigns/ **Response:** .. code-block:: json { "campaigns": [ { "id": 123, "name": "Summer Fashion Campaign" } ] } Tools ~~~~~ Exchange Rate ^^^^^^^^^^^^^ .. http:post:: /api/general/tools/exchange/ **Request Body:** .. code-block:: json { "from": "USD", "to": "EUR", "amount": 100 } **Response:** .. code-block:: json { "base": 100, "exchange": 85.50 } Check User ^^^^^^^^^^ .. http:post:: /api/general/tools/check-user/ **Request Body:** .. code-block:: json { "user_id": 456 } **Response:** .. code-block:: json { "exists": true, "status": "active", "joined_date": "2024-01-01" } User Ban ^^^^^^^^^ .. http:post:: /api/general/tools/user-ban/ **Request Body:** .. code-block:: json { "user_id": 456, "banned": true, "reason": "Violation of terms" } **Response:** .. code-block:: json { "status": "success", "message": "User ban status updated" }