Create a new ad with either trip or cart data (exactly one required)
POST
/ads
curl \
--request POST 'https://api.thankly.ai/ads' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"trip":{"type":"One Way","flights":[{"departureAirport":"JFK","arrivalAirport":"LAX","departureTimestamp":1735689600,"arrivalTimestamp":1735710000,"numTravelers":2,"seatClass":"economy"}]},"cart":{"type":"grocery","products":[{"name":"Organic Bananas","brand":"Dole","price":2.99,"quantity":3,"category":"Produce","size":"1 lb","unit":"lb","barcode":"011110482587","organic":false,"gluten_free":false}]},"widgets":[{"type":"food","maxItems":4,"sponsoredLinks":[{"title":"Example","description":"This is an advertiser injected content","link":"https://example.com"}]}]}'
Request examples
{
"trip": {
"type": "One Way",
"flights": [
{
"departureAirport": "JFK",
"arrivalAirport": "LAX",
"departureTimestamp": 1735689600,
"arrivalTimestamp": 1735710000,
"numTravelers": 2,
"seatClass": "economy"
}
]
},
"cart": {
"type": "grocery",
"products": [
{
"name": "Organic Bananas",
"brand": "Dole",
"price": 2.99,
"quantity": 3,
"category": "Produce",
"size": "1 lb",
"unit": "lb",
"barcode": "011110482587",
"organic": false,
"gluten_free": false
}
]
},
"widgets": [
{
"type": "food",
"maxItems": 4,
"sponsoredLinks": [
{
"title": "Example",
"description": "This is an advertiser injected content",
"link": "https://example.com"
}
]
}
]
}
Response examples (200)
{
"trip": {
"adId": "string"
},
"cart": {
"adId": "string"
},
"accessToken": "string"
}
Response examples (400)
{
"detail": "Exactly one content object is required"
}