A step-by-step guide for agencies and developers: get approved, estimate the price, create a Test Offer, move to Live safely and read the results.
If you run local campaigns for clients, the Agilis Advertising API lets you create and manage Offers from your own code instead of the Ad Portal. An Offer is a deal from a local business, such as 20% off at a café, that Agilis members see when they're nearby. This guide walks through one Offer from start to finish. Everything happens in Test mode first, which is free and never shown to members. The figures in the example replies are illustrative: yours depend on your area, your targeting and your dates.
The API reaches only your own Offers, Events, balances and aggregated results. It never gives access to member profiles, messages or anything that identifies a member.
Every request goes to https://ads.agilis.dating with your key in the x-api-key header. You can follow along with curl, with one of the seven official SDKs, or with the command-line tool (npx @agilisdating/ads-cli). The API reference has every field and return code.
Every Offer needs a category. Ask for the ones assigned to your organisation:
curl "https://ads.agilis.dating/categories" \
-H "x-api-key: $AGILIS_API_KEY"The reply lists each category's id and name. Note the category_id you want:
{
"categories": [
{ "category_id": 54, "category_name": "Restaurants & Cafés" },
{ "category_id": 55, "category_name": "Bars, Pubs & Nightlife" },
{ "category_id": 56, "category_name": "Entertainment & Events" }
]
}If you want to reach members with particular interests, GET /interests lists those too. It's optional.
An Offer is priced by its reach and its length: the number of members it would reach, times the hours it runs, gives a number of Ad Units, and each Ad Unit costs £0.001 (or the same in your billing currency). Ask for an estimate before you create anything:
curl -X POST "https://ads.agilis.dating/offers/price-estimate" \
-H "x-api-key: $AGILIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_datetime": "2027-07-10T08:00:00Z",
"end_datetime": "2027-07-12T20:30:00Z",
"location": [51.5074, -0.1278],
"radius": 10
}'Times are in UTC, the location is latitude and longitude, and the radius is in miles, from 5 to 30. You can also target by gender and by interests (ids from GET /interests). Send the same targeting you'll use for the Offer, because narrower targeting reaches fewer members and costs less. The reply:
{
"return_code": "S1",
"price_estimate": 75020,
"matching_users": 1240,
"ad_units": 75020,
"ad_unit_price": 0.001,
"estimated_cost": 75.02,
"currency": "GBP",
"exchange_rate_per_gbp": 1,
"exchange_rate_date": null
}An Offer is sent as a form with its image attached. Three things to get right:
curl -X POST "https://ads.agilis.dating/offers" \
-H "x-api-key: $AGILIS_API_KEY" \
-H "Idempotency-Key: 3f1a9c7e-1b2d-4f9a-8c0e-2a6b5d4e7f10" \
-F "category_id=54" \
-F "title=20% off summer drinks" \
-F "description=Show this Offer at the counter for 20% off any cold drink." \
-F "terms_and_conditions=One per person. Not with other offers." \
-F "advertised_name=Brighton Bakehouse" \
-F "push_notification_title=20% off cold drinks" \
-F "push_notification_message=Show this at the counter for 20% off any cold drink this weekend." \
-F "button_preset=get_directions" \
-F "url=https://www.example.com/summer" \
-F "location[]=51.5074" \
-F "location[]=-0.1278" \
-F "radius=10" \
-F "start_datetime=2027-07-10T08:00:00Z" \
-F "expiry_datetime=2027-07-12T20:30:00Z" \
-F "payment_method=B" \
-F "environment=TEST" \
-F "image=@offer.jpg"advertised_name is the business name members see. Agencies use it to show their client's name instead of the agency's; you need the client's permission to use it, and invoices and results stay in your organisation's name. The notification title (5 to 50 characters) and message (5 to 150) go to members who chose to hear about Offers. The image and the notification text are checked by automated moderation before anything is created.
When it works, the reply gives you the Offer's id. Because this one starts in the future, it's Scheduled:
{
"return_code": "S1",
"offer_id": 281,
"status": "Scheduled",
"payment_url": null
}To see the Offer, list your Test Offers (GET /offers?environment=test) or fetch it by id (GET /offers/281). Once created, a future Offer is listed as Active with its future start_datetime; members see it from that time. Test Offers are deleted automatically 30 days after they end.
When the Test run behaves as you expect, the same requests work in Live. Live is real: members see the Offer, and creating it is paid. These habits keep it safe.
A Live dry run of the same Offer looks like this (example figures):
curl -X POST "https://ads.agilis.dating/offers?dry_run=true" \
-H "x-api-key: $AGILIS_LIVE_API_KEY" \
...the same fields as before, with environment=LIVE...{
"return_code": "S1",
"dry_run": true,
"message": "Dry run: the Offer passed every check. Nothing was created or charged.",
"environment": "LIVE",
"status_if_created": "Scheduled",
"matching_members": 1240,
"ad_units": 75020,
"price": 75.02,
"currency": "GBP",
"payment_method": "B",
"balance": 100,
"balance_after": 24.98
}Every change made with your keys is listed on the API activity page in the Ad Portal, with the key and the amount.
Once the Offer is running, ask for its results over a period: 24h, 7d, 30d, 60d, 90d or all.
curl "https://ads.agilis.dating/offers/281/analytics?interval=7d" \
-H "x-api-key: $AGILIS_API_KEY"The reply has three parts. The figures below are an example, shortened: by_day has one entry per day and groups always has 18 entries.
{
"offer_id": 281,
"interval": "7d",
"metrics": { "views": 3933, "clicks": 853 },
"time_zone": "Europe/London",
"by_day": [
{ "date": "2027-07-10", "views": 212, "clicks": 41 },
{ "date": "2027-07-11", "views": 498, "clicks": 96 }
],
"demographics": {
"min_group_size": 5,
"views": {
"total": 3638,
"has_hidden_groups": true,
"by_gender": [
{ "gender": "Female", "count": 1864 },
{ "gender": "Male", "count": 1694 },
{ "gender": "Non-binary", "count": 80 }
],
"groups": [
{ "age_group": "18-24", "gender": "Female", "count": 312, "hidden": false },
{ "age_group": "65+", "gender": "Non-binary", "count": null, "hidden": true }
]
}
}
}Agilis counts views and clicks. It can't tell whether a click led to a sale or a visit, so track that on your own landing page.
You can pause (POST /offers/{id}/pause) and resume (POST /offers/{id}/resume) an Offer, or delete it (DELETE /offers/{id}). Offers can't be edited through the API, and a deleted Offer can't be restored. Deleting a paid Offer credits the time it didn't run to your balance; try DELETE /offers/{id}?dry_run=true first to see the amount.
Next: connect an AI assistant to Agilis, browse the developer hub, or read the full API reference. Questions: help@agilis.dating.
Your browser's Global Privacy Control signal is on, so we've turned off non-essential cookies. Cookie Policy