v1

latestOpenAPI 3.1.02026-08-04170116.0 KB
Data In

Create Ad Record

Ingest ad data into Triple Whale. This endpoint allows users to upload detailed ad information, including campaign, adset, ad details, and performance metrics.

post/data-in/ads

Request body

shopstring required

The exact Shop URL (e.g., 'example.myshopify.com'). Must match the Shop URL value shown in Settings → Store. The API key owner must also have access to the shop, otherwise the request will return 403.

channelstring required

The advertising platform associated with the ad data. Use a Standardized Ad Channel ID or enter a custom value.

channel_account_idstring

The platform-specific account ID. Maps to account_id in the Ads table.

event_datestring date required

The date of the event in local timezone. Must be a valid date string (e.g., YYYY-MM-DD).

currencystring required

The currency used for reporting (e.g., 'USD').

updated_atstring date-time

The time at which the ad record was last updated. Must be provided in ISO 8601 format, with explicit timezone information (Z or +/-HH:mm offset). Offsets are supported (e.g., 2024-11-29T12:00:00+02:00). Defaults to the current time.

Example request

{
  "shop": "madisonbraids.myshopify.com",
  "channel": "facebook-ads",
  "channel_account_id": "example_fb_account",
  "event_date": "2024-11-28",
  "currency": "USD",
  "campaign": {
    "id": "campaign_example_id",
    "name": "Example Campaign",
    "status": "ACTIVE"
  },
  "adset": {
    "id": "adset_example_id",
    "name": "Example Adset",
    "status": "ACTIVE"
  },
  "ad": {
    "id": "ad_example_id",
    "name": "Example Ad",
    "status": "ACTIVE",
    "ad_image_url": "https://example.com/placeholder.jpg"
  },
  "metrics": {
    "clicks": 1500,
    "conversions": 75,
    "conversion_value": 3750.5,
    "impressions": 25000,
    "spend": 500,
    "visits": 2000
  },
  "updated_at": "2024-11-28T15:30:00Z"
}

Response

Ad record successfully received.

successboolean
messagestring

Example response

{
  "success": true,
  "message": "Ad received"
}