X-Application-IdX-Api-Key
GET /sdk/v1/campaigns/:campaignId/media
List all tracked media across the campaign with aggregate metrics.Query parameters
query(optional; searches media URLs/titles)platform(optional; filter by platform, e.g.,instagram,tiktok,youtube)
Response
asOfTimestamp indicates when tracking metrics were last refreshed. It may be null if no scraping has occurred yet.TikTok media rows include
isSlideshow: true for photo carousel/slideshow posts, false for videos, and null when the value is not known yet or not applicable. Use this field instead of deriving TikTok content type from the mediaUrl path.authorPlatformId, authorUsername, authorDisplayName), content
fields (title, captionText, hashtags), audio fields (audioPlatformId,
audioTitle, audioArtist, audioAlbum, audioIsOriginal), and
metadataCollectedAt. Unavailable fields are null, and hashtags is an empty
array when none are available.
GET /sdk/v1/campaigns/:campaignId/creators/media
List a campaign creator’s tracked media, broken down into accounts and posts.Query parameters
email(required)includeGroups(optional;trueto include explicit group rows)page(default1)limit(default5)
Response
includeGroups=true, the response includes an additional groups array and pagination.groups object.
Group rows also include isSlideshow when the winning media item has a known TikTok slideshow state.
Normalized author, content, hashtag, and audio metadata on a group row comes from
that group’s winning media item.
Common errors
400: missingemail404: creator not found in this campaign
POST /sdk/v1/campaigns/:campaignId/creators/media
Add or update tracked media for a campaign creator. If the creator is not yet a member of the campaign, they are automatically added (implicit membership). Background scraping is triggered automatically after media is saved.Body
Tracking is start-based. Provide
startDate (or legacy trackStartAt) and
omit media-level end dates. For account URLs, Grade continues discovering
eligible posts automatically, while trackForValue and trackForUnit define
each discovered post’s relative payable tracking window.string
required
Creator email address.
array
required
Array of media items to track.
media array accepts:
string
required
URL of the post or account to track.
string
Platform name (e.g.,
instagram, tiktok, youtube). Optional if the platform can be derived from the URL.string
Optional ISO date when tracking starts. If omitted, tracking starts at save time.
string
Backward-compatible alias for
startDate.number
Relative tracking duration for discovered posts. Provide this together with
trackForUnit, for example 7 with DAYS.string
Relative tracking unit. Must be
DAYS or MONTHS when trackForValue is
provided.Relative tracking windows
UsetrackForValue and trackForUnit to choose how long each discovered post is tracked after it is uploaded.
Examples:
- 7-day window:
"trackForValue": 7,"trackForUnit": "DAYS" - 30-day window:
"trackForValue": 30,"trackForUnit": "DAYS" - 2-month window:
"trackForValue": 2,"trackForUnit": "MONTHS"
trackForValue: 7 with trackForUnit: "DAYS", Grade counts the video’s views for the first 7 days after upload. If the campaign pays CPM or bonuses after tracking completes, the video becomes payable after that 7-day window is complete.
string
Caption filter for account-type URLs (max 256 characters). Only applies to account media.
string
Existing media record ID to update. Omit to create a new media entry.
Response
Common errors
400: missingemailormedia400:startDateis invalid400:endDateandtrackEndAtare not supported for creator media. UsetrackForValueandtrackForUnitfor relative tracking windows.400:trackForValueandtrackForUnitmust be provided together400:trackForUnitmust beDAYSorMONTHS
DELETE /sdk/v1/campaigns/:campaignId/creators/media
Remove a tracked media item from a campaign creator.Body
Response
Common errors
400: missingemailorcampaignCreatorMediaId404: media item not found
GET /sdk/v1/campaigns/:campaignId/media/discovered-posts
List posts discovered for an account-type media item. When you track an account URL (e.g.,https://www.instagram.com/creatorhandle), the system periodically discovers new posts from that account and tracks them automatically.
Query parameters
sourceCampaignCreatorMediaId(required; the account media item ID)page(default1)limit(default5)startDate/endDate(optional,YYYY-MM-DD; provide both together)performanceWindowDays(optional integer, 1-366)
views return the latest cumulative scrape
value. When startDate and endDate are provided, those same fields return
the metric delta for that date range, using the latest scrape inside the range
minus the latest scrape before the range. When performanceWindowDays is
provided, each post uses its own uploadDate as the window start and returns
the metric delta for the first N days after that upload.
Use either startDate / endDate or performanceWindowDays, not both. Windowed
responses also include viewsTotal, likesTotal, commentsTotal, sharesTotal,
and metricsWindow so you can distinguish the current cumulative totals from
the requested window deltas. If performanceWindowDays is requested but a post
does not yet have an uploadDate, window metric fields are null and
metricsWindow.status is missingUploadDate.
Response
Common errors
400: missingsourceCampaignCreatorMediaId400:startDateandendDatemust be provided together400:performanceWindowDaysmust be an integer between 1 and 366400: use eitherstartDate/endDateorperformanceWindowDays, not both404: source media item not found or does not belong to your agency