Base URL
Authentication
Send your advertiser API key in theX-API-Key header on every request. You’ll find the key in the Gravity dashboard under Settings → Organization.
X-API-Key header is missing, the response is 422. If the key isn’t valid, the response is 401 with Invalid API key. See Errors.
Rate limits
The Platform API allows about 100 requests per second from one client IP address. Over the limit, the response is429 with a Retry-After header. Wait that many seconds, then try again.
Conventions
- Request and response bodies are JSON, except the audience upload, which is
multipart/form-data. - Dates in query parameters use
YYYY-MM-DD. Report endpoints taketz, an IANA time zone that sets where each day starts and ends. - Spend and budgets are in dollars. Conversion values in
/conversionsusevalue_cents. PATCHendpoints change only the fields that you send.
Pagination
List endpoints that can return many rows page in one of two ways:- Cursor:
/conversionsand/geo-targetsreturnhas_moreandnext_cursor. Sendnext_cursorascursorto get the next page. - Offset:
/ad-group-metricsreturns at most 2,000 ad groups per call, withtotal_ad_groupsandtruncated. Whiletruncatedistrue, send the request again withoffsetincreased by 2000.