Skip to main content

Statlas Ads API

This guide is for design partners integrating with Statlas Ads to receive batch requests, check statuses, and deliver completed ad assets.


Base URL​

https://api.statlas.io/v1

Authentication​

All API requests require a Bearer token in the Authorization header.

Authorization: Bearer YOUR_PARTNER_API_KEY

Your API key is tied to your partner_id and can be obtained from your Statlas partner dashboard.


Webhooks & Notifications​

Statlas can notify your team when events occur. Configure your notification preferences in the partner dashboard.

Supported Channels​

ChannelDescription
EmailNotifications sent to configured email addresses
SlackMessages posted to a Slack channel via incoming webhook
WebhookHTTP POST to your custom endpoint

Webhook Events​

EventDescription
batch.createdA new batch request has been submitted
batch.updatedBatch details have been modified
revision.requestedClient has requested changes on one or more ads

Webhook Payload Example​

{
"event": "batch.created",
"timestamp": "2025-01-15T14:30:00Z",
"data": {
"batch_id": "BAT001",
"batch_code": "BAMBU-XMAS-001",
"shop": "bambu-earth",
"partner_id": "PTN00123",
"total_ads": 5,
"video_count": 3,
"static_count": 2,
"marketing_event": "XMAS",
"event_type": "Campaign",
"go_live_date": "2025-01-20",
"product_name": "MUD MASK",
"brief_notes": "Focus on holiday gifting angle",
"attachments": [
{
"name": "brand_guidelines.pdf",
"url": "https://storage.statlas.io/attachments/..."
}
]
}
}

Revision Notification Payload​

{
"event": "revision.requested",
"timestamp": "2025-01-16T10:44:00Z",
"data": {
"batch_id": "BAT001",
"batch_code": "BAMBU-XMAS-001",
"shop": "bambu-earth",
"ad_no": 3,
"revision_url": "https://app.statlas.io/revisions/BAT001/3",
"feedback_summary": "I don't like this color"
}
}
Revisions

There is no API for managing revisions. When you receive a revision.requested notification, use the revision_url to view feedback and communicate directly with the client through the Statlas interface.


Endpoints​

Get Batch Details​

Retrieve details for a specific batch request.

GET /batches/{batch_id}

Path Parameters​

ParameterTypeDescription
batch_idstringThe batch identifier (e.g., BAT001)

Query Parameters​

ParameterTypeRequiredDescription
shopstringYesThe shop identifier

Response​

{
"id": "BAT001",
"batch_code": "BAMBU-XMAS-001",
"shop": "bambu-earth",
"partner_id": "PTN00123",
"total_ads": 5,
"video_count": 3,
"static_count": 2,
"marketing_event": "XMAS",
"event_type": "Campaign",
"go_live_date": "2025-01-20",
"product_id": "prod_mudmask",
"product_name": "MUD MASK",
"is_collection": false,
"status": "in_production",
"submitted_at": "2025-01-15T14:30:00Z",
"completed_at": null,
"brief_notes": "Focus on holiday gifting angle",
"attachments": [],
"market_code": "US",
"funnel_type": "awareness",
"audience": "Women 25-45",
"angle": "Holiday gifting",
"ads": [
{
"ad_no": 1,
"ad_code": "BAMBU-XMAS-001-01",
"ad_type": "video",
"status": "pending",
"has_revision": false
},
{
"ad_no": 2,
"ad_code": "BAMBU-XMAS-001-02",
"ad_type": "static",
"status": "revision_requested",
"has_revision": true
}
]
}

List Open Batches​

Retrieve all batches assigned to your partner account that are awaiting delivery.

GET /batches

Query Parameters​

ParameterTypeRequiredDescription
statusstringNoFilter by status: submitted, in_production, in_review, completed
shopstringNoFilter by shop identifier
limitintegerNoMax results (default: 50, max: 100)
offsetintegerNoPagination offset

Response​

{
"data": [
{
"id": "BAT001",
"batch_code": "BAMBU-XMAS-001",
"shop": "bambu-earth",
"total_ads": 5,
"video_count": 3,
"static_count": 2,
"marketing_event": "XMAS",
"go_live_date": "2025-01-20",
"product_name": "MUD MASK",
"status": "in_production",
"submitted_at": "2025-01-15T14:30:00Z"
}
],
"pagination": {
"total": 12,
"limit": 50,
"offset": 0
}
}

Submit Completed Ads (Batch Upload)​

Upload completed ad assets for an entire batch. This is the primary method for delivering finished work.

POST /batches/{batch_id}/deliver

Path Parameters​

ParameterTypeDescription
batch_idstringThe batch identifier

Request Body​

Each ad in the batch should have a Google Drive folder URL containing the assets. Each folder represents one ad and may contain multiple images or a video file.

{
"shop": "bambu-earth",
"ads": [
{
"ad_no": 1,
"ad_type": "video",
"headline": "Unwrap Beautiful Skin",
"description": "The perfect holiday gift",
"body": "Give the gift of radiant skin this holiday season with our best-selling MUD MASK.",
"folder_url": "https://drive.google.com/drive/folders/abc123",
"assets": [
{
"name": "mudmask_holiday_15s.mp4",
"url": "https://drive.google.com/file/d/xyz789",
"width": 1080,
"height": 1920,
"file_size_bytes": 15234567
}
]
},
{
"ad_no": 2,
"ad_type": "static",
"headline": "Holiday Glow",
"description": "Limited time offer",
"folder_url": "https://drive.google.com/drive/folders/def456",
"assets": [
{
"name": "mudmask_static_1080x1920.png",
"url": "https://drive.google.com/file/d/aaa111",
"width": 1080,
"height": 1920,
"file_size_bytes": 2345678
},
{
"name": "mudmask_static_1200x628.png",
"url": "https://drive.google.com/file/d/bbb222",
"width": 1200,
"height": 628,
"file_size_bytes": 1876543
}
]
}
]
}

Asset Requirements​

FieldTypeRequiredDescription
namestringYesFilename including extension
urlstringYesDirect URL to the asset (Google Drive file link)
widthintegerNoWidth in pixels
heightintegerNoHeight in pixels
file_size_bytesintegerNoFile size in bytes
Google Drive Permissions

Ensure your Google Drive folders are shared with statlas-assets@statlas.iam.gserviceaccount.com with Viewer access. We cannot retrieve assets from folders we don't have access to.

Response​

{
"success": true,
"batch_id": "BAT001",
"status": "in_review",
"ads_delivered": 5,
"message": "Batch delivery successful. Client has been notified."
}

Upload Asset Directly​

If you prefer to upload assets directly to Statlas storage instead of providing Google Drive links, use this endpoint.

POST /batches/{batch_id}/ads/{ad_no}/assets

Path Parameters​

ParameterTypeDescription
batch_idstringThe batch identifier
ad_nointegerThe ad number within the batch

Request​

Send as multipart/form-data:

FieldTypeRequiredDescription
filefileYesThe asset file (image or video)
shopstringYesThe shop identifier
namestringNoCustom filename (defaults to uploaded filename)

Response​

{
"success": true,
"asset": {
"id": "ast_8x7k2m9p",
"batch_id": "BAT001",
"ad_no": 1,
"name": "mudmask_holiday_15s.mp4",
"url": "https://storage.statlas.io/assets/ast_8x7k2m9p/mudmask_holiday_15s.mp4",
"width": 1080,
"height": 1920,
"file_size_bytes": 15234567,
"revision_no": 1
}
}

Update Ad Details​

Update copy or metadata for a specific ad.

PATCH /batches/{batch_id}/ads/{ad_no}

Request Body​

{
"shop": "bambu-earth",
"headline": "Updated Headline",
"description": "Updated description text",
"body": "Updated body copy for the ad."
}

Response​

{
"success": true,
"ad": {
"batch_id": "BAT001",
"ad_no": 1,
"ad_code": "BAMBU-XMAS-001-01",
"ad_type": "video",
"headline": "Updated Headline",
"description": "Updated description text",
"body": "Updated body copy for the ad.",
"status": "pending",
"update_at": 20250116
}
}

Mark Batch as Complete​

Notify Statlas that all ads in a batch have been delivered and are ready for client review.

POST /batches/{batch_id}/complete

Request Body​

{
"shop": "bambu-earth"
}

Response​

{
"success": true,
"batch_id": "BAT001",
"status": "in_review",
"completed_at": "2025-01-18T09:00:00Z",
"message": "Batch marked complete. Client has been notified to review."
}

Batch Status Values​

StatusDescription
draftRequest created but not yet submitted
submittedClient has submitted the request
in_productionPartner is actively working on the batch
in_reviewAssets delivered, awaiting client review
completedAll ads approved and deployed

Ad Status Values​

StatusDescription
pendingAwaiting client review
approvedClient approved the ad
rejectedClient rejected the ad
revision_requestedClient requested changes

Error Handling​

Error Response Format​

{
"error": {
"code": "BATCH_NOT_FOUND",
"message": "No batch found with ID 'BAT999' for shop 'bambu-earth'",
"status": 404
}
}

Common Error Codes​

CodeStatusDescription
UNAUTHORIZED401Invalid or missing API key
FORBIDDEN403Partner does not have access to this batch
BATCH_NOT_FOUND404Batch ID does not exist
VALIDATION_ERROR400Invalid request body or parameters
ASSET_ACCESS_DENIED400Cannot access Google Drive folder
RATE_LIMITED429Too many requests

Rate Limits​

EndpointLimit
GET requests100 requests/minute
POST/PATCH requests30 requests/minute
File uploads10 requests/minute

Workflow Summary​


Support​

For API support or integration assistance, contact api-support@statlas.io or reach out to your partner success manager.