Agilis API Documentation
The Agilis REST API lets advertisers manage offers and list events programmatically. All requests are made over
HTTPS to https://ads.agilis.dating and authenticated with your API key, supplied in
the x-api-key request header. Responses are returned as JSON.
Developer Guide
This guide walks through the complete offer creation flow, from fetching categories to managing a live offer. The Agilis Advertising API lets developers create and manage advertiser offers programmatically.
- Base URL:
https://ads.agilis.dating - Authentication: All requests require a valid API key in the
x-api-keyrequest header. - Content-Type:
application/jsonfor JSON requests;multipart/form-datafor offer creation.
Overview
The offer creation flow involves up to five steps, depending on the payment method chosen:
1. Fetch Categories GET /categories
Fetch Interests GET /interests (only if targeting by interest)
2. Estimate Price POST /offers/price-estimate (recommended before creating)
3. Create Offer POST /offers
├─ Payment method E ──► Stripe checkout link returned
│ User completes payment externally
│ Webhook activates offer → Active or Scheduled
└─ Payment method B ──► Ad Units deducted from balance immediately
Offer becomes Active or Scheduled at once
Once the offer exists you can view it, pause/resume it, retrieve analytics, or delete it.
1 Fetch Categories
Before creating an offer you need a valid category_id. Retrieve the categories assigned to your organisation.
Endpoint: GET /categories
curl -X GET "https://ads.agilis.dating/categories" \
-H "x-api-key: YOUR_API_KEY_HERE"
Successful response — HTTP 200
{
"categories": [
{ "category_id": 1, "category_name": "Retail" },
{ "category_id": 2, "category_name": "Food & Beverage" },
{ "category_id": 3, "category_name": "Health & Fitness" }
]
}
Use the category_id value in Step 3.
Error responses
| HTTP | Body | Meaning |
|---|---|---|
| 401 | {"message": "Unauthorised"} | API key is missing, invalid, or disabled; or the associated user account is disabled |
| 500 | {"message": "Internal server error"} | Unexpected server error |
1b Fetch Interests Optional
Offers can optionally be targeted at users who have selected particular interests. Retrieve the available interests to obtain their ids. Skip this step if you do not intend to target by interest.
Endpoint: GET /interests
curl -X GET "https://ads.agilis.dating/interests" \
-H "x-api-key: YOUR_API_KEY_HERE"
Successful response — HTTP 200
{
"interests": [
{ "interest_id": 3, "interest_name": "Cooking" },
{ "interest_id": 7, "interest_name": "Fitness" },
{ "interest_id": 12, "interest_name": "Live music" }
]
}
Use the interest_id values in the optional interests array in Step 3.
Error responses
| HTTP | Body | Meaning |
|---|---|---|
| 401 | {"message": "Unauthorised"} | API key is missing, invalid, or disabled; or the associated user account is disabled |
| 500 | {"message": "Internal server error"} | Unexpected server error |
2 Estimate Price Recommended
Find out what the offer will cost before committing: how many Ad Units it uses, and what those units cost in money. This is especially important if you intend to pay from balance (payment method B), so you can confirm the balance is sufficient.
Endpoint: POST /offers/price-estimate
Price formula: Ad Units = duration in hours × number of matching Agilis users, rounded to 2 decimal places. Cost = Ad Units × the Ad Unit price, rounded to 2 decimal places.
The Ad Unit price is set in pounds sterling: £0.001. In any other currency it is £0.001 × that day's European Central Bank reference rate for the currency, rounded to 8 decimal places. For example, at 1.3412 US dollars to the pound one Ad Unit costs US$0.001341. Rates are refreshed each working day.
Your billing currency. Every organisation is billed in one currency, chosen when it registers. Your balance, every payment, every refund of Unused Time and every invoice are in it, and every price the API quotes or charges is in it. There is no currency parameter: you cannot choose a different currency per offer, and the billing currency cannot be changed through the API: once your organisation is approved, only Agilis support can change it.
Ad Units and money are different things. price_estimate is a number of Ad Units. Your balance, and the amount an offer deducts from it, is money in your billing currency. Compare your balance with estimated_cost, never with price_estimate: for an account in pounds the two differ by a factor of 100.
A user matches when they are within the target radius and satisfy any gender and interests targeting you supply. Only active, non-banned accounts are counted. Because targeting narrows the audience, it also lowers the price — pass the same gender and interests values you intend to use in Step 3, or the estimate will be higher than the amount actually charged.
curl -X POST "https://ads.agilis.dating/offers/price-estimate" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"start_datetime": "2027-08-01T09:00:00Z",
"end_datetime": "2027-08-31T23:59:00Z",
"location": [51.5074, -0.1278],
"radius": 10,
"gender": ["Male", "Female"],
"interests": [3, 7]
}'
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
start_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC. Now or later: a start more than 60 seconds before now (UTC) is refused with E1. Example: "2027-07-10T08:00:00Z" |
end_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC. Example: "2027-07-12T20:30:00Z" |
location |
array of 2 numbers | Yes | Latitude and longitude. Example: [51.5074, -0.1278] |
radius |
integer | Yes | Miles, minimum 5, maximum 30. Example: 10 |
gender |
array of strings | No | One or more of Male, Female, Non-binary, All. Omit, or include All, to reach every gender. Example: ["Male", "Female"] |
interests |
array of integers | No | Interest ids from GET /interests. A user matches if they share any of them. Omit to apply no interest filter. Example: [3, 7] |
environment |
string | No | TEST or LIVE. Defaults to your API key's own mode. If sent, it must be your key's mode (HTTP 403 otherwise). The Ad Unit price is the same in both. |
Successful response — HTTP 200, S1
{
"return_code": "S1",
"price_estimate": 1337669.67,
"matching_users": 1820,
"ad_units": 1337669.67,
"ad_unit_price": 0.001,
"estimated_cost": 1337.67,
"currency": "GBP",
"exchange_rate_per_gbp": 1,
"exchange_rate_date": null
}
The same offer for an organisation billed in US dollars, on a day when the rate was 1.3412:
{
"return_code": "S1",
"price_estimate": 1337669.67,
"matching_users": 1820,
"ad_units": 1337669.67,
"ad_unit_price": 0.001341,
"estimated_cost": 1794.08,
"currency": "USD",
"exchange_rate_per_gbp": 1.3412,
"exchange_rate_date": "2027-09-29"
}
| Field | Meaning |
|---|---|
price_estimate | The offer's size in Ad Units. Not money. Here: 1,820 users × 734.98 hours |
ad_units | The same figure under a clearer name. price_estimate is kept for existing integrations |
matching_users | The number of Agilis users the offer would reach with the targeting supplied. 0 means the offer cannot be created as specified: widen the radius or broaden the targeting |
ad_unit_price | The price of one Ad Unit in currency, to 6 decimal places |
estimated_cost | The money the offer will cost, in currency: the amount deducted from your balance, or charged to your card (plus VAT where it applies). This is the figure to compare with your balance |
currency | Your organisation's billing currency: the currency of ad_unit_price and estimated_cost |
exchange_rate_per_gbp | The European Central Bank reference rate the price was converted at: units of currency per pound sterling. 1 for GBP |
exchange_rate_date | The date of that rate, YYYY-MM-DD. null for GBP |
If your billing currency cannot be billed right now, the estimate still returns S1 with the Ad Unit figures, and ad_unit_price, estimated_cost, exchange_rate_per_gbp and exchange_rate_date are null. That happens when the currency's exchange rate is out of date (try again later), or when your organisation registered in a currency Agilis does not bill in (an Org Admin can choose a supported billing currency in the Ad Portal). POST /offers refuses both cases with E6.
Error responses
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Estimate calculated successfully. |
| E1 | 400 | One or more inputs are missing or invalid, or start_datetime is in the past (more than 60 seconds before now). |
| E2 | 400 | A date/time is not in valid ISO 8601 format. |
| E1 | 403 | environment is not your API key's mode. |
| 401 | 401 | Authentication failure. |
3 Create the Offer
Submit the offer as a multipart/form-data request. The image must be sent as a binary file stream. The API runs automated content moderation on the image before the offer is created. If moderation fails, the offer is not created and no charge is made.
Endpoint: POST /offers
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key header |
string | Yes | A unique value you generate per offer (for example a UUID v4). Replaying the same key safely retries the request without creating a duplicate offer or a second Stripe payment; the original response, including any payment_url, is returned verbatim. Missing: HTTP 400 / E1. |
dry_run query |
boolean | No | Optional. true checks everything and answers with what the offer would cost and how it would be paid (price, matching_members, and balance_after or card_amount), marked dry_run: true. Nothing is created or charged, and no Idempotency-Key is needed. The image is checked for type and size; its content moderation runs only when the offer is created. |
category_id |
integer | Yes | A valid category ID from the Category List API. Example: 1 |
title |
string | Yes | Up to 40 characters. Example: "20% off summer sale" |
description |
string | Yes | Up to 500 characters. Example: "Discount valid through July" |
terms_and_conditions |
string | No | Up to 500 characters. Example: "Valid online only." |
advertised_name |
string | No | The business name members see on the offer instead of your organisation's trading name — for example when an agency advertises for a client. Up to 100 characters; must not start with http://, https:// or www.; no HTML or line breaks. Omit or send empty to show your trading name. You must be authorised by the business you name. Invoices and analytics stay in your organisation's name. Example: "Brighton Bakehouse" |
push_notification_title |
string | Yes | The title of the notification sent to members who chose to get offer notifications, shown on their lock screen as you write it (it is not translated). 5 to 50 characters. Missing: E10; too short: E11; too long: E12; refused by content moderation: E13. Example: "20% off this summer" |
push_notification_message |
string | Yes | The notification's message, under the title. 5 to 150 characters; phones cut it at about 100, so keep it short. Same return codes as push_notification_title. Example: "Show this at the till for 20% off everything until the end of July." |
button_preset |
string | No | The words on the offer's button in the Agilis apps and web app: claim_offer (Claim Offer, the default when omitted or empty), visit_website (Visit our website), install_app (Install our app), book_now (Book now), get_directions (Get directions) or custom (your own words, in button_text). Ready-made texts are shown in each member's app language. Whatever the text, the button opens your url. Any other value: E14. Example: "book_now" |
button_text |
string | No | Your own button text: required when button_preset is custom, ignored otherwise. Plain text on one line, 1 to 20 characters after trimming, shown exactly as you write it in every language (it is not translated). Missing, empty, with a line break or with HTML: E15; over 20 characters: E16. Example: "Show this at the bar" |
url |
string (URL) | Yes | Your offer page. Example: "https://advertiseroffer.com" |
image |
file | Yes | JPG, PNG or GIF, maximum 5 MB, sent as a binary file stream. Recommended size: 1080x1080px |
location[] |
array of 2 numbers | Yes | Latitude and longitude as two values. Example: [51.5074, -0.1278] |
radius |
integer | Yes | Radius in miles, minimum 5, maximum 30. Example: 10 |
gender[] |
array of strings | No | Target specific genders. One or more of Male, Female, Non-binary, All. Omitting the field, or including All, reaches every gender. Narrowing this reduces the audience and therefore the price. Example: ["Male", "Female"] |
interests[] |
array of integers | No | Target users by interest, using ids from GET /interests. A user matches if they share any of the interests supplied. Omitting the field applies no interest filter. Narrowing this reduces the audience and therefore the price. Example: [3, 7] |
start_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC. Now or later: a start more than 60 seconds before now (UTC) is refused with E1. Example: "2027-07-10T08:00:00Z" |
expiry_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC; at least 60 seconds after start_datetime. Example: "2027-07-12T20:30:00Z" |
payment_method |
string | Yes | E = Stripe payment link by email; B = deduct from your own balance: the balance of the person who owns the API key, in the offer's mode (TEST and LIVE balances are separate). The Organisation balance in the Ad Portal is everyone's balances added together, not a shared wallet. For E, an organisation registered in the UK is charged VAT at 20% on top, as a separate line on the Stripe payment page. The offer's price and balance stay net of VAT. |
environment |
string | Yes | TEST or LIVE, in capitals. Must be your API key's own mode: a pk_live_ key creates LIVE offers only, a pk_test_ key TEST offers only. |
POST /offers request must include an Idempotency-Key header — a unique value you generate (e.g. a UUID v4). Replaying the same key safely retries the request without creating a duplicate offer or a second Stripe payment; the original response (including any payment_url) is returned verbatim. A request with no Idempotency-Key header is rejected with HTTP 400 / E1.Path A — Payment by Stripe link (payment_method=E)
The offer is created in Awaiting Payment status. A Stripe Checkout link is generated and returned. The organisation admin receives the link and completes payment externally. When Stripe confirms payment via webhook, the offer is automatically activated.
curl -X POST "https://ads.agilis.dating/offers" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Idempotency-Key: 3f1a9c7e-1b2d-4f9a-8c0e-2a6b5d4e7f10" \
-F "title=Summer Sale — 20% Off" \
-F "description=Discount valid through August on all summer items." \
-F "terms_and_conditions=Valid for online purchases only. One per customer." \
-F "category_id=1" \
-F "url=https://www.example.com/summer-sale" \
-F "location[]=51.5074" \
-F "location[]=-0.1278" \
-F "radius=10" \
-F "gender[]=Male" \
-F "gender[]=Female" \
-F "interests[]=3" \
-F "interests[]=7" \
-F "start_datetime=2027-08-01T09:00:00Z" \
-F "expiry_datetime=2027-08-31T23:59:00Z" \
-F "payment_method=E" \
-F "environment=LIVE" \
-F "image=@/path/to/offer-image.jpg"
Response immediately after creation — HTTP 200, S1
The offer is created but not yet active. Store the offer_id and present the payment_url to the user.
{
"return_code": "S1",
"offer_id": 45,
"status": "Awaiting Payment",
"payment_url": "https://checkout.stripe.com/c/pay/cs_live_...",
"currency": "GBP"
}
currency is your organisation's billing currency, the currency the card is charged in.
Direct your user to this Stripe Checkout page. Your user enters their card details and completes payment on Stripe's hosted page. The page shows one line for the offer, at the offer's price (the estimated_cost from Step 2), in your billing currency.
Paying securely: Card payments are taken by Stripe Checkout. Card details are entered in Stripe's own secure payment form and are never sent to or stored on Agilis servers. Stripe is certified as a PCI DSS Level 1 Service Provider. Payments use 3-D Secure (Strong Customer Authentication) whenever the card issuer requires it.
Minimum card payment: Stripe will not take a card payment below its minimum for the currency (for example £0.30, US$0.50 or €0.50). A card offer priced below it is refused with E1, and the message names the minimum: widen the audience, lengthen the offer, or pay from your balance.
VAT: for an organisation registered in the UK, the Stripe page adds VAT at 20% as a separate line, so the card is charged the offer's price plus VAT. Organisations registered anywhere else are charged no VAT. The offer's price, and any Unused Time later credited to your balance, are always net of VAT.
After payment, Stripe sends a checkout.session.completed webhook to Agilis, which activates the offer automatically. The status becomes Active if start_datetime is now or in the past, or Scheduled if it is in the future.
Path B — Payment from your balance (payment_method=B)
Before calling this path, confirm that your own balance (the balance of the person who owns the API key) is at least the estimated_cost returned in Step 2. That is the money figure; do not compare the balance with price_estimate, which is a number of Ad Units. If the balance is insufficient, the API returns E3 and no offer is created. Payment is deducted immediately when the offer is created; no Stripe link is involved.
The balance used is the one for your API key's mode. TEST and LIVE balances are separate: a TEST offer is paid from the TEST balance, a LIVE offer from the LIVE balance, and a TEST top-up can never pay for a LIVE offer. No VAT is added to a balance payment; where VAT applies, it was charged when the balance was topped up.
curl -X POST "https://ads.agilis.dating/offers" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Idempotency-Key: 3f1a9c7e-1b2d-4f9a-8c0e-2a6b5d4e7f10" \
-F "title=Summer Sale — 20% Off" \
-F "description=Discount valid through August on all summer items." \
-F "terms_and_conditions=Valid for online purchases only. One per customer." \
-F "category_id=1" \
-F "url=https://www.example.com/summer-sale" \
-F "location[]=51.5074" \
-F "location[]=-0.1278" \
-F "radius=10" \
-F "gender[]=Male" \
-F "gender[]=Female" \
-F "interests[]=3" \
-F "interests[]=7" \
-F "start_datetime=2027-08-01T09:00:00Z" \
-F "expiry_datetime=2027-08-31T23:59:00Z" \
-F "payment_method=B" \
-F "environment=LIVE" \
-F "image=@/path/to/offer-image.jpg"
Response when start date is in the future — HTTP 200, S1
{
"return_code": "S1",
"offer_id": 46,
"status": "Scheduled",
"payment_url": null
}
Response when start date has already passed — HTTP 200, S1
{
"return_code": "S1",
"offer_id": 47,
"status": "Active",
"payment_url": null
}
The price of the Ad Units, in your organisation's billing currency, is deducted from your own balance, so the Organisation balance (everyone's balances added together) goes down by the same amount, and Org Admins are notified by email in both cases.
Create Offer error responses (both payment paths)
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Offer created: payment link issued (E), or Active/Scheduled if paid from balance (B). |
| E1 | 400 | One or more inputs are missing or invalid: an invalid datetime, a duration under 60 seconds, a radius outside 5 to 30 miles, an oversized image or wrong file type, an unrecognised gender value, an unknown interests id, or an advertised_name over 100 characters, starting with http://, https:// or www., or containing HTML or a line break. |
| E1 | 400 | start_datetime is more than 60 seconds before now (UTC): nothing created or charged. Message: "start_datetime cannot be in the past. Use the current time or later." |
| E1 | 400 | A card payment (payment_method=E) below Stripe's minimum for your currency: nothing created; the message names the minimum. |
| E1 | 400 | The Idempotency-Key header is missing. Message: "Idempotency-Key header is required." |
| E2 | 200 | The image failed automated content moderation: nothing created. Choose a different image. |
| E3 | 200 | Your balance (the API key owner's, in the offer's mode) is less than the offer's cost (payment_method=B only): top up in the Ad Portal and retry. |
| E4 | 400 | Offer quota limit exceeded: the user or organisation has reached its maximum number of offers. |
| E5 | 400 | No Agilis users match the targeting supplied: nothing created. Widen the radius or broaden the gender or interests targeting. |
| E6 | 400 | Your billing currency cannot be billed right now: nothing created or charged. The message is either Your organisation's currency (XYZ) is not one Agilis bills in. An Org Admin can choose a supported billing currency in the Ad Portal. You have not been charged. or Prices in XYZ are temporarily unavailable because the exchange rate is out of date. Please try again later. You have not been charged., with your currency code in place of XYZ. |
| E17 | 200 | LIVE only: this would go over one of your organisation's spending limits (for one listing, a day or a month, the organisation's or the API key owner's own). Nothing was created or charged. limit gives applies_to (organisation or person), period (listing, day or month), amount, spent, price, currency, resets_at (UTC, null for one listing) and time_zone. An Org Admin sets limits in the Ad Portal under Settings. A dry run returns the same. |
| E10 | 400 | push_notification_title or push_notification_message is missing or empty: nothing created or charged. The message names the field, for example "push_notification_title is required." |
| E11 | 400 | push_notification_title or push_notification_message is shorter than 5 characters: nothing created or charged. The message names the field. |
| E12 | 400 | push_notification_title is over 50 characters, or push_notification_message over 150: nothing created or charged. The message names the field and its limit. |
| E13 | 400 | The notification text failed automated content moderation: nothing created or charged. The message names the field, for example "push_notification_message can't be used in a notification. Please change it." |
| E14 | 400 | button_preset is not one of claim_offer, visit_website, install_app, book_now, get_directions or custom: nothing created or charged. |
| E15 | 400 | button_preset is custom and button_text is missing, empty, or contains a line break or HTML: nothing created or charged. Message: "button_text is required when button_preset is custom, as plain text on one line." |
| E16 | 400 | button_text is over 20 characters: nothing created or charged. Message: "button_text must be 20 characters or fewer." |
| E1 | 403 | environment is not your API key's mode: nothing created or charged. Use a key created in that mode. |
| E9 | 403 | Your organisation has not accepted the current Agilis Advertising Terms and Conditions: nothing created or charged. An Org Admin must accept them in the Ad Portal (adportal.agilis.dating); then retry with the same Idempotency-Key. |
| 409 | 409 | The Idempotency-Key was reused while the first request is still being processed: retry shortly. |
| 422 | 422 | The Idempotency-Key was reused with a different payload. |
| 401 | 401 | Authentication failure. |
| 500 | 500 | Internal server error. |
4 Verify the Offer Was Created
Confirm creation and check the current status by calling View Offers.
curl -X GET "https://ads.agilis.dating/offers?environment=live" \
-H "x-api-key: YOUR_API_KEY_HERE"
offer_status values
| Value | Meaning |
|---|---|
Awaiting Payment | Created via method E; payment not yet received |
Active | Live and visible to Agilis users |
Scheduled | Paid for but start date is in the future |
Paused | Temporarily paused by the advertiser |
Ended | Expiry datetime has passed |
The environment query parameter is mandatory; use test or live (case-insensitive). It must be your API key's own mode: naming the other mode returns HTTP 403.
GET /offers returns a paginated response shaped as { "data": […], "pagination": { "limit", "count", "has_more", "next_cursor" } }. Page with limit (default 20, max 100) and cursor, and optionally filter with offer_status, created_after and created_before. Each offer also carries a status field (enabled or disabled); deleted offers are never returned.Managing an Offer After Creation
Use the pause, resume, analytics, and delete endpoints to manage an offer once it exists. Valid analytics interval values are 24h, 7d, 30d, 60d, 90d, and all (mandatory). Deleting an offer in Awaiting Payment status closes its Stripe payment page first; deleting a paid offer credits its Unused Time to your balance. Full request and response details for each are documented in the Pause and Resume, Analytics, and Delete Offer sections below.
Authentication Notes
- API keys are created in the Agilis Ad Portal under Manage API Keys (Developer role).
- A key is shown once. The Ad Portal shows the full key only when you create it (or roll it). Copy it then and store it securely: Agilis does not keep a copy, so it cannot be shown again. The key list shows only its last four characters. If a key is lost or may have been exposed, use Roll key: you get a new key, shown once, and the old one stops working immediately.
- Each key works in one mode only, and this is enforced: the mode the Ad Portal was in (its test/live mode toggle) when the key was created. A
pk_live_key is a LIVE key and apk_test_key is a TEST key. To work in both modes, create one key in each. - A request whose
environmentnames the other mode is refused with HTTP 403 before anything is created or charged. The message names your key's mode:{"return_code": "E1", "status": "Error", "code": 403, "message": "This is a LIVE API key, so it can only be used with environment=LIVE. Use a TEST key (created in the Ad Portal in TEST MODE) for TEST requests."} - Offers of the other mode are treated as not found: pause, resume, analytics and delete return HTTP 401 (
E1, "Offer not found" on delete), exactly as for an offer that does not exist. - Every bad key gets the same answer: an unknown, wrong, disabled or expired key, a key with no recorded mode, a disabled user account or an organisation that is not approved all return
HTTP 401 {"message": "Unauthorised"}on any endpoint. A request with no key returnsHTTP 401 {"status": false, "message": "API key missing"}. Check the key in the Ad Portal, or create a new one. - Keys have an optional expiry date; an expired key returns the same 401.
- "Try it" on this page works with TEST keys only. A
pk_live_key sent from the API documentation page is refused with HTTP 403:{"return_code": "E1", "message": "Try it works with Test keys only. Create a Test key in the Ad Portal in Test mode."}. LIVE keys work as normal from your own code. - Calls are recorded for 90 days. Every request made with your API key, including refused ones, is recorded with the key, the endpoint (its route, such as
offers/{id}/pause, without ids or the query string), the HTTP status, thereturn_code, the response time, how many files were uploaded with it and the time of the call. The request body, the files, the query string and your IP address are not recorded. Records are deleted after 90 days. Recording does not change any request or response.
Rate limits
- 60 requests a minute per API key, across every endpoint, uploads included. Each key has its own limit, so two keys used from the same address don't share it.
- Every response to a request with a valid key carries
X-RateLimit-Limit(the requests allowed in the current minute) andX-RateLimit-Remaining(how many are left). - Over the limit, the API returns HTTP 429 with a
Retry-Afterheader: the number of seconds to wait before trying again. Retry a refusedPOST /offersorPOST /eventswith the sameIdempotency-Key. - Invalid keys: repeated requests with an invalid API key are refused for a while with HTTP 429 and
Retry-After. Check your key in the Ad Portal, then wait forRetry-Afterbefore trying again. - Separately,
POST /events/previewallows 60 previews per organisation per hour (E8, HTTP 429).
Changes and deprecation
- Agilis may change, add to, version or deprecate parts of the API. We use reasonable endeavours to give you at least 30 days' notice of a change we expect to have a material adverse effect on your existing integration, unless a shorter period or an immediate change is needed for security, operational integrity or legal reasons (Advertising Terms, clause 10.5).
- New endpoints, new optional parameters and new fields in responses can be added at any time. Build your integration to ignore response fields it doesn't recognise.
- You are responsible for maintaining your integration. Test changes with a TEST key before using them with a LIVE key.
- The same policy as data: deprecation.yml. The rate limits as data: rate-limits.yml.
Environment Testing
Use a TEST key (created while the Ad Portal is in TEST mode) and set environment=TEST (in capitals) in the Create Offer request to create offers in a sandbox. Test offers are only returned when calling GET /offers?environment=test with a TEST key, do not appear to real Agilis users in the app, and follow the same creation, payment, and management flow as live offers. Card payments for TEST offers run in Stripe's test mode, and balance payments use the separate TEST balance. When your integration is ready, switch to a LIVE key: the Ad Portal's test/live mode toggle decides which kind of key you create. TEST data is kept 30 days: TEST Offers and Events are deleted automatically, with their images, 30 days after they end (an unpaid one, 30 days after it was created).
Try it
Every endpoint on this page has a Try it panel that sends a real request to the API from this page, in TEST mode.
- Paste a TEST API key (it starts
pk_test_). Try it does not accept LIVE keys. Create a TEST key in the Ad Portal in TEST mode, under Manage API Keys. - Your key stays in this page: it is not saved and not put in the address bar, and it is sent only to
https://ads.agilis.dating. Reloading or leaving the page forgets it. - Requests are real TEST requests: they count towards your key's limit of 60 requests a minute, and you can upload images where an endpoint takes one. TEST Offers and Events are deleted 30 days after they end.
Use the API from an AI coding assistant
Give your assistant the machine-readable reference rather than this page:
- OpenAPI 3.1: https://www.agilis.dating/openapi.json
- The reference as Markdown: https://www.agilis.dating/api-doc.md
- The official SDKs, for Node, Python, PHP, .NET, Java, Go and Ruby: SDKs. Every endpoint below shows its call in each.
- Examples, including every SDK example on this page, and a Postman collection: https://github.com/agilisdating/agilis-ads-api
- The API catalogue, for tools that discover APIs: https://www.agilis.dating/.well-known/api-catalog and https://www.agilis.dating/.well-known/apis.json
Then ask it to work safely. You can paste this brief into your assistant:
Use the Agilis Advertising API (https://ads.agilis.dating). Its OpenAPI description is https://www.agilis.dating/openapi.json and its reference is https://www.agilis.dating/api-doc.md.
Read the API key from the AGILIS_API_KEY environment variable. Never print it, never put it in a prompt, and never write it to a file that is committed.
Use a TEST key (it starts pk_test_) and environment=TEST until I say otherwise.
Estimate the price with POST /offers/price-estimate before creating an Offer.
Before a LIVE create, publish, delete or cancel, send it once with dry_run=true and show me what it would do and cost.
Send an Idempotency-Key with every POST /offers and POST /events, and reuse it when retrying.
Treat any return_code other than S1 or S2 as a failure, even when the HTTP status is 200.
Connect an AI assistant with MCP
The Agilis MCP server lets an MCP-capable assistant (Claude Code, Cursor, VS Code and others) read your organisation's data directly (categories, interests, price estimates, your Offers and Events, and their results) and create and manage your Offers and Events. With a TEST key nothing is real, so you can try a whole flow with your assistant first. With a LIVE key changes are real: members see them, and new Offers and Events are paid from your balance.
Sign in with your Ad Portal account (recommended). Add https://ads.agilis.dating/api/mcp to Claude (Settings › Connectors › Add custom connector), ChatGPT (a workspace custom connector, with OAuth), Codex (codex mcp add agilis --url https://ads.agilis.dating/api/mcp, then codex mcp login agilis), Claude Code (claude mcp add --transport http agilis https://ads.agilis.dating/api/mcp, then /mcp), Cursor or VS Code, with no key and no headers. The tool opens the Ad Portal sign-in; you sign in and choose what it can do (View only, or View, create and manage) and the mode (TEST, or LIVE with a confirmation). It then acts as you, with your Ad Portal rights; Advertisers can create and manage Offers and Events but not webhooks. Connections are listed, and can be disconnected, under AI assistants in the Ad Portal, which also has step-by-step set-up for each tool.
Or use an API key, for tools that can't sign in and for code that runs on its own:
- Address:
https://ads.agilis.dating/api/mcp(Streamable HTTP). - Your API key goes in the
x-api-keyheader (orAuthorization: Bearer). The tools work in your key's own mode: a TEST key sees TEST data, a LIVE key sees LIVE data. Start with a TEST key. - Read tools (any key):
get_balance,list_invoices,list_categories,list_interests,estimate_offer_price,list_offers,get_offer,get_offer_analytics,list_event_categories,get_event_config,list_events,get_event,get_event_analytics. - Write tools (any key, in its own mode):
create_offer,pause_offer,resume_offer,delete_offer,preview_event,publish_event,edit_event,reschedule_event,cancel_event,delete_event. With a TEST key they work on TEST Offers and Events, which members never see; a TEST Offer uses your TEST balance, which is never real money, and a TEST Event is free. With a LIVE key they work on your real Offers and Events:create_offerandpublish_eventare paid from your LIVE balance and return a receipt with the amount taken, the balance left and a link to the Ad Portal. Payment is always from the existing balance: no tool tops up a balance or takes a card payment. Useestimate_offer_priceandget_event_configfirst to see the cost.create_offer,delete_offer,publish_event,cancel_eventanddelete_eventalso takedry_run: true, which checks everything and says what would happen and cost without doing it, and is not listed under API activity. - Every change made with your keys, through the API or MCP, or by a signed-in AI assistant, is listed under API activity in the Ad Portal, with the key or the app's name, the tool and the amount.
- Images for
create_offerand the Event tools are given as a publichttpsaddress of a JPEG or PNG (image_url); the same image rules apply as for an upload. - Keep the key in an environment variable,
AGILIS_API_KEYbelow. Never paste it into a chat with the assistant or into a file you commit.
Claude Code: add this to .mcp.json in your project. Claude Code reads AGILIS_API_KEY from your environment:
{
"mcpServers": {
"agilis-ads": {
"type": "http",
"url": "https://ads.agilis.dating/api/mcp",
"headers": { "x-api-key": "${AGILIS_API_KEY}" }
}
}
}
Cursor: add this to ~/.cursor/mcp.json, or .cursor/mcp.json in your project:
{
"mcpServers": {
"agilis-ads": {
"url": "https://ads.agilis.dating/api/mcp",
"headers": { "x-api-key": "${env:AGILIS_API_KEY}" }
}
}
}
VS Code: add this to .vscode/mcp.json. VS Code asks for the key once and keeps it in its secure storage:
{
"inputs": [
{ "type": "promptString", "id": "agilis-api-key", "description": "Agilis API key (TEST to start)", "password": true }
],
"servers": {
"agilis-ads": {
"type": "http",
"url": "https://ads.agilis.dating/api/mcp",
"headers": { "x-api-key": "${input:agilis-api-key}" }
}
}
}
Other MCP clients: use the Streamable HTTP transport, the address above, and send your key in the x-api-key header from your client's secret store.
Tools: get_balance (your own balance, and for an Org Admin the Organisation balance), list_invoices, list_categories, list_interests, estimate_offer_price, list_offers, get_offer, get_offer_analytics, list_event_categories, get_event_config (your Event listing fee and balance), list_events, get_event and get_event_analytics. Each call counts towards your key's limit like a REST request.
SDKs
Official libraries for seven languages make the requests on this page for you. Every endpoint's section shows its call in each of them: choose a language once and every example on the page follows.
- Every endpoint, with the API's own field names. Images are uploaded from a file path, bytes or a stream.
- The client reads your key from
AGILIS_API_KEYwhen you don't pass one, and fills inenvironmentfrom the key, so a TEST key always works in TEST. POST /offersandPOST /eventssend anIdempotency-Keyfor you and reuse it when they retry, so a retry never creates or charges twice. Requests are retried only when that is safe.- Any
Ereturn code raises an error, even when the HTTP status is 200. - Lists can be read page by page or all at once, and webhook signatures are checked in one call.
| Language | Package | Source | Requires |
|---|---|---|---|
| Node.js and TypeScript | @agilisdating/ads npm |
agilis-ads-node | Node.js 20 or later |
| Python | agilis-ads PyPI |
agilis-ads-python | Python 3.10 or later |
| PHP | agilisdating/agilis-ads Packagist |
agilis-ads-php | PHP 8.2 or later, with any PSR-18 HTTP client (Guzzle suggested) |
| .NET (C#) | Agilis.Ads NuGet |
agilis-ads-dotnet | .NET 8 or later, or .NET Standard 2.0; usable from Visual Basic too |
| Java | dating.agilis:agilis-ads Maven Central |
agilis-ads-java | Java 17 or later |
| Go | github.com/agilisdating/agilis-ads-go pkg.go.dev |
agilis-ads-go | Go 1.22 or later |
| Ruby | agilis-ads RubyGems |
agilis-ads-ruby | Ruby 3.2 or later |
Each package is published on its registry. Its GitHub repository has the full guide, examples and changelog.
Install
npm install @agilisdating/ads
Example: list the Offer categories
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.categories.list();
console.log(result.categories?.length);
Install
pip install agilis-ads
Example: list the Offer categories
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.categories.list()
print(len(result["categories"]))
Install
composer require agilisdating/agilis-ads guzzlehttp/guzzle
Example: list the Offer categories
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->categories->list();
echo count($result['categories']), "\n";
Install
dotnet add package Agilis.Ads
Example: list the Offer categories
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Categories.ListAsync();
Console.WriteLine(result.Categories.Count);
Install
implementation("dating.agilis:agilis-ads:0.1.0")
Gradle (Kotlin). With Maven: groupId dating.agilis, artifactId agilis-ads, version 0.1.0.
Example: list the Offer categories
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.categories().list();
System.out.println(result.getCategories().size());
Install
go get github.com/agilisdating/agilis-ads-go
Example: list the Offer categories
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Categories.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Categories))
}
Install
gem install agilis-ads
Example: list the Offer categories
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.categories.list
puts result.categories.length
Category List
GET
/categories
Returns all active categories available to the organisation that owns the API key. It is typically called before creating an offer, because offer creation requires a valid category ID returned by this endpoint.
- Header
x-api-key: YOUR_API_KEY_HERE
Response fields
category_idinteger- Unique ID of the category. Example: 1
category_namestring- Name of the category. Example: "Retail"
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Categories retrieved successfully. |
| 401 | 401 | Invalid API key or disabled account. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/categories
curl -X GET "https://ads.agilis.dating/categories" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.categories.list();
console.log(result.categories?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.categories.list()
print(len(result["categories"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->categories->list();
echo count($result['categories']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Categories.ListAsync();
Console.WriteLine(result.Categories.Count);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.categories().list();
System.out.println(result.getCategories().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Categories.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Categories))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.categories.list
puts result.categories.length
Example response
{
"categories": [
{
"category_id": 1,
"category_name": "Retail"
},
{
"category_id": 2,
"category_name": "Food & Beverage"
}
]
}
Interest List
GET
/interests
Returns the interests available for offer targeting. Call it before creating an offer if you intend to use the optional interests array, which restricts the offer to users who have selected at least one of the interests supplied.
- Header
x-api-key: YOUR_API_KEY_HERE
Response fields
interest_idinteger- Unique ID of the interest. Example: 3
interest_namestring- Name of the interest. Example: "Cooking"
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Interests retrieved successfully. |
| 401 | 401 | Invalid API key or disabled account. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/interests
curl -X GET "https://ads.agilis.dating/interests" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.interests.list();
console.log(result.interests?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.interests.list()
print(len(result["interests"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->interests->list();
echo count($result['interests']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Interests.ListAsync();
Console.WriteLine(result.Interests.Count);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.interests().list();
System.out.println(result.getInterests().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Interests.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Interests))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.interests.list
puts result.interests.length
Example response
{
"interests": [
{
"interest_id": 3,
"interest_name": "Cooking"
},
{
"interest_id": 7,
"interest_name": "Fitness"
}
]
}
Offer Price Estimate
POST
/offers/price-estimate
Calculates what an offer will cost before it is created: its size in Ad Units (duration in hours × the number of Agilis users it would reach) and what those units cost in money. Only active, non-banned accounts are counted. Pass the same gender and interests values you intend to create the offer with, otherwise the estimate will be higher than the amount actually charged.
price_estimate is a number of Ad Units, not money. estimated_cost is the money the offer will cost, and is the figure to compare with your balance.
There is no currency parameter: the estimate is always in your organisation's billing currency, named in the response's currency field.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
start_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC. Now or later: a start more than 60 seconds before now (UTC) is refused with E1. Example: "2027-07-10T08:00:00Z" |
end_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC. Example: "2027-07-12T20:30:00Z" |
location |
array of 2 numbers | Yes | Latitude and longitude. Example: [51.5074, -0.1278] |
radius |
integer | Yes | Miles, minimum 5, maximum 30. Example: 10 |
gender |
array of strings | No | One or more of Male, Female, Non-binary, All. Omit, or include All, to reach every gender. Example: ["Male", "Female"] |
interests |
array of integers | No | Interest ids from GET /interests. A user matches if they share any of them. Omit to apply no interest filter. Example: [3, 7] |
environment |
string | No | TEST or LIVE. Defaults to your API key's own mode. If sent, it must be your key's mode (HTTP 403 otherwise). The Ad Unit price is the same in both. |
Response fields
price_estimatenumber- Size of the offer in Ad Units. Not money.
ad_unitsnumber- The same figure, under a clearer name.
price_estimateis kept for existing integrations. matching_usersinteger- Agilis users the offer would reach.
0means it cannot be created as specified: widen the radius or broaden the targeting. ad_unit_pricenumber|null- Price of one Ad Unit in
currency, to 6 decimal places: £0.001 × the day's European Central Bank rate. estimated_costnumber|null- The money the offer will cost. Compare this with your balance.
currencystring- Your organisation's billing currency.
exchange_rate_per_gbpnumber|null- The rate used, per pound sterling.
1for GBP. exchange_rate_datestring|null- The rate's date (
YYYY-MM-DD);nullfor GBP. spending_limitobject- LIVE keys only, and only when
estimated_costwould go over one of your organisation's spending limits:messageplus the same fields aslimitinE17. Creating this Offer would be refused withE17.
If your billing currency cannot be billed right now (not one Agilis bills in, or its rate is out of date), ad_unit_price, estimated_cost, exchange_rate_per_gbp and exchange_rate_date are null; the Ad Unit figures are still returned, and POST /offers would refuse the offer with E6.
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Estimate calculated successfully. |
| E1 | 400 | One or more inputs are missing or invalid, or start_datetime is in the past (more than 60 seconds before now). |
| E2 | 400 | A date/time is not in valid ISO 8601 format. |
| E1 | 403 | environment is not your API key's mode. |
| 401 | 401 | Authentication failure. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers/price-estimate
curl -X POST "https://ads.agilis.dating/offers/price-estimate" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-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,
"gender": ["Male", "Female"],
"interests": [3, 7]
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.offers.estimatePrice({
start_datetime: '2027-07-10T08:00:00Z',
end_datetime: '2027-07-12T20:30:00Z',
location: [51.5074, -0.1278],
radius: 10,
gender: ['Male', 'Female'],
interests: [3, 7],
});
console.log(result.estimated_cost);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.offers.estimate_price({
"start_datetime": "2027-07-10T08:00:00Z",
"end_datetime": "2027-07-12T20:30:00Z",
"location": [51.5074, -0.1278],
"radius": 10,
"gender": ["Male", "Female"],
"interests": [3, 7],
})
print(result["estimated_cost"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->offers->estimatePrice([
'start_datetime' => '2027-07-10T08:00:00Z',
'end_datetime' => '2027-07-12T20:30:00Z',
'location' => [51.5074, -0.1278],
'radius' => 10,
'gender' => ['Male', 'Female'],
'interests' => [3, 7],
]);
echo $result['estimated_cost'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Offers.EstimatePriceAsync(new OfferPriceEstimateParams
{
StartDatetime = DateTimeOffset.Parse("2027-07-10T08:00:00Z"),
EndDatetime = DateTimeOffset.Parse("2027-07-12T20:30:00Z"),
Location = new GeoLocation(51.5074, -0.1278),
Radius = 10,
Gender = new[] { "Male", "Female" },
Interests = new[] { 3, 7 },
});
Console.WriteLine(result.EstimatedCost);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.EstimateOfferPriceParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.offers().estimatePrice(
EstimateOfferPriceParams.builder()
.startDatetime("2027-07-10T08:00:00Z")
.endDatetime("2027-07-12T20:30:00Z")
.location(51.5074, -0.1278)
.radius(10)
.gender("Male", "Female")
.interests(3, 7)
.build());
System.out.println(result.getEstimatedCost());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Offers.EstimatePrice(ctx, &agilisads.EstimateOfferPriceParams{
StartDatetime: "2027-07-10T08:00:00Z",
EndDatetime: "2027-07-12T20:30:00Z",
Location: agilisads.LatLng{Latitude: 51.5074, Longitude: -0.1278},
Radius: 10,
Gender: []string{"Male", "Female"},
Interests: []int64{3, 7},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.EstimatedCost)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.offers.estimate_price(
start_datetime: "2027-07-10T08:00:00Z",
end_datetime: "2027-07-12T20:30:00Z",
location: [51.5074, -0.1278],
radius: 10,
gender: ["Male", "Female"],
interests: [3, 7]
)
puts result.estimated_cost
Example response
{
"return_code": "S1",
"price_estimate": 110110,
"matching_users": 1820,
"ad_units": 110110,
"ad_unit_price": 0.001,
"estimated_cost": 110.11,
"currency": "GBP",
"exchange_rate_per_gbp": 1,
"exchange_rate_date": null
}
Create Offer
POST
/offers
Creates a new offer for the authenticated advertiser. The request is sent as multipart/form-data with the offer image supplied as a binary file stream. The image is checked by automated content moderation before the offer is created: if it fails, nothing is created and nothing is charged.
Paying by Stripe link (payment_method=E): the offer is created in Awaiting Payment and the response carries a payment_url. Stripe's checkout.session.completed webhook activates it: Active if its start has passed, Scheduled if not. An organisation registered in the UK pays VAT at 20% on top, as a separate line on the Stripe page. Stripe will not take a card payment below its minimum for the currency (for example £0.30, US$0.50 or €0.50): such an offer is refused with E1.
Paying from balance (payment_method=B): the offer's price is deducted at once, from the balance of the offer's own mode (TEST and LIVE balances are separate). Compare your balance with estimated_cost from the price estimate, never price_estimate.
There is no currency parameter: every offer is priced and charged in your organisation's billing currency, named in the response.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
multipart/form-data
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key header |
string | Yes | A unique value you generate per offer (for example a UUID v4). Replaying the same key safely retries the request without creating a duplicate offer or a second Stripe payment; the original response, including any payment_url, is returned verbatim. Missing: HTTP 400 / E1. |
dry_run query |
boolean | No | Optional. true checks everything and answers with what the offer would cost and how it would be paid (price, matching_members, and balance_after or card_amount), marked dry_run: true. Nothing is created or charged, and no Idempotency-Key is needed. The image is checked for type and size; its content moderation runs only when the offer is created. |
category_id |
integer | Yes | A valid category ID from the Category List API. Example: 1 |
title |
string | Yes | Up to 40 characters. Example: "20% off summer sale" |
description |
string | Yes | Up to 500 characters. Example: "Discount valid through July" |
terms_and_conditions |
string | No | Up to 500 characters. Example: "Valid online only." |
advertised_name |
string | No | The business name members see on the offer instead of your organisation's trading name — for example when an agency advertises for a client. Up to 100 characters; must not start with http://, https:// or www.; no HTML or line breaks. Omit or send empty to show your trading name. You must be authorised by the business you name. Invoices and analytics stay in your organisation's name. Example: "Brighton Bakehouse" |
push_notification_title |
string | Yes | The title of the notification sent to members who chose to get offer notifications, shown on their lock screen as you write it (it is not translated). 5 to 50 characters. Missing: E10; too short: E11; too long: E12; refused by content moderation: E13. Example: "20% off this summer" |
push_notification_message |
string | Yes | The notification's message, under the title. 5 to 150 characters; phones cut it at about 100, so keep it short. Same return codes as push_notification_title. Example: "Show this at the till for 20% off everything until the end of July." |
button_preset |
string | No | The words on the offer's button in the Agilis apps and web app: claim_offer (Claim Offer, the default when omitted or empty), visit_website (Visit our website), install_app (Install our app), book_now (Book now), get_directions (Get directions) or custom (your own words, in button_text). Ready-made texts are shown in each member's app language. Whatever the text, the button opens your url. Any other value: E14. Example: "book_now" |
button_text |
string | No | Your own button text: required when button_preset is custom, ignored otherwise. Plain text on one line, 1 to 20 characters after trimming, shown exactly as you write it in every language (it is not translated). Missing, empty, with a line break or with HTML: E15; over 20 characters: E16. Example: "Show this at the bar" |
url |
string (URL) | Yes | Your offer page. Example: "https://advertiseroffer.com" |
image |
file | Yes | JPG, PNG or GIF, maximum 5 MB, sent as a binary file stream. Recommended size: 1080x1080px |
location[] |
array of 2 numbers | Yes | Latitude and longitude as two values. Example: [51.5074, -0.1278] |
radius |
integer | Yes | Radius in miles, minimum 5, maximum 30. Example: 10 |
gender[] |
array of strings | No | Target specific genders. One or more of Male, Female, Non-binary, All. Omitting the field, or including All, reaches every gender. Narrowing this reduces the audience and therefore the price. Example: ["Male", "Female"] |
interests[] |
array of integers | No | Target users by interest, using ids from GET /interests. A user matches if they share any of the interests supplied. Omitting the field applies no interest filter. Narrowing this reduces the audience and therefore the price. Example: [3, 7] |
start_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC. Now or later: a start more than 60 seconds before now (UTC) is refused with E1. Example: "2027-07-10T08:00:00Z" |
expiry_datetime |
string (ISO 8601) | Yes | ISO 8601, UTC; at least 60 seconds after start_datetime. Example: "2027-07-12T20:30:00Z" |
payment_method |
string | Yes | E = Stripe payment link by email; B = deduct from your own balance: the balance of the person who owns the API key, in the offer's mode (TEST and LIVE balances are separate). The Organisation balance in the Ad Portal is everyone's balances added together, not a shared wallet. For E, an organisation registered in the UK is charged VAT at 20% on top, as a separate line on the Stripe payment page. The offer's price and balance stay net of VAT. |
environment |
string | Yes | TEST or LIVE, in capitals. Must be your API key's own mode: a pk_live_ key creates LIVE offers only, a pk_test_ key TEST offers only. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Offer created: payment link issued (E), or Active/Scheduled if paid from balance (B). |
| E1 | 400 | One or more inputs are missing or invalid: an invalid datetime, a duration under 60 seconds, a radius outside 5 to 30 miles, an oversized image or wrong file type, an unrecognised gender value, an unknown interests id, or an advertised_name over 100 characters, starting with http://, https:// or www., or containing HTML or a line break. |
| E1 | 400 | start_datetime is more than 60 seconds before now (UTC): nothing created or charged. Message: "start_datetime cannot be in the past. Use the current time or later." |
| E1 | 400 | A card payment (payment_method=E) below Stripe's minimum for your currency: nothing created; the message names the minimum. |
| E1 | 400 | The Idempotency-Key header is missing. Message: "Idempotency-Key header is required." |
| E2 | 200 | The image failed automated content moderation: nothing created. Choose a different image. |
| E3 | 200 | Your balance (the API key owner's, in the offer's mode) is less than the offer's cost (payment_method=B only): top up in the Ad Portal and retry. |
| E4 | 400 | Offer quota limit exceeded: the user or organisation has reached its maximum number of offers. |
| E5 | 400 | No Agilis users match the targeting supplied: nothing created. Widen the radius or broaden the gender or interests targeting. |
| E6 | 400 | Your billing currency cannot be billed right now: nothing created or charged. The message is either Your organisation's currency (XYZ) is not one Agilis bills in. An Org Admin can choose a supported billing currency in the Ad Portal. You have not been charged. or Prices in XYZ are temporarily unavailable because the exchange rate is out of date. Please try again later. You have not been charged., with your currency code in place of XYZ. |
| E17 | 200 | LIVE only: this would go over one of your organisation's spending limits (for one listing, a day or a month, the organisation's or the API key owner's own). Nothing was created or charged. limit gives applies_to (organisation or person), period (listing, day or month), amount, spent, price, currency, resets_at (UTC, null for one listing) and time_zone. An Org Admin sets limits in the Ad Portal under Settings. A dry run returns the same. |
| E10 | 400 | push_notification_title or push_notification_message is missing or empty: nothing created or charged. The message names the field, for example "push_notification_title is required." |
| E11 | 400 | push_notification_title or push_notification_message is shorter than 5 characters: nothing created or charged. The message names the field. |
| E12 | 400 | push_notification_title is over 50 characters, or push_notification_message over 150: nothing created or charged. The message names the field and its limit. |
| E13 | 400 | The notification text failed automated content moderation: nothing created or charged. The message names the field, for example "push_notification_message can't be used in a notification. Please change it." |
| E14 | 400 | button_preset is not one of claim_offer, visit_website, install_app, book_now, get_directions or custom: nothing created or charged. |
| E15 | 400 | button_preset is custom and button_text is missing, empty, or contains a line break or HTML: nothing created or charged. Message: "button_text is required when button_preset is custom, as plain text on one line." |
| E16 | 400 | button_text is over 20 characters: nothing created or charged. Message: "button_text must be 20 characters or fewer." |
| E1 | 403 | environment is not your API key's mode: nothing created or charged. Use a key created in that mode. |
| E9 | 403 | Your organisation has not accepted the current Agilis Advertising Terms and Conditions: nothing created or charged. An Org Admin must accept them in the Ad Portal (adportal.agilis.dating); then retry with the same Idempotency-Key. |
| 409 | 409 | The Idempotency-Key was reused while the first request is still being processed: retry shortly. |
| 422 | 422 | The Idempotency-Key was reused with a different payload. |
| 401 | 401 | Authentication failure. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Send the same value to retry safely. Choose New before creating another one.
One name=value per line. Repeat a name for a list, such as location[].
Response
/offers
curl -X POST "https://ads.agilis.dating/offers" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Idempotency-Key: 3f1a9c7e-1b2d-4f9a-8c0e-2a6b5d4e7f10" \
-F "category_id=1" \
-F "title=20% off summer sale" \
-F "description=Discount valid through July" \
-F "terms_and_conditions=Valid online only." \
-F "push_notification_title=20% off this summer" \
-F "push_notification_message=Show this at the till for 20% off everything until the end of July." \
-F "button_preset=book_now" \
-F "url=https://advertiseroffer.com" \
-F "location[]=51.5074" \
-F "location[]=-0.1278" \
-F "radius=10" \
-F "gender[]=Male" \
-F "gender[]=Female" \
-F "interests[]=3" \
-F "interests[]=7" \
-F "start_datetime=2027-07-10T08:00:00Z" \
-F "expiry_datetime=2027-07-12T20:30:00Z" \
-F "payment_method=E" \
-F "environment=LIVE" \
-F "image=@/path/to/offer.jpg"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
const result = await client.offers.create({
category_id: 1,
title: '20% off summer sale',
description: 'Discount valid through July',
terms_and_conditions: 'Valid online only.',
push_notification_title: '20% off this summer',
push_notification_message: 'Show this at the till for 20% off everything until the end of July.',
button_preset: 'book_now',
url: 'https://advertiseroffer.com',
location: [51.5074, -0.1278],
radius: 10,
gender: ['Male', 'Female'],
interests: [3, 7],
start_datetime: '2027-07-10T08:00:00Z',
expiry_datetime: '2027-07-12T20:30:00Z',
payment_method: 'E',
image: '/path/to/offer.jpg',
});
console.log(result.offer_id);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
# An Idempotency-Key is sent for you, and reused if the request is retried.
result = client.offers.create({
"category_id": 1,
"title": "20% off summer sale",
"description": "Discount valid through July",
"terms_and_conditions": "Valid online only.",
"push_notification_title": "20% off this summer",
"push_notification_message": "Show this at the till for 20% off everything until the end of July.",
"button_preset": "book_now",
"url": "https://advertiseroffer.com",
"location": [51.5074, -0.1278],
"radius": 10,
"gender": ["Male", "Female"],
"interests": [3, 7],
"start_datetime": "2027-07-10T08:00:00Z",
"expiry_datetime": "2027-07-12T20:30:00Z",
"payment_method": "E",
"image": "/path/to/offer.jpg",
})
print(result["offer_id"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
$result = $agilis->offers->create([
'category_id' => 1,
'title' => '20% off summer sale',
'description' => 'Discount valid through July',
'terms_and_conditions' => 'Valid online only.',
'push_notification_title' => '20% off this summer',
'push_notification_message' => 'Show this at the till for 20% off everything until the end of July.',
'button_preset' => 'book_now',
'url' => 'https://advertiseroffer.com',
'location' => [51.5074, -0.1278],
'radius' => 10,
'gender' => ['Male', 'Female'],
'interests' => [3, 7],
'start_datetime' => '2027-07-10T08:00:00Z',
'expiry_datetime' => '2027-07-12T20:30:00Z',
'payment_method' => 'E',
'image' => '/path/to/offer.jpg',
]);
echo $result['offer_id'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
var result = await client.Offers.CreateAsync(new OfferCreateParams
{
CategoryId = 1,
Title = "20% off summer sale",
Description = "Discount valid through July",
TermsAndConditions = "Valid online only.",
PushNotificationTitle = "20% off this summer",
PushNotificationMessage = "Show this at the till for 20% off everything until the end of July.",
ButtonPreset = "book_now",
Url = "https://advertiseroffer.com",
Location = new GeoLocation(51.5074, -0.1278),
Radius = 10,
Gender = new[] { "Male", "Female" },
Interests = new[] { 3, 7 },
StartDatetime = DateTimeOffset.Parse("2027-07-10T08:00:00Z"),
ExpiryDatetime = DateTimeOffset.Parse("2027-07-12T20:30:00Z"),
PaymentMethod = "E",
Image = FileUpload.FromPath("/path/to/offer.jpg"),
});
Console.WriteLine(result.OfferId);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.CreateOfferParams;
import java.nio.file.Path;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
var result = client.offers().create(
CreateOfferParams.builder()
.categoryId(1)
.title("20% off summer sale")
.description("Discount valid through July")
.termsAndConditions("Valid online only.")
.pushNotificationTitle("20% off this summer")
.pushNotificationMessage("Show this at the till for 20% off everything until the end of July.")
.buttonPreset("book_now")
.url("https://advertiseroffer.com")
.location(51.5074, -0.1278)
.radius(10)
.gender("Male", "Female")
.interests(3, 7)
.startDatetime("2027-07-10T08:00:00Z")
.expiryDatetime("2027-07-12T20:30:00Z")
.paymentMethod("E")
.image(Path.of("/path/to/offer.jpg"))
.build());
System.out.println(result.getOfferId());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
// An Idempotency-Key is sent for you, and reused if the request is retried.
result, err := client.Offers.Create(ctx, &agilisads.CreateOfferParams{
CategoryID: 1,
Title: "20% off summer sale",
Description: "Discount valid through July",
TermsAndConditions: agilisads.String("Valid online only."),
PushNotificationTitle: "20% off this summer",
PushNotificationMessage: "Show this at the till for 20% off everything until the end of July.",
ButtonPreset: "book_now",
URL: "https://advertiseroffer.com",
Location: agilisads.LatLng{Latitude: 51.5074, Longitude: -0.1278},
Radius: 10,
Gender: []string{"Male", "Female"},
Interests: []int64{3, 7},
StartDatetime: "2027-07-10T08:00:00Z",
ExpiryDatetime: "2027-07-12T20:30:00Z",
PaymentMethod: "E",
Image: agilisads.FileFromPath("/path/to/offer.jpg"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.OfferID)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
# An Idempotency-Key is sent for you, and reused if the request is retried.
result = client.offers.create(
category_id: 1,
title: "20% off summer sale",
description: "Discount valid through July",
terms_and_conditions: "Valid online only.",
push_notification_title: "20% off this summer",
push_notification_message: "Show this at the till for 20% off everything until the end of July.",
button_preset: "book_now",
url: "https://advertiseroffer.com",
location: [51.5074, -0.1278],
radius: 10,
gender: ["Male", "Female"],
interests: [3, 7],
start_datetime: "2027-07-10T08:00:00Z",
expiry_datetime: "2027-07-12T20:30:00Z",
payment_method: "E",
image: "/path/to/offer.jpg"
)
puts result.offer_id
Example response
{
"return_code": "S1",
"offer_id": 45,
"status": "Awaiting Payment",
"payment_url": "https://checkout.stripe.com/c/pay/cs_live_...",
"currency": "GBP"
}
// payment_method=B, start in the future (HTTP 200, S1):
// { "return_code": "S1", "offer_id": 46, "status": "Scheduled", "payment_url": null }
View Offers
GET
/offers
Returns a paginated list of offers created by the authenticated advertiser for the requested environment, newest first. Offers whose image was rejected by content moderation are never created, so they are not returned, and deleted offers are excluded. Page through results with limit and cursor.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
environment query |
string | Yes | test or live (case-insensitive). Must be your API key's own mode. Example: /offers?environment=test |
limit query |
integer | No | Page size. Default 20, maximum 100. |
cursor query |
string | No | Opaque token from the previous page's next_cursor. Omit for the first page. |
offer_status query |
string | No | Lifecycle filter: awaiting_payment, active, paused or ended (case-insensitive). |
created_after query |
string (ISO 8601) | No | ISO 8601, UTC. Offers created at or after this time. |
created_before query |
string (ISO 8601) | No | ISO 8601, UTC. Offers created at or before this time. |
Response fields
Each offer in data contains:
offer_idinteger- The offer's id.
title, category, description, terms_and_conditions, urlstring- As created.
advertised_namestring|null- The business name members see;
nullwhen your trading name is shown. push_notification_title, push_notification_messagestring|null- The notification members who opted in get when the offer starts.
nullon offers created before these fields existed: those offers are never sent as a notification. button_presetstring- The button's text:
claim_offer,visit_website,install_app,book_now,get_directionsorcustom.claim_offeron offers created before the button text could be chosen. button_textstring|null- Your own button text when
button_presetiscustom; otherwisenull. imagestring- Signed URL of the image. It expires, so do not store it.
latitude, longitude, radiusnumber- Where the offer is shown.
genderarray- For example
["Male","Female"]; empty when the offer targets every gender. interestsarray{interest_id, interest_name}objects; empty when no interest targeting was applied.start_datetime, expiry_datetime, creation_datetimestring- ISO 8601, UTC.
offer_statusstring- Awaiting Payment, Active, Scheduled, Paused or Ended.
statusstringenabledordisabled: whether an Admin has disabled the offer.
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Page returned (empty data array if none match). |
| 400 | 400 | Invalid query parameter (limit, cursor, offer_status or date). |
| 401 | 401 | Invalid API key or disabled account. |
| 403 | 403 | environment is not your API key's mode. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers
curl -X GET "https://ads.agilis.dating/offers?environment=test&limit=20" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.offers.list({
limit: 20,
});
console.log(result.data?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.offers.list({
"limit": 20,
})
print(len(result["data"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->offers->list([
'limit' => 20,
]);
echo count($result['data']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Offers.ListAsync(new OfferListParams
{
Limit = 20,
});
Console.WriteLine(result.Data.Count);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.ListOffersParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.offers().list(
ListOffersParams.builder()
.limit(20)
.build());
System.out.println(result.getData().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Offers.List(ctx, &agilisads.ListOffersParams{
Limit: 20,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Data))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.offers.list(
limit: 20
)
puts result.data.length
Example response
{
"data": [
{
"offer_id": 45,
"title": "20% off summer sale",
"category": "Retail",
"description": "Discount valid through July",
"terms_and_conditions": "Valid online only.",
"advertised_name": null,
"push_notification_title": "20% off this summer",
"push_notification_message": "Show this at the till for 20% off everything until the end of July.",
"button_preset": "claim_offer",
"button_text": null,
"url": "https://advertiseroffer.com",
"image": "https://ads.agilis.dating/92/offers/45/offer_orig.png",
"latitude": 51.5074,
"longitude": -0.1278,
"radius": 10,
"gender": ["Male", "Female"],
"interests": [
{
"interest_id": 3,
"interest_name": "Cooking"
},
{
"interest_id": 7,
"interest_name": "Fitness"
}
],
"start_datetime": "2027-07-10T08:00:00Z",
"expiry_datetime": "2027-07-12T20:30:00Z",
"creation_datetime": "2027-06-01T10:00:00Z",
"offer_status": "Active",
"status": "enabled"
}
],
"pagination": {
"limit": 20,
"count": 1,
"has_more": false,
"next_cursor": null
}
}
View an Offer
GET
/offers/{offer_id}
Returns one offer, with the same fields as an item of GET /offers, in your API key's mode. An Org Admin's key can read any offer in the organisation; other keys read their own offers. Read only: offers cannot be edited.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
offer_id path |
integer | Yes | Path parameter. Example: 45 |
Response fields
offer_idinteger- The offer's id.
title, category, description, terms_and_conditions, urlstring- As created.
advertised_namestring|null- The business name members see;
nullwhen your trading name is shown. push_notification_title, push_notification_messagestring|null- The notification members who opted in get when the offer starts.
nullon offers created before these fields existed: those offers are never sent as a notification. button_presetstring- The button's text:
claim_offer,visit_website,install_app,book_now,get_directionsorcustom.claim_offeron offers created before the button text could be chosen. button_textstring|null- Your own button text when
button_presetiscustom; otherwisenull. imagestring- Signed URL of the image. It expires, so do not store it.
latitude, longitude, radiusnumber- Where the offer is shown.
genderarray- For example
["Male","Female"]; empty when the offer targets every gender. interestsarray{interest_id, interest_name}objects; empty when no interest targeting was applied.start_datetime, expiry_datetime, creation_datetimestring- ISO 8601, UTC.
offer_statusstring- Awaiting Payment, Active, Scheduled, Paused or Ended.
statusstringenabledordisabled: whether an Admin has disabled the offer.
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Offer returned. |
| E1 | 404 | "Offer not found": no such offer, or it belongs to another account, is in the other mode, or was deleted. |
| 401 | 401 | Invalid API key or disabled account. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers/{offer_id}
curl -X GET "https://ads.agilis.dating/offers/45" \
-H "x-api-key: YOUR_API_KEY_HERE"
// offers.get() arrives in the next release of this SDK.
// Until then, call GET /offers/{offer_id} directly: see the cURL tab.
# offers.get() arrives in the next release of this SDK.
# Until then, call GET /offers/{offer_id} directly: see the cURL tab.
// offers.get() arrives in the next release of this SDK.
// Until then, call GET /offers/{offer_id} directly: see the cURL tab.
// offers.get() arrives in the next release of this SDK.
// Until then, call GET /offers/{offer_id} directly: see the cURL tab.
// offers.get() arrives in the next release of this SDK.
// Until then, call GET /offers/{offer_id} directly: see the cURL tab.
// offers.get() arrives in the next release of this SDK.
// Until then, call GET /offers/{offer_id} directly: see the cURL tab.
# offers.get() arrives in the next release of this SDK.
# Until then, call GET /offers/{offer_id} directly: see the cURL tab.
Example response
{
"offer_id": 45,
"title": "20% off summer sale",
"category": "Retail",
"description": "Discount valid through July",
"terms_and_conditions": "Valid online only.",
"advertised_name": null,
"push_notification_title": "20% off this summer",
"push_notification_message": "Show this at the till for 20% off everything until the end of July.",
"button_preset": "claim_offer",
"button_text": null,
"url": "https://advertiseroffer.com",
"image": "https://ads.agilis.dating/92/offers/45/offer_orig.png",
"latitude": 51.5074,
"longitude": -0.1278,
"radius": 10,
"gender": ["Male", "Female"],
"interests": [
{
"interest_id": 3,
"interest_name": "Cooking"
},
{
"interest_id": 7,
"interest_name": "Fitness"
}
],
"start_datetime": "2027-07-10T08:00:00Z",
"expiry_datetime": "2027-07-12T20:30:00Z",
"creation_datetime": "2027-06-01T10:00:00Z",
"offer_status": "Active",
"status": "enabled"
}
Pause Offer
POST
/offers/{offer_id}/pause
Pauses a running offer. The offer must belong to the account that owns the API key and be in the key's mode (TEST or LIVE). Any other offer returns HTTP 401 with E1. Time spent paused is Unused Time: it is credited to your balance if you later delete the offer.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
offer_id path |
integer | Yes | Path parameter. Example: 45 |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Offer paused successfully. |
| E1 | 401 | Invalid API key, disabled account, or the offer does not belong to this account or is in the other mode. |
| E2 | 200 | Offer has already ended. |
| E3 | 200 | Offer is already paused. |
| E5 | 200 | Offer is awaiting payment. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers/{offer_id}/pause
curl -X POST "https://ads.agilis.dating/offers/45/pause" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.offers.pause(45);
console.log(result.message);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.offers.pause(45)
print(result["message"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->offers->pause(45);
echo $result['message'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Offers.PauseAsync(45);
Console.WriteLine(result.Message);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.offers().pause(45);
System.out.println(result.getMessage());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Offers.Pause(ctx, 45)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Message)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.offers.pause(45)
puts result.message
Example response
{
"return_code": "S1",
"message": "Offer has been paused."
}
Resume Offer
POST
/offers/{offer_id}/resume
Resumes a paused offer. The offer must belong to the account that owns the API key and be in the key's mode. Any other offer returns HTTP 401 with E1.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
offer_id path |
integer | Yes | Path parameter. Example: 45 |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S2 | 200 | Offer resumed successfully. |
| E1 | 401 | Invalid API key, disabled account, or the offer does not belong to this account or is in the other mode. |
| E2 | 200 | Offer has already ended. |
| E4 | 200 | Offer is already running. |
| E5 | 200 | Offer is awaiting payment. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers/{offer_id}/resume
curl -X POST "https://ads.agilis.dating/offers/45/resume" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.offers.resume(45);
console.log(result.message);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.offers.resume(45)
print(result["message"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->offers->resume(45);
echo $result['message'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Offers.ResumeAsync(45);
Console.WriteLine(result.Message);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.offers().resume(45);
System.out.println(result.getMessage());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Offers.Resume(ctx, 45)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Message)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.offers.resume(45)
puts result.message
Example response
{
"return_code": "S2",
"message": "Offer has been resumed."
}
View Offer Analytics
GET
/offers/{offer_id}/analytics
Returns view and click metrics for a specific offer over the requested time interval. The offer must belong to the account that owns the API key and be in the key's mode.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
offer_id path |
integer | Yes | Path parameter. Example: 45 |
interval query |
string | Yes | One of 24h, 7d, 30d, 60d, 90d or all. |
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Analytics returned successfully. |
| 401 | 401 | Invalid API key, disabled account, or the offer does not belong to this account or is in the other mode. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers/{offer_id}/analytics
curl -X GET "https://ads.agilis.dating/offers/45/analytics?interval=30d" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.offers.analytics(45, { interval: '30d' });
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.offers.analytics(45, {"interval": "30d"})
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->offers->analytics(45, ['interval' => '30d']);
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Offers.GetAnalyticsAsync(45, "30d");
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.offers().analytics(45, "30d");
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Offers.Analytics(ctx, 45, &agilisads.AnalyticsParams{Interval: "30d"})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.offers.analytics(45, interval: "30d")
puts result.status
Example response
{
"offer_id": 45,
"interval": "30d",
"start_datetime": "2027-07-10T08:00:00Z",
"end_datetime": "2027-08-09T08:00:00Z",
"status": "Active",
"metrics": {
"views": 4789,
"clicks": 1032
}
}
Delete Offer
DELETE
/offers/{offer_id}
Deletes an offer belonging to the authenticated account, in your API key's mode (an offer of the other mode is not found).
Awaiting Payment: the offer's Stripe payment page is closed first, so it can no longer be paid. If Stripe reports that the payment has just been completed, or the page cannot be closed, nothing is deleted (E6, E7 below).
Paid offers (Active, Scheduled or Paused): the offer's Unused Time is credited to your balance in the offer's own mode. Unused Time is the part of the scheduled period in which the offer did not run: the time from the deletion to the scheduled end, plus any time it spent paused. An offer deleted before it starts is credited in full. The credit is net of VAT and goes to your balance, never back to a card.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
dry_run query |
boolean | No | Optional. true answers with what deleting would do, including the Unused Time refund it would credit, marked dry_run: true. Nothing is deleted. |
offer_id path |
integer | Yes | Path parameter. Example: 45 |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Offer deleted successfully. |
| E1 | 401 | Invalid input, or "Offer not found": the offer does not belong to this account or is in the other mode. |
| E6 | 409 | The payment for this offer has just been completed, so it is no longer awaiting payment. Nothing has been deleted. Retrieve the offer again; if you still delete it, its Unused Time is credited to your balance. |
| E7 | 503 | The payment page could not be closed. Nothing has been deleted. Try again in a few minutes. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/offers/{offer_id}
curl -X DELETE "https://ads.agilis.dating/offers/45" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.offers.delete(45);
console.log(result.message);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.offers.delete(45)
print(result["message"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->offers->delete(45);
echo $result['message'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Offers.DeleteAsync(45);
Console.WriteLine(result.Message);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.offers().delete(45);
System.out.println(result.getMessage());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Offers.Delete(ctx, 45, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Message)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.offers.delete(45)
puts result.message
Example response
{
"return_code": "S1",
"message": "Offer has been deleted."
}
Events
The Events API lets venues, promoters and ticketing partners list real-world events in the Agilis app. A listed event appears in the app's Events tab for members near the venue, who can mark themselves as going, invite a match to come with them, and tap through to your own booking page. Agilis does not sell tickets and takes no commission.
It follows the same conventions as the Offers API: the same base URL and x-api-key header, an Idempotency-Key on creation, return_code values of S1 for success and E* for errors, an environment of TEST or LIVE that must be your API key's own mode, and cursor pagination.
Members see a business name on every event you publish. The card reads “Listed by {name}” beneath the event's details. The name is your organisation's trading name — the same name members see on your offers — unless you send advertised_name with the event, for example when an agency lists an event for a client. You must be authorised by the business you name. Invoices stay in your organisation's name.
- Price: one flat price per published event: £10, converted into your organisation's billing currency at the day's European Central Bank reference rate. Paid from your balance, which is in that currency too, as are your invoices. Non-refundable once published, including on cancellation. Rescheduling and editing are free.
- The category is chosen for you: it is determined from your title, description and venue name. There is no
category_idinput. See it before you pay withPOST /events/preview, and change your wording if it is not right. - One event, one date: a listing is a single dated occurrence. List each date of a recurring class separately;
source_event_idlets you reuse last time's image. urlis required: every event must link to your own booking page.- Images: JPG or PNG, up to 10 MB, at least 1280 × 720, shown at 16:9 with a centred cover crop unless you choose the area. Every image is re-encoded, moderated and scanned before it is stored.
- What
clicksmeans: members who opened your booking page, each counted once, from anywhere in the app. Not taps, not impressions. - Member privacy: you never see who is attending. Attendance and invitation figures are returned as bands (
<10,10-25,26-50,50+); onlyclicksis exact. - Who can manage what: an organisation admin's key manages every event in the organisation, including events created by other users' keys; an advertiser's key manages its own; a developer's key sees the organisation's events read-only (and manages the ones it created).
- Telling your bookers is your responsibility: when you reschedule, cancel or change an event, you must inform everyone who booked through your own booking system, and why. Agilis may notify its members but does not guarantee it, and is not responsible for any communication about your event. This is part of the advertiser Terms and Conditions.
- One mode per key: a
pk_test_key works only with TEST events and apk_live_key only with LIVE events. A request naming the other mode is refused with HTTP 403, and an event of the other mode is treated as not found (HTTP 404). TEST and LIVE balances are separate. See Authentication Notes. - Preview rate limit: 60 previews per organisation per hour.
Typical flow
POST /events/preview to see the category, the fee and the processed image, then POST /events with the preview_token, a TEST key and environment=TEST until your integration is right, then the same with a LIVE key and environment=LIVE. Afterwards, GET /events to list, GET /events/{event_id}/analytics to measure, PATCH to edit, and reschedule or cancel if plans change.
Event Categories
GET
/event-categories
Returns the Agilis event categories, for display: for example to label an event in your own system with the category the API chose for it. It is not an input. The category of an event is determined from its title, description and venue name (see Preview Event). Names are returned in the language of your Accept-Language header, falling back to English.
- Header
x-api-key: YOUR_API_KEY_HERE
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Categories returned successfully. |
| 401 | 401 | Missing or invalid API key, or disabled account. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/event-categories
curl -X GET "https://ads.agilis.dating/event-categories" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.eventCategories.list();
console.log(result.categories?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.event_categories.list()
print(len(result["categories"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->eventCategories->list();
echo count($result['categories']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.EventCategories.ListAsync();
Console.WriteLine(result.Categories.Count);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.eventCategories().list();
System.out.println(result.getCategories().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.EventCategories.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Categories))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.event_categories.list
puts result.categories.length
Example response
{
"categories": [
{
"category_id": 1,
"code": "live_music",
"category_name": "Live music"
},
{
"category_id": 2,
"code": "nightlife",
"category_name": "Clubs & nightlife"
},
{
"category_id": 3,
"code": "festivals",
"category_name": "Festivals"
},
{
"category_id": 4,
"code": "comedy",
"category_name": "Comedy"
},
{
"category_id": 5,
"code": "theatre_dance",
"category_name": "Theatre & dance"
},
{
"category_id": 6,
"code": "arts_exhibitions",
"category_name": "Arts & exhibitions"
},
{
"category_id": 7,
"code": "film",
"category_name": "Film"
},
{
"category_id": 8,
"code": "sports",
"category_name": "Sport"
},
{
"category_id": 9,
"code": "classes",
"category_name": "Classes & workshops"
},
{
"category_id": 10,
"code": "food_drink",
"category_name": "Food & drink"
},
{
"category_id": 11,
"code": "family",
"category_name": "Family & kids"
},
{
"category_id": 12,
"code": "other",
"category_name": "Other"
}
]
}
Event Currencies
GET
/event-currencies
The currency codes a ticket price may be quoted in: every currency with an exchange rate on file, which is what lets the app sort events by price across currencies. Use one of these for currency on publish and edit. This is the currency members see on the price pill; it has no effect on what you are charged.
- Header
x-api-key: YOUR_API_KEY_HERE
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Currencies returned successfully. |
| 401 | 401 | Missing or invalid API key, or disabled account. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/event-currencies
curl -X GET "https://ads.agilis.dating/event-currencies" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.eventCurrencies.list();
console.log(result.currencies?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.event_currencies.list()
print(len(result["currencies"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->eventCurrencies->list();
echo count($result['currencies']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.EventCurrencies.ListAsync();
Console.WriteLine(result.Currencies.Count);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.eventCurrencies().list();
System.out.println(result.getCurrencies().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.EventCurrencies.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Currencies))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.event_currencies.list
puts result.currencies.length
Example response
{
"currencies": ["AED", "AUD", "CAD", "CHF", "DKK", "EUR", "GBP", "MXN", "NOK", "NZD", "PLN", "SEK", "USD"]
}
Event Config
GET
/event-config
What publishing costs, your own balance (the API key owner's, which pays for what you publish) and the Organisation total, whether LIVE publishing is open, the accepted currencies and the image limits. Useful before a publish, or to show the fee in your own system. listing_fee is £10 converted at the day's European Central Bank reference rate into your organisation's billing currency (currency); exchange_rate_per_gbp is the rate used and exchange_rate_date its date (1 and null for GBP). All three are null when your billing currency cannot be billed right now (see E6 on Publish Event). environment is your API key's mode (TEST or LIVE), and balance and organisation_balance are the balances for that mode: TEST and LIVE balances are separate, so a TEST key never shows the LIVE balance.
- Header
x-api-key: YOUR_API_KEY_HERE
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Returned successfully. |
| 401 | 401 | Missing or invalid API key, or disabled account. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/event-config
curl -X GET "https://ads.agilis.dating/event-config" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.eventConfig.get();
console.log(result.currency);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.event_config.get()
print(result["currency"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->eventConfig->get();
echo $result['currency'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.EventConfig.GetAsync();
Console.WriteLine(result.Currency);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.eventConfig().get();
System.out.println(result.getCurrency());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.EventConfig.Get(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Currency)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.event_config.get
puts result.currency
Example response
{
"listing_fee": 10,
"currency": "GBP",
"exchange_rate_per_gbp": 1,
"exchange_rate_date": null,
"environment": "LIVE",
"balance": 42.5,
"organisation_balance": 42.5,
"live_publishing_open": true,
"currencies": ["AED", "AUD", "CAD", "CHF", "DKK", "EUR", "GBP", "MXN", "NOK", "NZD", "PLN", "SEK", "USD"],
"image": { "max_mb": 10, "min_width": 1280, "min_height": 720 },
"max_years_ahead": 5
}
// listing_fee is £10 at the day's European Central Bank rate, in your
// organisation's billing currency. Billed in US dollars at 1.3412, for example:
// "listing_fee": 13.41, "currency": "USD", "exchange_rate_per_gbp": 1.3412, "exchange_rate_date": "2027-09-29"
// All three are null when your billing currency cannot be billed right now.
Preview Event
POST
/events/preview
Shows you what POST /events would do, without publishing or charging: the category your wording will get, the fee and your balance, and — if you include an image — the processed picture with its 16:9 crop applied, plus a preview_token that POST /events accepts instead of the file, so the published image is byte-for-byte the one you saw. Same fields as POST /events; image and payment_method are optional and no Idempotency-Key is needed. A rejected image returns E2 here, before any payment. Rate-limited per organisation (60 previews per hour): each preview costs an image check and a classification.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
multipart/form-data
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
title |
string | Yes | Up to 120 characters. |
description |
string | Yes | Up to 5,000 characters. |
venue_name |
string | Yes | Example: Bar Salsa. Read, with the title and description, to determine the category. |
address |
string | Yes | Street address of the venue. |
city |
string | Yes | Example: London |
country_code |
string | Yes | ISO 3166-1 alpha-2. Example: GB (not UK). |
location[] |
array of 2 numbers | Yes | Latitude first, then longitude, of the venue. Example: 51.5133, -0.1300. Coordinates are required and an address is not a substitute. Every member sees how far the venue is from them, and that distance orders the list and drives the radius filter. address and city are shown to members but are never converted to coordinates on our side. |
starts_at |
string (ISO 8601) | Yes | ISO 8601, UTC only. Must be in the future and no more than 5 years ahead. Example: 2027-10-16T18:30:00Z |
ends_at |
string (ISO 8601) | Yes | ISO 8601, UTC only. Must be after starts_at. |
url |
string (URL) | Yes | Required. The http(s) address of your own booking page. Members tap through to it to book; Agilis does not sell tickets. An event cannot be published without one. |
advertised_name |
string | No | The business name members see as “Listed by …” instead of your trading name. Up to 100 characters; must not start with http://, https:// or www.; no HTML or line breaks. Omit or send empty to show your trading name. You must be authorised by the business you name. |
price_min, price_max |
number | No | Ticket price, shown to members. Omit both to show no price (such events sort after priced ones when members sort by price). Send 0 for both to mark the event as free. Send the same value twice for a single price. |
currency |
string, conditional | No | Currency of the ticket price, one of GET /event-currencies. Required whenever a price is supplied. It describes the ticket price only and has no effect on what you are charged. |
image |
file | No | JPG or PNG, detected from the file's content (not its name), up to 10 MB, at least 1280 × 720 pixels. Members see events at 16:9: the image is scaled to fill a 16:9 frame with its centre kept and the overflow trimmed (a centred cover crop), never stretched or letterboxed. Pass crop[x], crop[y], crop[w] to choose the area yourself. If the area would be below 1280 × 720 the image is rejected rather than enlarged. Every image is decoded and re-encoded (so only a fresh copy is stored, with EXIF data including GPS removed), content-moderated, and scanned. Use POST /events/preview to see the result before paying. |
crop[x], crop[y], crop[w] |
integer | No | With image: the top-left corner and width, in pixels of the uploaded image, of the 16:9 area to use. The height is derived. Minimum width 1280. Omit for the centred cover crop. |
environment |
string | Yes | TEST or LIVE. Must be your API key's own mode (HTTP 403 otherwise). Decides whether balance_after subtracts the fee; balance is the balance for that mode. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Preview returned. category is what publishing this wording will get; image.preview_token is single-use, bound to your organisation and valid for 24 hours (expires_at); image.preview_url is a short-lived signed link to the processed picture. listing_fee is in your billing currency (currency). If your billing currency cannot be billed right now, the preview still returns S1, with listing_fee null and balance_sufficient false, and publishing would return E6. |
| E1 | 400 | Missing or invalid input, including an image that is too large, too small or not a JPEG/PNG. The message says which. |
| E2 | 200 | The image failed content moderation. |
| E8 | 429 | Too many previews this hour. Wait and retry. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
One name=value per line. Repeat a name for a list, such as location[].
Response
/events/preview
curl -X POST "https://ads.agilis.dating/events/preview" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-F "title=Beginners Cuban Salsa: Friday Social" \
-F "description=Drop-in class for absolute beginners, followed by a social until late. No partner needed." \
-F "venue_name=Bar Salsa" \
-F "address=96 Charing Cross Road" \
-F "city=London" \
-F "country_code=GB" \
-F "location[]=51.5133" \
-F "location[]=-0.1300" \
-F "starts_at=2027-10-16T18:30:00Z" \
-F "ends_at=2027-10-16T23:00:00Z" \
-F "url=https://www.barsalsa.co.uk/classes/friday" \
-F "price_min=12" \
-F "price_max=12" \
-F "currency=GBP" \
-F "environment=TEST" \
-F "image=@/path/to/salsa.jpg"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.preview({
title: 'Beginners Cuban Salsa: Friday Social',
description: 'Drop-in class for absolute beginners, followed by a social until late. No partner needed.',
venue_name: 'Bar Salsa',
address: '96 Charing Cross Road',
city: 'London',
country_code: 'GB',
location: [51.5133, -0.1300],
starts_at: '2027-10-16T18:30:00Z',
ends_at: '2027-10-16T23:00:00Z',
url: 'https://www.barsalsa.co.uk/classes/friday',
price_min: 12,
price_max: 12,
currency: 'GBP',
image: '/path/to/salsa.jpg',
});
console.log(result.balance_after);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.preview({
"title": "Beginners Cuban Salsa: Friday Social",
"description": "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
"venue_name": "Bar Salsa",
"address": "96 Charing Cross Road",
"city": "London",
"country_code": "GB",
"location": [51.5133, -0.1300],
"starts_at": "2027-10-16T18:30:00Z",
"ends_at": "2027-10-16T23:00:00Z",
"url": "https://www.barsalsa.co.uk/classes/friday",
"price_min": 12,
"price_max": 12,
"currency": "GBP",
"image": "/path/to/salsa.jpg",
})
print(result["balance_after"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->preview([
'title' => 'Beginners Cuban Salsa: Friday Social',
'description' => 'Drop-in class for absolute beginners, followed by a social until late. No partner needed.',
'venue_name' => 'Bar Salsa',
'address' => '96 Charing Cross Road',
'city' => 'London',
'country_code' => 'GB',
'location' => [51.5133, -0.1300],
'starts_at' => '2027-10-16T18:30:00Z',
'ends_at' => '2027-10-16T23:00:00Z',
'url' => 'https://www.barsalsa.co.uk/classes/friday',
'price_min' => 12,
'price_max' => 12,
'currency' => 'GBP',
'image' => '/path/to/salsa.jpg',
]);
echo $result['balance_after'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.PreviewAsync(new EventPreviewParams
{
Title = "Beginners Cuban Salsa: Friday Social",
Description = "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
VenueName = "Bar Salsa",
Address = "96 Charing Cross Road",
City = "London",
CountryCode = "GB",
Location = new GeoLocation(51.5133, -0.1300),
StartsAt = DateTimeOffset.Parse("2027-10-16T18:30:00Z"),
EndsAt = DateTimeOffset.Parse("2027-10-16T23:00:00Z"),
Url = "https://www.barsalsa.co.uk/classes/friday",
PriceMin = 12m,
PriceMax = 12m,
Currency = "GBP",
Image = FileUpload.FromPath("/path/to/salsa.jpg"),
});
Console.WriteLine(result.BalanceAfter);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.PreviewEventParams;
import java.nio.file.Path;
import java.util.List;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().preview(
PreviewEventParams.builder()
.title("Beginners Cuban Salsa: Friday Social")
.description("Drop-in class for absolute beginners, followed by a social until late. No partner needed.")
.venueName("Bar Salsa")
.put("address", "96 Charing Cross Road")
.put("city", "London")
.put("country_code", "GB")
.put("location", List.of(51.5133, -0.1300))
.put("starts_at", "2027-10-16T18:30:00Z")
.put("ends_at", "2027-10-16T23:00:00Z")
.put("url", "https://www.barsalsa.co.uk/classes/friday")
.put("price_min", 12)
.put("price_max", 12)
.put("currency", "GBP")
.image(Path.of("/path/to/salsa.jpg"))
.build());
System.out.println(result.getBalanceAfter());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Preview(ctx, &agilisads.PreviewEventParams{
Title: "Beginners Cuban Salsa: Friday Social",
Description: "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
VenueName: "Bar Salsa",
Address: "96 Charing Cross Road",
City: "London",
CountryCode: "GB",
Location: &agilisads.LatLng{Latitude: 51.5133, Longitude: -0.1300},
StartsAt: "2027-10-16T18:30:00Z",
EndsAt: "2027-10-16T23:00:00Z",
URL: "https://www.barsalsa.co.uk/classes/friday",
PriceMin: agilisads.Float64(12),
PriceMax: agilisads.Float64(12),
Currency: "GBP",
Image: agilisads.FileFromPath("/path/to/salsa.jpg"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.BalanceAfter)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.preview(
title: "Beginners Cuban Salsa: Friday Social",
description: "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
venue_name: "Bar Salsa",
address: "96 Charing Cross Road",
city: "London",
country_code: "GB",
location: [51.5133, -0.1300],
starts_at: "2027-10-16T18:30:00Z",
ends_at: "2027-10-16T23:00:00Z",
url: "https://www.barsalsa.co.uk/classes/friday",
price_min: 12,
price_max: 12,
currency: "GBP",
image: "/path/to/salsa.jpg"
)
puts result.balance_after
Example response
{
"return_code": "S1",
"category": { "category_id": 9, "category_name": "Classes & workshops" },
"listing_fee": 10,
"currency": "GBP",
"balance": 42.5,
"balance_after": 42.5,
"balance_sufficient": true,
"live_publishing_open": true,
"price_gbp": 12,
"image": {
"preview_url": "https://cdn.agilis.dating/event-previews/92/…/event_large.jpg?Expires=…&Signature=…",
"width": 1920,
"height": 1080,
"master_width": 2400,
"master_height": 1800,
"crop": { "x": 0, "y": 225, "w": 2400, "h": 1350 },
"preview_token": "evp_8f3c1a9d2b4e7f0c1a3b5d7e9f2c4a6b8d0e1f3a5c7e",
"expires_at": "2027-09-23T10:30:00Z"
}
}
// balance_after subtracts the fee only for environment=LIVE.
// The image failed moderation (HTTP 200) - nothing to pay for:
// { "return_code": "E2", "message": "The uploaded image cannot be accepted." }
// Too many previews this hour (HTTP 429):
// { "return_code": "E8", "message": "Too many previews: your organisation may make 60 previews per hour. Try again later." }
Publish Event
POST
/events
Publishes one dated event. Sent as multipart/form-data. Publishing costs one flat price, deducted from your balance: £10, converted into your organisation's billing currency at the day's European Central Bank reference rate. The charge and the event are created together: if your balance is too low, nothing is created and nothing is charged. Listings are non-refundable once published, including if you later cancel. A recurring class is one event per date. There is no category_id: the category is determined from your title, description and venue name and returned in the response — preview it first if you want to see it before paying.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
multipart/form-data
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
Idempotency-Key header |
string | Yes | A unique value per event, for example a UUID. Retrying with the same key and the same fields returns the original response and never charges twice. |
dry_run query |
boolean | No | Optional. true checks the fields, LIVE availability, the Terms, the fee and your balance, and answers with listing_fee, amount_to_charge and balance_after, marked dry_run: true. Nothing is created or charged, and no Idempotency-Key is needed. POST /events/preview shows the category and the image. |
title |
string | Yes | Up to 120 characters. |
description |
string | Yes | Up to 5,000 characters. |
venue_name |
string | Yes | Example: Bar Salsa. Read, with the title and description, to determine the category. |
address |
string | Yes | Street address of the venue. |
city |
string | Yes | Example: London |
country_code |
string | Yes | ISO 3166-1 alpha-2. Example: GB (not UK). |
location[] |
array of 2 numbers | Yes | Latitude first, then longitude, of the venue. Example: 51.5133, -0.1300. Coordinates are required and an address is not a substitute. Every member sees how far the venue is from them, and that distance orders the list and drives the radius filter. address and city are shown to members but are never converted to coordinates on our side. |
starts_at |
string (ISO 8601) | Yes | ISO 8601, UTC only. Must be in the future and no more than 5 years ahead. Example: 2027-10-16T18:30:00Z |
ends_at |
string (ISO 8601) | Yes | ISO 8601, UTC only. Must be after starts_at. |
url |
string (URL) | Yes | Required. The http(s) address of your own booking page. Members tap through to it to book; Agilis does not sell tickets. An event cannot be published without one. |
advertised_name |
string | No | The business name members see as “Listed by …” instead of your trading name. Up to 100 characters; must not start with http://, https:// or www.; no HTML or line breaks. Omit or send empty to show your trading name. You must be authorised by the business you name. |
price_min, price_max |
number | No | Ticket price, shown to members. Omit both to show no price (such events sort after priced ones when members sort by price). Send 0 for both to mark the event as free. Send the same value twice for a single price. |
currency |
string, conditional | No | Currency of the ticket price, one of GET /event-currencies. Required whenever a price is supplied. It describes the ticket price only and has no effect on what you are charged. |
image |
file, one of three | No | JPG or PNG, detected from the file's content (not its name), up to 10 MB, at least 1280 × 720 pixels. Members see events at 16:9: the image is scaled to fill a 16:9 frame with its centre kept and the overflow trimmed (a centred cover crop), never stretched or letterboxed. Pass crop[x], crop[y], crop[w] to choose the area yourself. If the area would be below 1280 × 720 the image is rejected rather than enlarged. Every image is decoded and re-encoded (so only a fresh copy is stored, with EXIF data including GPS removed), content-moderated, and scanned. Use POST /events/preview to see the result before paying. |
preview_token |
string, one of three | No | From POST /events/preview. Publishes exactly the image you previewed, with the crop you saw. Single-use. |
source_event_id |
integer, one of three | No | Reuse the image of one of your organisation's existing events, for example last week's class. The image is copied to the new event (not shared). Send crop[] on a later PATCH to re-frame it. |
crop[x], crop[y], crop[w] |
integer | No | With image only: the 16:9 area to use. See Preview Event. |
payment_method |
string | Yes | B — pay from your balance. Payment by Stripe link is not available for events. |
environment |
string | Yes | TEST or LIVE. Must be your API key's own mode: a pk_live_ key publishes LIVE events only, a pk_test_ key TEST events only (HTTP 403 otherwise). A TEST event is validated, classified and moderated in full, including the balance check against your TEST balance, but is never charged, never invoiced and never shown to members. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Event published. amount_charged and currency show what was taken from your balance, in your billing currency (0 for TEST); category is the category determined for it. A LIVE event appears in the app within a few minutes. |
| E1 | 400 | Missing or invalid input: no url; no image source, or more than one; a starts_at in the past, ends_at before starts_at, or more than 5 years ahead; bad country_code; a price without a currency, or a currency not in GET /event-currencies; an image that is too large, too small, not a JPEG/PNG, or whose crop area is below 1280 × 720; an invalid, used or expired preview_token; a source_event_id that is not yours; an advertised_name over 100 characters, starting with http://, https:// or www., or containing HTML or a line break. The message says which. |
| E2 | 200 | The image failed content moderation. Nothing was charged. Retry with the same Idempotency-Key and a different image. |
| E3 | 200 | Insufficient balance. Nothing was created. Top up in the Ad Portal and retry with the same Idempotency-Key. |
| E17 | 200 | LIVE only: this would go over one of your organisation's spending limits (for one listing, a day or a month, the organisation's or the API key owner's own). Nothing was created or charged. limit gives applies_to (organisation or person), period (listing, day or month), amount, spent, price, currency, resets_at (UTC, null for one listing) and time_zone. An Org Admin sets limits in the Ad Portal under Settings. A dry run returns the same. |
| E6 | 400 | Your organisation's billing currency cannot be billed right now. Nothing was created or charged. The message is either Your organisation's currency (XYZ) is not one Agilis bills in. An Org Admin can choose a supported billing currency in the Ad Portal. You have not been charged. The event has not been created. or Prices in XYZ are temporarily unavailable because the exchange rate is out of date. Please try again later. You have not been charged. The event has not been created., with your currency code in place of XYZ. |
| E7 | 403 | LIVE publishing is temporarily unavailable. Nothing was created or charged. Retry later with the same Idempotency-Key. |
| E9 | 403 | Your organisation has not accepted the current Agilis Advertising Terms and Conditions. Nothing was created or charged. An Org Admin must accept them in the Ad Portal (adportal.agilis.dating); then retry with the same Idempotency-Key. Editing, rescheduling, cancelling and deleting existing events are not affected. |
| E1 | 403 | environment is not your API key's mode. Nothing was created or charged. |
| 409 | 409 | A request with this Idempotency-Key is still being processed. |
| 422 | 422 | This Idempotency-Key was already used with different fields. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Send the same value to retry safely. Choose New before creating another one.
One name=value per line. Repeat a name for a list, such as location[].
Response
/events
curl -X POST "https://ads.agilis.dating/events" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Idempotency-Key: 7c2e1a0b-4d3f-4b8a-9e1c-5f6a7b8c9d0e" \
-F "title=Beginners Cuban Salsa: Friday Social" \
-F "description=Drop-in class for absolute beginners, followed by a social until late. No partner needed." \
-F "venue_name=Bar Salsa" \
-F "address=96 Charing Cross Road" \
-F "city=London" \
-F "country_code=GB" \
-F "location[]=51.5133" \
-F "location[]=-0.1300" \
-F "starts_at=2027-10-16T18:30:00Z" \
-F "ends_at=2027-10-16T23:00:00Z" \
-F "url=https://www.barsalsa.co.uk/classes/friday" \
-F "price_min=12" \
-F "price_max=12" \
-F "currency=GBP" \
-F "environment=TEST" \
-F "payment_method=B" \
-F "preview_token=evp_8f3c1a…"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
const result = await client.events.publish({
title: 'Beginners Cuban Salsa: Friday Social',
description: 'Drop-in class for absolute beginners, followed by a social until late. No partner needed.',
venue_name: 'Bar Salsa',
address: '96 Charing Cross Road',
city: 'London',
country_code: 'GB',
location: [51.5133, -0.1300],
starts_at: '2027-10-16T18:30:00Z',
ends_at: '2027-10-16T23:00:00Z',
url: 'https://www.barsalsa.co.uk/classes/friday',
price_min: 12,
price_max: 12,
currency: 'GBP',
payment_method: 'B',
preview_token: 'evp_8f3c1a…',
});
console.log(result.event_id);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
# An Idempotency-Key is sent for you, and reused if the request is retried.
result = client.events.publish({
"title": "Beginners Cuban Salsa: Friday Social",
"description": "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
"venue_name": "Bar Salsa",
"address": "96 Charing Cross Road",
"city": "London",
"country_code": "GB",
"location": [51.5133, -0.1300],
"starts_at": "2027-10-16T18:30:00Z",
"ends_at": "2027-10-16T23:00:00Z",
"url": "https://www.barsalsa.co.uk/classes/friday",
"price_min": 12,
"price_max": 12,
"currency": "GBP",
"payment_method": "B",
"preview_token": "evp_8f3c1a…",
})
print(result["event_id"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
$result = $agilis->events->publish([
'title' => 'Beginners Cuban Salsa: Friday Social',
'description' => 'Drop-in class for absolute beginners, followed by a social until late. No partner needed.',
'venue_name' => 'Bar Salsa',
'address' => '96 Charing Cross Road',
'city' => 'London',
'country_code' => 'GB',
'location' => [51.5133, -0.1300],
'starts_at' => '2027-10-16T18:30:00Z',
'ends_at' => '2027-10-16T23:00:00Z',
'url' => 'https://www.barsalsa.co.uk/classes/friday',
'price_min' => 12,
'price_max' => 12,
'currency' => 'GBP',
'payment_method' => 'B',
'preview_token' => 'evp_8f3c1a…',
]);
echo $result['event_id'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
var result = await client.Events.PublishAsync(new EventPublishParams
{
Title = "Beginners Cuban Salsa: Friday Social",
Description = "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
VenueName = "Bar Salsa",
Address = "96 Charing Cross Road",
City = "London",
CountryCode = "GB",
Location = new GeoLocation(51.5133, -0.1300),
StartsAt = DateTimeOffset.Parse("2027-10-16T18:30:00Z"),
EndsAt = DateTimeOffset.Parse("2027-10-16T23:00:00Z"),
Url = "https://www.barsalsa.co.uk/classes/friday",
PriceMin = 12m,
PriceMax = 12m,
Currency = "GBP",
PaymentMethod = "B",
PreviewToken = "evp_8f3c1a…",
});
Console.WriteLine(result.EventId);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.PublishEventParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
// An Idempotency-Key is sent for you, and reused if the request is retried.
var result = client.events().publish(
PublishEventParams.builder()
.title("Beginners Cuban Salsa: Friday Social")
.description("Drop-in class for absolute beginners, followed by a social until late. No partner needed.")
.venueName("Bar Salsa")
.address("96 Charing Cross Road")
.city("London")
.countryCode("GB")
.location(51.5133, -0.1300)
.startsAt("2027-10-16T18:30:00Z")
.endsAt("2027-10-16T23:00:00Z")
.url("https://www.barsalsa.co.uk/classes/friday")
.priceMin(12)
.priceMax(12)
.currency("GBP")
.paymentMethod("B")
.previewToken("evp_8f3c1a…")
.build());
System.out.println(result.getEventId());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
// An Idempotency-Key is sent for you, and reused if the request is retried.
result, err := client.Events.Publish(ctx, &agilisads.PublishEventParams{
Title: "Beginners Cuban Salsa: Friday Social",
Description: "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
VenueName: "Bar Salsa",
Address: "96 Charing Cross Road",
City: "London",
CountryCode: "GB",
Location: agilisads.LatLng{Latitude: 51.5133, Longitude: -0.1300},
StartsAt: "2027-10-16T18:30:00Z",
EndsAt: "2027-10-16T23:00:00Z",
URL: "https://www.barsalsa.co.uk/classes/friday",
PriceMin: agilisads.Float64(12),
PriceMax: agilisads.Float64(12),
Currency: "GBP",
PaymentMethod: "B",
PreviewToken: "evp_8f3c1a…",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.EventID)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
# An Idempotency-Key is sent for you, and reused if the request is retried.
result = client.events.publish(
title: "Beginners Cuban Salsa: Friday Social",
description: "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
venue_name: "Bar Salsa",
address: "96 Charing Cross Road",
city: "London",
country_code: "GB",
location: [51.5133, -0.1300],
starts_at: "2027-10-16T18:30:00Z",
ends_at: "2027-10-16T23:00:00Z",
url: "https://www.barsalsa.co.uk/classes/friday",
price_min: 12,
price_max: 12,
currency: "GBP",
payment_method: "B",
preview_token: "evp_8f3c1a…"
)
puts result.event_id
Example response
{
"return_code": "S1",
"event_id": 3104,
"status": "Scheduled",
"payment_url": null,
"amount_charged": 0,
"currency": "GBP",
"category": {
"category_id": 9,
"category_name": "Classes & workshops"
}
}
// environment=LIVE returns what was taken from your balance, in your
// organisation's currency - for example "amount_charged": 10, "currency": "GBP".
//
// Insufficient balance (HTTP 200). Nothing is created:
// { "return_code": "E3", "message": "Your balance is insufficient. Please top up and try again." }
//
// LIVE while publishing is closed (HTTP 403):
// { "return_code": "E7", "message": "LIVE event publishing is not yet available. Use environment=TEST to build and test your integration. Nothing has been created and you have not been charged." }
View Events
GET
/events
Returns events, newest first, with cursor pagination in the same envelope as GET /offers. Who sees what: an organisation admin's key sees every event in the organisation, whoever created it; a developer's key sees the whole organisation's events read-only; an advertiser's key sees its own. attendees is always a band (<10, 10-25, 26-50, 50+), never an exact number: member privacy comes first, and an exact count on a small event would let attendance be inferred.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
environment query |
string | Yes | test or live. Case-insensitive. Must be your API key's own mode. |
limit query |
integer | No | Between 1 and 100. Default 20. |
cursor query |
string | No | The next_cursor from the previous page. |
event_status query |
string | No | One of upcoming, scheduled, rescheduled, cancelled or ended. |
owner_user_id query |
integer | No | Organisation admins: only the events created by this user. |
created_after, created_before query |
string (ISO 8601) | No | ISO 8601, UTC only. |
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Events returned successfully. |
| 400 | 400 | Missing or invalid environment, limit, cursor or filter. |
| 401 | 401 | Missing or invalid API key, or disabled account. |
| 403 | 403 | environment is not your API key's mode. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/events
curl -X GET "https://ads.agilis.dating/events?environment=live&limit=20" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.list({
limit: 20,
});
console.log(result.data?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.list({
"limit": 20,
})
print(len(result["data"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->list([
'limit' => 20,
]);
echo count($result['data']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.ListAsync(new EventListParams
{
Limit = 20,
});
Console.WriteLine(result.Data.Count);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.ListEventsParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().list(
ListEventsParams.builder()
.limit(20)
.build());
System.out.println(result.getData().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.List(ctx, &agilisads.ListEventsParams{
Limit: 20,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Data))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.list(
limit: 20
)
puts result.data.length
Example response
{
"data": [
{
"event_id": 3104,
"title": "Beginners Cuban Salsa: Friday Social",
"description": "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
"category": {
"category_id": 9,
"category_name": "Classes & workshops"
},
"venue_name": "Bar Salsa",
"address": "96 Charing Cross Road",
"city": "London",
"country_code": "GB",
"latitude": 51.5133,
"longitude": -0.13,
"starts_at": "2027-10-16T18:30:00Z",
"ends_at": "2027-10-16T23:00:00Z",
"url": "https://www.barsalsa.co.uk/classes/friday",
"advertised_name": null,
"price_min": 12,
"price_max": 12,
"currency": "GBP",
"image": "https://cdn.agilis.dating/92/events/5f0c…/event_orig.jpg",
"image_large": "https://cdn.agilis.dating/92/events/5f0c…/event_large.jpg",
"image_thumb": "https://cdn.agilis.dating/92/events/5f0c…/event_thumb.jpg",
"event_status": "Scheduled",
"attendees": "10-25",
"owner": {
"user_id": 41,
"name": "Tom Reid"
},
"environment": "LIVE",
"reschedule_count": 0,
"cloned_from_event_id": null,
"creation_datetime": "2027-09-20T10:00:00Z",
"last_edited_at": null
}
],
"pagination": {
"limit": 20,
"count": 1,
"has_more": false,
"next_cursor": null
}
}
View Event
GET
/events/{event_id}
One event: the same fields as the list, plus what it cost (listing_price, billing_currency, invoice_id), whether you may change it (can_manage, can_delete), whether members have interacted with it, the stored image's size and crop (image_master), and its history: every action taken on it, by whom and when.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
event_id path |
integer | Yes | Path parameter. Example: 3104 |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Event returned. |
| E1 | 404 | The event was not found on this account (HTTP 404). |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/events/{event_id}
curl -X GET "https://ads.agilis.dating/events/3104" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.get(3104);
console.log(result.event_status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.get(3104)
print(result["event_status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->get(3104);
echo $result['event_status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.GetAsync(3104);
Console.WriteLine(result.EventStatus);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().get(3104);
System.out.println(result.getEventStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Get(ctx, 3104)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.EventStatus)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.get(3104)
puts result.event_status
Example response
{
"event_id": 3104,
"title": "Beginners Cuban Salsa: Friday Social",
"description": "Drop-in class for absolute beginners, followed by a social until late. No partner needed.",
"category": {
"category_id": 9,
"category_name": "Classes & workshops"
},
"venue_name": "Bar Salsa",
"address": "96 Charing Cross Road",
"city": "London",
"country_code": "GB",
"latitude": 51.5133,
"longitude": -0.13,
"starts_at": "2027-10-16T18:30:00Z",
"ends_at": "2027-10-16T23:00:00Z",
"url": "https://www.barsalsa.co.uk/classes/friday",
"advertised_name": null,
"price_min": 12,
"price_max": 12,
"currency": "GBP",
"image": "https://cdn.agilis.dating/92/events/5f0c…/event_orig.jpg",
"image_large": "https://cdn.agilis.dating/92/events/5f0c…/event_large.jpg",
"image_thumb": "https://cdn.agilis.dating/92/events/5f0c…/event_thumb.jpg",
"event_status": "Scheduled",
"attendees": "10-25",
"owner": {
"user_id": 41,
"name": "Tom Reid"
},
"environment": "LIVE",
"reschedule_count": 0,
"cloned_from_event_id": null,
"creation_datetime": "2027-09-20T10:00:00Z",
"last_edited_at": null,
"can_manage": true,
"can_delete": false,
"listing_price": 10,
"billing_currency": "GBP",
"invoice_id": "INV-2026-1047",
"app_synced_at": "2027-09-20T10:02:00Z",
"has_member_interaction": true,
"image_master": {
"width": 2400,
"height": 1800,
"crop": {
"x": 0,
"y": 225,
"w": 2400,
"h": 1350
},
"url": null
},
"history": [
{
"action": "published",
"channel": "api",
"acted_by_user_id": 41,
"acted_by": "Tom Reid",
"details": {
"environment": 1,
"category_id": 9,
"image_source": "preview"
},
"acknowledged": false,
"at": "2027-09-20T10:00:00Z"
}
]
}
Edit Event
PATCH
/events/{event_id}
Changes a published event, free of charge. Send only the fields to change. Editable: title, description, booking page, ticket price, venue and image. Not dates — use Reschedule. A wording change re-determines the category, which the response returns; preview first if you want to see it. A new image goes through the same checks as on publish and is stored at new URLs (invitations already sent keep the picture they were sent with). Members see the change within a few minutes. When uploading a file, send the request as POST with the header X-HTTP-Method-Override: PATCH, because file uploads need a POST body. You remain responsible for telling everyone who booked through your own booking system about any change; Agilis may notify its members but does not guarantee it.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
multipart/form-data
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
event_id path |
integer | Yes | Path parameter. Example: 3104 |
title, description, url, advertised_name, venue_name, address, city, country_code, location[] |
optional | No | Same rules as on publish. Changing the venue tells members who are going that the venue changed. Send advertised_name empty to go back to your trading name. Changing only the name does not change the category and notifies nobody. |
price_min, price_max, currency |
optional, together | No | A price change must send all three (all blank to show no price). |
image |
file | No | A replacement picture. Same rules as on publish; moderated. |
preview_token / source_event_id |
optional | No | Alternatives to image, as on publish. |
crop[x], crop[y], crop[w] |
integer | No | On its own: re-frame the existing image from the stored original, with no re-upload. With image: the area of the new picture. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Event updated. changed_fields lists what changed; category is the category after the change; venue_changed says whether members will be told of a venue change. |
| E1 | 400 | Invalid input; dates sent (use Reschedule); or nothing to change. |
| E1 | 404 | The event was not found on this account (HTTP 404). |
| E2 | 200 | A new image failed content moderation (nothing changed), or the event has ended or been cancelled and cannot be edited. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
One name=value per line. Repeat a name for a list, such as location[].
Response
/events/{event_id}
curl -X POST "https://ads.agilis.dating/events/3104" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "X-HTTP-Method-Override: PATCH" \
-F "title=Thursday Comedy Club" \
-F "url=https://www.barsalsa.co.uk/comedy" \
-F "image=@/path/to/salsa.jpg"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.edit(3104, {
title: 'Thursday Comedy Club',
url: 'https://www.barsalsa.co.uk/comedy',
image: '/path/to/salsa.jpg',
});
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.edit(3104, {
"title": "Thursday Comedy Club",
"url": "https://www.barsalsa.co.uk/comedy",
"image": "/path/to/salsa.jpg",
})
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->edit(3104, [
'title' => 'Thursday Comedy Club',
'url' => 'https://www.barsalsa.co.uk/comedy',
'image' => '/path/to/salsa.jpg',
]);
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.EditAsync(3104, new EventEditParams
{
Title = "Thursday Comedy Club",
Url = "https://www.barsalsa.co.uk/comedy",
Image = FileUpload.FromPath("/path/to/salsa.jpg"),
});
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.EditEventParams;
import java.nio.file.Path;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().edit(
3104,
EditEventParams.builder()
.title("Thursday Comedy Club")
.url("https://www.barsalsa.co.uk/comedy")
.image(Path.of("/path/to/salsa.jpg"))
.build());
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Edit(ctx, 3104, &agilisads.EditEventParams{
Title: agilisads.String("Thursday Comedy Club"),
URL: agilisads.String("https://www.barsalsa.co.uk/comedy"),
Image: agilisads.FileFromPath("/path/to/salsa.jpg"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.edit(
3104,
title: "Thursday Comedy Club",
url: "https://www.barsalsa.co.uk/comedy",
image: "/path/to/salsa.jpg"
)
puts result.status
Example response
{
"return_code": "S1",
"message": "Event has been updated.",
"event_id": 3104,
"status": "Scheduled",
"category": {
"category_id": 4,
"category_name": "Comedy"
},
"changed_fields": ["title", "url"],
"image": "https://cdn.agilis.dating/92/events/a91e…/event_orig.jpg",
"image_large": "https://cdn.agilis.dating/92/events/a91e…/event_large.jpg",
"venue_changed": false
}
Reschedule Event
POST
/events/{event_id}/reschedule
Moves a published event to a new date, at no charge. Within a few minutes the app shows the new date, and anyone who had accepted an invitation to the event is asked to confirm again, because nobody has agreed to the new date yet. You are responsible for informing everyone who booked through your own booking system of the change and the reason for it; Agilis may notify its members but does not guarantee it, and is not responsible for communication about your event. Use this rather than cancelling and publishing again.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
event_id path |
integer | Yes | Path parameter. Example: 3104 |
starts_at |
string (ISO 8601) | Yes | ISO 8601, UTC only. In the future, no more than 5 years ahead. |
ends_at |
string (ISO 8601) | Yes | ISO 8601, UTC only. After starts_at. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Event rescheduled. |
| E1 | 400 | Invalid or unchanged dates. |
| E1 | 404 | The event was not found on this account (HTTP 404). |
| E2 | 200 | The event has already ended or been cancelled and cannot be amended. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/events/{event_id}/reschedule
curl -X POST "https://ads.agilis.dating/events/3104/reschedule" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"starts_at": "2027-10-23T18:30:00Z",
"ends_at": "2027-10-23T23:00:00Z"
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.reschedule(3104, {
starts_at: '2027-10-23T18:30:00Z',
ends_at: '2027-10-23T23:00:00Z',
});
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.reschedule(3104, {
"starts_at": "2027-10-23T18:30:00Z",
"ends_at": "2027-10-23T23:00:00Z",
})
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->reschedule(3104, [
'starts_at' => '2027-10-23T18:30:00Z',
'ends_at' => '2027-10-23T23:00:00Z',
]);
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.RescheduleAsync(3104, new EventRescheduleParams
{
StartsAt = DateTimeOffset.Parse("2027-10-23T18:30:00Z"),
EndsAt = DateTimeOffset.Parse("2027-10-23T23:00:00Z"),
});
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.RescheduleEventParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().reschedule(
3104,
RescheduleEventParams.builder()
.startsAt("2027-10-23T18:30:00Z")
.endsAt("2027-10-23T23:00:00Z")
.build());
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Reschedule(ctx, 3104, &agilisads.RescheduleEventParams{
StartsAt: "2027-10-23T18:30:00Z",
EndsAt: "2027-10-23T23:00:00Z",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.reschedule(
3104,
starts_at: "2027-10-23T18:30:00Z",
ends_at: "2027-10-23T23:00:00Z"
)
puts result.status
Example response
{
"return_code": "S1",
"message": "Event has been rescheduled.",
"event_id": 3104,
"status": "Rescheduled",
"starts_at": "2027-10-23T18:30:00Z",
"ends_at": "2027-10-23T23:00:00Z"
}
Cancel Event
POST
/events/{event_id}/cancel
Cancels a published event. Irreversible, and the listing fee is not refunded. Within a few minutes the app marks it cancelled and every open or accepted invitation to it is cancelled. You are responsible for informing everyone who booked through your own booking system; Agilis may notify its members but does not guarantee it. Please cancel rather than leaving a listing up for an event that is not running, so nobody turns up to a closed door. No request body.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
dry_run query |
boolean | No | Optional. true checks that the event can be cancelled and answers dry_run: true. Nothing changes. |
event_id path |
integer | Yes | Path parameter. Example: 3104 |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Event cancelled. The listing fee is not refunded. |
| E1 | 404 | The event was not found on this account (HTTP 404). |
| E2 | 200 | The event has already ended or been cancelled. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/events/{event_id}/cancel
curl -X POST "https://ads.agilis.dating/events/3104/cancel" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.cancel(3104);
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.cancel(3104)
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->cancel(3104);
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.CancelAsync(3104);
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().cancel(3104);
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Cancel(ctx, 3104, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.cancel(3104)
puts result.status
Example response
{
"return_code": "S1",
"message": "Event has been cancelled. Listing fees are non-refundable.",
"event_id": 3104,
"status": "Cancelled"
}
Delete Event
DELETE
/events/{event_id}
Removes an event that no member has interacted with yet, for example one published by mistake. Once any member has marked themselves as going, invited someone, or opened your booking page, the event can no longer be deleted: cancel it instead, so those members are told. Deleting does not return the listing fee.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
dry_run query |
boolean | No | Optional. true checks that the event can be deleted and answers dry_run: true (or E5 if members have interacted). Nothing changes. |
event_id path |
integer | Yes | Path parameter. Example: 3104 |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Event deleted. |
| E1 | 404 | The event was not found on this account (HTTP 404). |
| E5 | 200 | Members have already interacted with this event. Use POST /events/{event_id}/cancel. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/events/{event_id}
curl -X DELETE "https://ads.agilis.dating/events/3104" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.delete(3104);
console.log(result.message);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.delete(3104)
print(result["message"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->delete(3104);
echo $result['message'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.DeleteAsync(3104);
Console.WriteLine(result.Message);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().delete(3104);
System.out.println(result.getMessage());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Delete(ctx, 3104, nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Message)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.delete(3104)
puts result.message
Example response
{
"return_code": "S1",
"message": "Event has been deleted."
}
View Event Analytics
GET
/events/{event_id}/analytics
Returns engagement for one event over the requested interval. Figures are refreshed every few minutes; as_of says when, and is null until the first member interaction.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
event_id path |
integer | Yes | Path parameter. Example: 3104 |
interval query |
string | Yes | One of 24h, 7d, 30d, 60d, 90d or all. |
Metrics
clicks- Exact. The number of members who opened your booking page from anywhere in the app — the events list, the event's own screen, an invitation in chat, or their Planned list — each counted once, however many times they tapped. Not taps, not impressions: a member seeing your event in a list is not a click, and links copied and shared outside the app are not counted.
attendees- Members who are going: they tapped Going, or they are one of the two people in an accepted invitation. A band, never an exact number.
invites_sent- Invitations members sent for this event, not the number of members who sent them — one member may invite several of their matches to the same event, and each invitation counts. A band. This is the figure no other channel gives you: it shows the event was worth suggesting as a date.
invites_accepted- How many of those invitations were accepted. A band.
Response codes
| Code | HTTP | Meaning |
|---|---|---|
| 200 | 200 | Analytics returned successfully. |
| 400 | 400 | Missing or invalid interval. |
| 401 | 401 | Missing or invalid API key, or disabled account. |
| 404 | 404 | The event was not found on this account. |
| 500 | 500 | Internal server error. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/events/{event_id}/analytics
curl -X GET "https://ads.agilis.dating/events/3104/analytics?interval=30d" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.events.analytics(3104, { interval: '30d' });
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.events.analytics(3104, {"interval": "30d"})
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->events->analytics(3104, ['interval' => '30d']);
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.Events.GetAnalyticsAsync(3104, "30d");
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.events().analytics(3104, "30d");
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Events.Analytics(ctx, 3104, &agilisads.AnalyticsParams{Interval: "30d"})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.events.analytics(3104, interval: "30d")
puts result.status
Example response
{
"event_id": 3104,
"interval": "30d",
"starts_at": "2027-10-16T18:30:00Z",
"ends_at": "2027-10-16T23:00:00Z",
"status": "Scheduled",
"metrics": {
"clicks": 188,
"attendees": "26-50",
"invites_sent": "26-50",
"invites_accepted": "10-25"
},
"as_of": "2027-09-20T14:05:00Z"
}
// clicks: distinct members who opened your booking page, each counted once.
// The other three are bands, never numbers.
Webhooks
Webhooks tell your server when something changes, instead of it asking. When an Offer starts or ends, an Event is published or cancelled, a payment fails or an invoice is issued, Agilis sends an HTTPS POST with a JSON body to each of your endpoints that asked for that type of event.
Org Admins and Developers manage endpoints in the Ad Portal, with the endpoints below, or with the MCP server's webhook tools. Endpoints belong to your organisation and to one mode: TEST endpoints receive TEST events only, LIVE endpoints LIVE events only.
- Event types:
offer.created,offer.payment_succeeded,offer.payment_failed,offer.started,offer.paused,offer.resumed,offer.ended,offer.deleted,offer.disabled,offer.enabled,event.published,event.updated,event.rescheduled,event.cancelled,event.deleted,event.ended,balance.topped_up,balance.low,invoice.created,terms.version_issued. What each means and carries, with a complete example: Event types. - Body:
id(whevt_…),type,created(Unix seconds),livemode,version,data.object(the Offer, Event or invoice, as the API returns it elsewhere), any extra facts indata, andrequest.source: api, mcp, ad_portal, agilis or system. - Signature: every request carries
Agilis-Signature: t=<timestamp>,v1=<signature>. The signature is the hex HMAC-SHA256 of<timestamp>.<raw body>with your endpoint's secret. Compute it over the body exactly as received, compare in constant time, and reject a timestamp more than 5 minutes old. - Answer quickly: reply with any 2xx status within 10 seconds, then do the work. Anything else, or no answer, is a failed attempt.
- Retries: LIVE events are retried for up to 3 days, sooner at first and then every 12 hours; TEST events three times over about 2½ hours. An endpoint with no successful delivery for 24 hours is reported to your Org Admins by email, and turned off after 3 days. Agilis may also turn off an endpoint that misbehaves (
disabled_byis agilis). Turn an endpoint back on in the Ad Portal or withPATCH /webhook-endpoints/{endpoint_id}and"status": "enabled", then resend what it missed. - Duplicates and order: an event can occasionally arrive more than once, and events are not guaranteed to arrive in order. Use
idto ignore repeats andcreatedto order them. - Missed events:
GET /webhook-eventslists the last 30 days; resend any of them for 15 days.
Event types
Every message has the same envelope; data.object and the other fields in data depend on the type. Open a type to see a complete message. The same catalogue is in the OpenAPI description (webhooks) and in AsyncAPI 3.
| Type | When | In data |
|---|---|---|
offer.created |
An Offer was created: paid from your balance at once, or awaiting a card payment. |
object: the Offerpayment_method: B: paid from your balance. E: awaiting payment by Stripe link.amount_charged: What was deducted from your balance (payment_method B only).amount_due: What the payment link asks for, before any VAT (payment_method E only).currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example offer.created message
|
offer.payment_succeeded |
The card payment for an Offer created with payment_method E completed. |
object: the Offeramount_paid: The amount paid.currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example offer.payment_succeeded message
|
offer.payment_failed |
The card payment for an Offer was declined or failed, or its payment link expired. The Offer stays Awaiting Payment. |
object: the Offerreason: declined: the card was declined (the payer can try again); failed: the payment failed; expired: the payment link expired.amount_due: The amount that was due.currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example offer.payment_failed message
|
offer.started |
An Offer became visible to members: at once, or at its scheduled start. |
object: the Offer Example offer.started message
|
offer.paused |
An Offer was paused, by your organisation or by Agilis. |
object: the Offerpaused_by: Who paused it: your organisation, or Agilis. Example offer.paused message
|
offer.resumed |
A paused Offer was resumed. |
object: the Offerresumed_by: Who resumed it: your organisation, or Agilis. Example offer.resumed message
|
offer.ended |
An Offer's time is up. Any unused time is credited to your balance. |
object: the Offerunused_time_credited: Credited to your balance for time the Offer did not run (0 if none).currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example offer.ended message
|
offer.deleted |
An Offer was deleted. Any unused time is credited to your balance. |
object: the Offerunused_time_credited: Credited to your balance for time the Offer did not run (0 if none).currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example offer.deleted message
|
offer.disabled |
Agilis took an Offer off members' feeds. Your Org Admins are told why by email. |
object: the Offer Example offer.disabled message
|
offer.enabled |
Agilis put a disabled Offer back on members' feeds. |
object: the Offer Example offer.enabled message
|
| Type | When | In data |
|---|---|---|
event.published |
An Event was published. |
object: the Eventamount_charged: The listing fee taken from your balance (0 for a TEST event).currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example event.published message
|
event.updated |
An Event's details, image or crop changed. |
object: the Eventchanged_fields: The fields that changed. Example event.updated message
|
event.rescheduled |
An Event moved to new dates. |
object: the Eventreschedule_count: How many times it has been rescheduled. Example event.rescheduled message
|
event.cancelled |
An Event was cancelled. |
object: the Event Example event.cancelled message
|
event.deleted |
An Event was deleted. |
object: the Event Example event.deleted message
|
event.ended |
An Event's end time passed. |
object: the Event Example event.ended message
|
| Type | When | In data |
|---|---|---|
balance.topped_up |
A top-up was credited to your balance. |
object: nullamount_added: Added to your balance, promotional credit included.of_which_promo_credit: The part of amount_added that is promotional credit.currency: ISO 4217 code of the amounts, your billing currency. Example: GBPbalance: Your Organisation balance (everyone's balances added together) after the top-up. Example balance.topped_up message
|
balance.low |
Your Organisation balance (everyone's balances added together) fell below the low balance alert amount an Org Admin set in Settings. Sent once until the balance is back at or above that amount. |
object: nullbalance: Your Organisation balance (everyone's balances added together) now.alert_amount: The alert amount set in Settings.currency: ISO 4217 code of the amounts, your billing currency. Example: GBP Example balance.low message
|
| Type | When | In data |
|---|---|---|
invoice.created |
An invoice was issued: for an Offer, an Event or a top-up. |
object: the invoice Example invoice.created message
|
terms.version_issued |
Agilis issued a new version of the Advertising Terms. An Org Admin must accept it before your organisation can create Offers or publish Events again, through the API too. |
object: nullversion: The version label.issued_at: When it was issued (UTC).url: Where to read them.accept_url: Where an Org Admin accepts them.acceptance_needed_to_create: Always true: creating Offers and Events waits for acceptance. Example terms.version_issued message
|
Verify the signature
Check every message before you act on it. Read the body exactly as received, before any JSON parsing or re-encoding, then:
- Split the
Agilis-Signatureheader on commas:tis the timestamp, eachv1a signature. While a rolled secret is still valid there is onev1per secret. - Compute the hex HMAC-SHA256 of
<t>.<raw body>with your endpoint secret (whsec_…). - Accept the message if any
v1equals it, compared in constant time, andtis within 5 minutes of now.
Each official SDK does this in one call, and returns the parsed event or raises an error. Pass the raw body, the Agilis-Signature header and your endpoint secret:
import { webhooks } from '@agilisdating/ads';
const event = webhooks.constructEvent(rawBody, signatureHeader, secret);
from agilis_ads import construct_event
event = construct_event(raw_body, signature_header, secret)
use Agilis\Ads\Webhooks;
$event = (new Webhooks())->constructEvent($rawBody, $signatureHeader, $secret);
using Agilis.Ads;
var webhookEvent = Webhooks.ConstructEvent(rawBody, signatureHeader, secret);
import dating.agilis.ads.Webhooks;
var event = Webhooks.constructEvent(rawBody, signatureHeader, secret);
import agilisads "github.com/agilisdating/agilis-ads-go"
event, err := agilisads.ConstructEvent(payload, signatureHeader, secret)
require "agilis_ads"
event = AgilisAds::Webhook.construct_event(raw_body, signature_header, secret)
Without an SDK:
const crypto = require('node:crypto');
// rawBody: the request body exactly as received (a Buffer or string), before any JSON parsing.
function verifyAgilisWebhook(rawBody, header, secret, toleranceSeconds = 300) {
const parts = String(header || '').split(',').map((p) => p.trim().split('='));
const t = (parts.find(([k]) => k === 't') || [])[1];
const signatures = parts.filter(([k]) => k === 'v1').map(([, v]) => v);
if (!/^\d+$/.test(t || '') || signatures.length === 0) throw new Error('Invalid signature header');
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const ok = signatures.some((s) => s.length === expected.length
&& crypto.timingSafeEqual(Buffer.from(s), Buffer.from(expected)));
if (!ok) throw new Error('Signature does not match');
if (Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) throw new Error('Timestamp outside the tolerance');
return JSON.parse(rawBody);
}
import hashlib, hmac, json, time
# raw_body: the request body exactly as received (bytes), before any JSON parsing.
def verify_agilis_webhook(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> dict:
parts = [p.strip().split("=", 1) for p in (header or "").split(",") if "=" in p]
t = next((v for k, v in parts if k == "t"), "")
signatures = [v for k, v in parts if k == "v1"]
if not t.isdigit() or not signatures:
raise ValueError("Invalid signature header")
expected = hmac.new(secret.encode(), t.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
if not any(hmac.compare_digest(expected, s) for s in signatures):
raise ValueError("Signature does not match")
if abs(time.time() - int(t)) > tolerance:
raise ValueError("Timestamp outside the tolerance")
return json.loads(raw_body)
<?php
// $rawBody: the request body exactly as received, e.g. file_get_contents('php://input').
function verifyAgilisWebhook(string $rawBody, string $header, string $secret, int $tolerance = 300): array
{
$t = null;
$signatures = [];
foreach (explode(',', $header) as $part) {
[$k, $v] = array_pad(explode('=', trim($part), 2), 2, '');
if ($k === 't') { $t = $v; }
if ($k === 'v1') { $signatures[] = $v; }
}
if ($t === null || !ctype_digit($t) || $signatures === []) {
throw new RuntimeException('Invalid signature header');
}
$expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
$ok = false;
foreach ($signatures as $s) { $ok = $ok || hash_equals($expected, $s); }
if (!$ok) { throw new RuntimeException('Signature does not match'); }
if (abs(time() - (int) $t) > $tolerance) { throw new RuntimeException('Timestamp outside the tolerance'); }
return json_decode($rawBody, true, 512, JSON_THROW_ON_ERROR);
}
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
// rawBody: the request body exactly as received, read as a string before any JSON parsing.
static JsonDocument VerifyAgilisWebhook(string rawBody, string header, string secret, int toleranceSeconds = 300)
{
string? t = null;
var signatures = new List<string>();
foreach (var part in (header ?? "").Split(','))
{
var kv = part.Trim().Split('=', 2);
if (kv.Length != 2) continue;
if (kv[0] == "t") t = kv[1];
if (kv[0] == "v1") signatures.Add(kv[1]);
}
if (t is null || !long.TryParse(t, out var ts) || signatures.Count == 0)
throw new InvalidOperationException("Invalid signature header");
using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
var expected = Convert.ToHexString(hmac.ComputeHash(Encoding.UTF8.GetBytes($"{t}.{rawBody}"))).ToLowerInvariant();
var ok = signatures.Any(s => CryptographicOperations.FixedTimeEquals(Encoding.UTF8.GetBytes(s), Encoding.UTF8.GetBytes(expected)));
if (!ok) throw new InvalidOperationException("Signature does not match");
if (Math.Abs(DateTimeOffset.UtcNow.ToUnixTimeSeconds() - ts) > toleranceSeconds)
throw new InvalidOperationException("Timestamp outside the tolerance");
return JsonDocument.Parse(rawBody);
}
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.HexFormat;
import java.util.List;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
// rawBody: the request body exactly as received, read as a UTF-8 string before any JSON parsing.
// Returns the verified body; parse it with your JSON library.
static String verifyAgilisWebhook(String rawBody, String header, String secret) throws Exception {
return verifyAgilisWebhook(rawBody, header, secret, 300);
}
static String verifyAgilisWebhook(String rawBody, String header, String secret, long toleranceSeconds) throws Exception {
String t = null;
List<String> signatures = new ArrayList<>();
for (String part : (header == null ? "" : header).split(",")) {
String[] kv = part.trim().split("=", 2);
if (kv.length != 2) continue;
if (kv[0].equals("t")) t = kv[1];
if (kv[0].equals("v1")) signatures.add(kv[1]);
}
if (t == null || !t.matches("\\d+") || signatures.isEmpty()) throw new SecurityException("Invalid signature header");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] expected = HexFormat.of().formatHex(mac.doFinal((t + "." + rawBody).getBytes(StandardCharsets.UTF_8)))
.getBytes(StandardCharsets.UTF_8);
boolean ok = false;
for (String s : signatures) ok |= MessageDigest.isEqual(expected, s.getBytes(StandardCharsets.UTF_8));
if (!ok) throw new SecurityException("Signature does not match");
if (Math.abs(System.currentTimeMillis() / 1000 - Long.parseLong(t)) > toleranceSeconds)
throw new SecurityException("Timestamp outside the tolerance");
return rawBody;
}
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"math"
"strconv"
"strings"
"time"
)
// rawBody: the request body exactly as received (io.ReadAll(r.Body)), before any JSON parsing.
// Pass tolerance 5 * time.Minute.
func VerifyAgilisWebhook(rawBody []byte, header, secret string, tolerance time.Duration) (map[string]any, error) {
var t string
var signatures []string
for _, part := range strings.Split(header, ",") {
k, v, found := strings.Cut(strings.TrimSpace(part), "=")
if !found {
continue
}
switch k {
case "t":
t = v
case "v1":
signatures = append(signatures, v)
}
}
ts, err := strconv.ParseInt(t, 10, 64)
if err != nil || len(signatures) == 0 {
return nil, errors.New("invalid signature header")
}
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(t + "."))
mac.Write(rawBody)
expected := hex.EncodeToString(mac.Sum(nil))
ok := false
for _, s := range signatures {
ok = ok || hmac.Equal([]byte(expected), []byte(s))
}
if !ok {
return nil, errors.New("signature does not match")
}
if math.Abs(float64(time.Now().Unix()-ts)) > tolerance.Seconds() {
return nil, errors.New("timestamp outside the tolerance")
}
var event map[string]any
return event, json.Unmarshal(rawBody, &event)
}
require "json"
require "openssl"
# raw_body: the request body exactly as received (request.raw_post / request.body.read).
def verify_agilis_webhook(raw_body, header, secret, tolerance = 300)
parts = header.to_s.split(",").map { |p| p.strip.split("=", 2) }.select { |p| p.size == 2 }
t = parts.find { |k, _| k == "t" }&.last.to_s
signatures = parts.select { |k, _| k == "v1" }.map(&:last)
raise ArgumentError, "Invalid signature header" unless t.match?(/\A\d+\z/) && !signatures.empty?
expected = OpenSSL::HMAC.hexdigest("SHA256", secret, "#{t}.".b + raw_body.to_s.b)
raise ArgumentError, "Signature does not match" unless signatures.any? { |s| OpenSSL.secure_compare(expected, s) }
raise ArgumentError, "Timestamp outside the tolerance" if (Time.now.to_i - t.to_i).abs > tolerance
JSON.parse(raw_body.to_s.dup.force_encoding(Encoding::UTF_8))
end
Getting started and testing
Create a TEST endpoint and store its secret, then POST /webhook-endpoints/{endpoint_id}/test with any type until your server checks the signature and answers 2xx. A test message is signed like any other and carries "test": true; it is sent once, never retried, and never counts towards the endpoint's failures. Then do the same with a LIVE key.
List Webhook Endpoints
GET
/webhook-endpoints
Your organisation's webhook endpoints in your key's mode. The signing secret is never returned here: it is shown only when the endpoint is created and when its secret is rolled. Org Admin and Developer API keys only; an Advertiser's key is refused (HTTP 403, E2). Endpoints belong to the organisation and to your key's mode: a TEST key sees TEST endpoints only.
- Header
x-api-key: YOUR_API_KEY_HERE
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Endpoints returned (up to 16). |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints
curl -X GET "https://ads.agilis.dating/webhook-endpoints" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.list();
console.log(result.data?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.list()
print(len(result["data"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->list();
echo count($result['data']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.ListAsync();
Console.WriteLine(result.Data.Count);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().list();
System.out.println(result.getData().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Data))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.list
puts result.data.length
Example response
{
"return_code": "S1",
"data": [
{
"id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"url": "https://hooks.example.com/agilis",
"description": "Order system",
"enabled_events": ["offer.started", "offer.ended", "event.published"],
"status": "enabled",
"livemode": false,
"created": "2027-09-20T10:00:00Z",
"last_success_at": "2027-09-21T08:15:02Z",
"failing_since": null,
"disabled_by": null,
"disabled_reason": null,
"previous_secret_expires_at": null
}
]
}
Create Webhook Endpoint
POST
/webhook-endpoints
Adds an endpoint that Agilis will send events to. The response includes secret, shown only this once: store it safely and use it to check the Agilis-Signature header of every event. Up to 16 endpoints per mode. Org Admin and Developer API keys only; an Advertiser's key is refused (HTTP 403, E2). Endpoints belong to the organisation and to your key's mode: a TEST key sees TEST endpoints only.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
url |
string (URL) | Yes | Where to send events: an https:// address with a host name (not an IP address), on the standard port 443, that resolves to a public internet address. Up to 2,048 characters. |
enabled_events |
array of strings | Yes | The event types to send, or ["*"] for all, including types added later. See Webhooks for the list. |
description |
string | No | Optional. What the endpoint is for, up to 255 characters. |
Response fields
secretstring- The signing secret, beginning whsec_. Shown only in this response and when rolled.
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Endpoint created. It starts receiving events straight away. |
| E1 | 400 | Invalid url, enabled_events or description. The message says which. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E4 | 409 | Your organisation already has 16 endpoints in this mode. Delete one first. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints
curl -X POST "https://ads.agilis.dating/webhook-endpoints" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.example.com/agilis",
"enabled_events": ["offer.started", "offer.ended", "event.published"],
"description": "Order system"
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.create({
url: 'https://hooks.example.com/agilis',
enabled_events: ['offer.started', 'offer.ended', 'event.published'],
description: 'Order system',
});
console.log(result.secret);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.create({
"url": "https://hooks.example.com/agilis",
"enabled_events": ["offer.started", "offer.ended", "event.published"],
"description": "Order system",
})
print(result["secret"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->create([
'url' => 'https://hooks.example.com/agilis',
'enabled_events' => ['offer.started', 'offer.ended', 'event.published'],
'description' => 'Order system',
]);
echo $result['secret'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.CreateAsync(new WebhookEndpointCreateParams
{
Url = "https://hooks.example.com/agilis",
EnabledEvents = new[] { "offer.started", "offer.ended", "event.published" },
Description = "Order system",
});
Console.WriteLine(result.Secret);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.CreateWebhookEndpointParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().create(
CreateWebhookEndpointParams.builder()
.url("https://hooks.example.com/agilis")
.enabledEvents("offer.started", "offer.ended", "event.published")
.description("Order system")
.build());
System.out.println(result.getSecret());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.Create(ctx, &agilisads.CreateWebhookEndpointParams{
URL: "https://hooks.example.com/agilis",
EnabledEvents: []string{"offer.started", "offer.ended", "event.published"},
Description: agilisads.String("Order system"),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Secret)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.create(
url: "https://hooks.example.com/agilis",
enabled_events: ["offer.started", "offer.ended", "event.published"],
description: "Order system"
)
puts result.secret
Example response
{
"return_code": "S1",
"id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"url": "https://hooks.example.com/agilis",
"description": "Order system",
"enabled_events": ["offer.started", "offer.ended", "event.published"],
"status": "enabled",
"livemode": false,
"created": "2027-09-20T10:00:00Z",
"last_success_at": null,
"failing_since": null,
"disabled_by": null,
"disabled_reason": null,
"previous_secret_expires_at": null,
"secret": "whsec_4mJ0c…"
}
Get Webhook Endpoint
GET
/webhook-endpoints/{endpoint_id}
One endpoint, without its secret. failing_since is when deliveries to it started failing (null while they succeed); disabled_by is business when you turned it off, system when Agilis turned it off after 3 days of failures, or agilis when Agilis support did.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
endpoint_id path |
string | Yes | The endpoint id. Example: we_01JD2X4Q7N8P9R0S1T2V3W4X5Y |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Endpoint returned. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints/{endpoint_id}
curl -X GET "https://ads.agilis.dating/webhook-endpoints/we_01JD2X4Q7N8P9R0S1T2V3W4X5Y" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.get('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y');
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.get("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->get('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y');
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.GetAsync("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y");
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().get("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y");
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.Get(ctx, "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.get("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
puts result.status
Example response
{
"return_code": "S1",
"id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"url": "https://hooks.example.com/agilis",
"description": "Order system",
"enabled_events": ["offer.started", "offer.ended", "event.published"],
"status": "enabled",
"livemode": false,
"created": "2027-09-20T10:00:00Z",
"last_success_at": "2027-09-21T08:15:02Z",
"failing_since": null,
"disabled_by": null,
"disabled_reason": null,
"previous_secret_expires_at": null
}
Update Webhook Endpoint
PATCH
/webhook-endpoints/{endpoint_id}
Changes an endpoint. Send only what changes. Turning an endpoint back on (enabled) clears its failing state; events that stopped being retried while it was off are not sent again unless you resend them. An endpoint that Agilis support turned off can only be turned back on by Agilis support.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
endpoint_id path |
string | Yes | The endpoint id. Example: we_01JD2X4Q7N8P9R0S1T2V3W4X5Y |
url |
string (URL) | No | Where to send events: an https:// address with a host name (not an IP address), on the standard port 443, that resolves to a public internet address. Up to 2,048 characters. |
enabled_events |
array of strings | No | The event types to send, or ["*"] for all, including types added later. See Webhooks for the list. |
description |
string | No | Up to 255 characters, or null to clear it. |
status |
string | No | disabled stops sending events to it; enabled starts again. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Endpoint updated. |
| E1 | 400 | Invalid input. The message says which. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
| E2 | 409 | Agilis support turned this endpoint off. Contact help@agilis.dating. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints/{endpoint_id}
curl -X PATCH "https://ads.agilis.dating/webhook-endpoints/we_01JD2X4Q7N8P9R0S1T2V3W4X5Y" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"enabled_events": ["*"]
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.update('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y', {
enabled_events: ['*'],
});
console.log(result.status);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.update("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", {
"enabled_events": ["*"],
})
print(result["status"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->update('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y', [
'enabled_events' => ['*'],
]);
echo $result['status'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.UpdateAsync("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", new WebhookEndpointUpdateParams
{
EnabledEvents = new[] { "*" },
});
Console.WriteLine(result.Status);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.UpdateWebhookEndpointParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().update(
"we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
UpdateWebhookEndpointParams.builder()
.enabledEvents("*")
.build());
System.out.println(result.getStatus());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.Update(ctx, "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", &agilisads.UpdateWebhookEndpointParams{
EnabledEvents: []string{"*"},
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.update(
"we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
enabled_events: ["*"]
)
puts result.status
Example response
{
"return_code": "S1",
"id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"url": "https://hooks.example.com/agilis",
"description": "Order system",
"enabled_events": ["*"],
"status": "enabled",
"livemode": false,
"created": "2027-09-20T10:00:00Z",
"last_success_at": "2027-09-21T08:15:02Z",
"failing_since": null,
"disabled_by": null,
"disabled_reason": null,
"previous_secret_expires_at": null
}
Delete Webhook Endpoint
DELETE
/webhook-endpoints/{endpoint_id}
Deletes an endpoint. Nothing more is sent to it, including retries already scheduled. This cannot be undone.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
endpoint_id path |
string | Yes | The endpoint id. Example: we_01JD2X4Q7N8P9R0S1T2V3W4X5Y |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Endpoint deleted. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints/{endpoint_id}
curl -X DELETE "https://ads.agilis.dating/webhook-endpoints/we_01JD2X4Q7N8P9R0S1T2V3W4X5Y" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.delete('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y');
console.log(result.deleted);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.delete("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
print(result["deleted"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->delete('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y');
echo $result['deleted'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.DeleteAsync("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y");
Console.WriteLine(result.Deleted);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().delete("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y");
System.out.println(result.getDeleted());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.Delete(ctx, "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Deleted)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.delete("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
puts result.deleted
Example response
{
"return_code": "S1",
"id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"deleted": true
}
Roll Webhook Secret
POST
/webhook-endpoints/{endpoint_id}/roll-secret
Replaces an endpoint's signing secret. The new secret is in the response, shown only this once. Until expires_in passes, every event is signed with both the new and the old secret (two v1 values in Agilis-Signature), so you can update your server without missing any.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
endpoint_id path |
string | Yes | The endpoint id. Example: we_01JD2X4Q7N8P9R0S1T2V3W4X5Y |
expires_in |
string | No | How long the old secret keeps signing. Default 24h. now stops it at once, for a secret that may have leaked. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Secret replaced. |
| E1 | 400 | Invalid expires_in. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints/{endpoint_id}/roll-secret
curl -X POST "https://ads.agilis.dating/webhook-endpoints/we_01JD2X4Q7N8P9R0S1T2V3W4X5Y/roll-secret" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"expires_in": "24h"
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.rollSecret('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y', {
expires_in: '24h',
});
console.log(result.secret);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.roll_secret("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", {
"expires_in": "24h",
})
print(result["secret"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->rollSecret('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y', [
'expires_in' => '24h',
]);
echo $result['secret'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.RollSecretAsync("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", new WebhookSecretRollParams
{
ExpiresIn = "24h",
});
Console.WriteLine(result.Secret);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.RollWebhookSecretParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().rollSecret(
"we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
RollWebhookSecretParams.builder()
.expiresIn("24h")
.build());
System.out.println(result.getSecret());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.RollSecret(ctx, "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", &agilisads.RollWebhookSecretParams{
ExpiresIn: "24h",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Secret)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.roll_secret(
"we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
expires_in: "24h"
)
puts result.secret
Example response
{
"return_code": "S1",
"id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"url": "https://hooks.example.com/agilis",
"description": "Order system",
"enabled_events": ["offer.started", "offer.ended", "event.published"],
"status": "enabled",
"livemode": false,
"created": "2027-09-20T10:00:00Z",
"last_success_at": "2027-09-21T08:15:02Z",
"failing_since": null,
"disabled_by": null,
"disabled_reason": null,
"previous_secret_expires_at": "2027-09-22T10:00:00Z",
"secret": "whsec_9pQ2r…"
}
Send Test Webhook
POST
/webhook-endpoints/{endpoint_id}/test
Sends one sample event to the endpoint now, signed like any other, with "test": true in its body, and answers with the result. data.object is your organisation's latest Offer or Event in this mode, or null if there is none. A test event is never retried and never counts towards the endpoint failing.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
endpoint_id path |
string | Yes | The endpoint id. Example: we_01JD2X4Q7N8P9R0S1T2V3W4X5Y |
type |
string | No | The event type to send. Default offer.created. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Sent. delivery.status is succeeded when your server answered 2xx within 10 seconds, otherwise failed with last_http_status or last_error. |
| E1 | 400 | Invalid type. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
| E2 | 409 | The endpoint is turned off. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-endpoints/{endpoint_id}/test
curl -X POST "https://ads.agilis.dating/webhook-endpoints/we_01JD2X4Q7N8P9R0S1T2V3W4X5Y/test" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"type": "offer.started"
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEndpoints.sendTest('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y', {
type: 'offer.started',
});
console.log(result.webhook_event_id);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_endpoints.send_test("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", {
"type": "offer.started",
})
print(result["webhook_event_id"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEndpoints->sendTest('we_01JD2X4Q7N8P9R0S1T2V3W4X5Y', [
'type' => 'offer.started',
]);
echo $result['webhook_event_id'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEndpoints.SendTestAsync("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", new WebhookTestParams
{
Type = "offer.started",
});
Console.WriteLine(result.WebhookEventId);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.SendTestWebhookParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEndpoints().sendTest(
"we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
SendTestWebhookParams.builder()
.type("offer.started")
.build());
System.out.println(result.getWebhookEventId());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEndpoints.SendTest(ctx, "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y", &agilisads.SendTestWebhookParams{
Type: "offer.started",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.WebhookEventID)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_endpoints.send_test(
"we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
type: "offer.started"
)
puts result.webhook_event_id
Example response
{
"return_code": "S1",
"webhook_event_id": "whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M",
"type": "offer.started",
"test": true,
"delivery": {
"endpoint_id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"status": "succeeded",
"attempts": 1,
"last_http_status": 200,
"last_error": null,
"next_attempt_at": null,
"delivered_at": "2027-09-21T08:15:02Z"
}
}
List Webhook Events
GET
/webhook-events
Webhook events of the last 30 days in your key's mode, newest first, each with its deliveries to your endpoints. Use it to find events your server missed. Org Admin and Developer API keys only; an Advertiser's key is refused (HTTP 403, E2). Endpoints belong to the organisation and to your key's mode: a TEST key sees TEST endpoints only.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
type query |
string | No | Only events of this type. |
delivery_success query |
boolean | No | false: only events not yet delivered to every endpoint. true: only events delivered everywhere. |
limit query |
integer | No | Page size, 1 to 100. Default 20. |
cursor query |
string | No | The next_cursor of the previous page. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Events returned. |
| E1 | 400 | Invalid filter, limit or cursor. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-events
curl -X GET "https://ads.agilis.dating/webhook-events?delivery_success=false&limit=20" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEvents.list({
delivery_success: false,
limit: 20,
});
console.log(result.data?.length);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_events.list({
"delivery_success": False,
"limit": 20,
})
print(len(result["data"]))
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEvents->list([
'delivery_success' => false,
'limit' => 20,
]);
echo count($result['data']), "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEvents.ListAsync(new WebhookEventListParams
{
DeliverySuccess = false,
Limit = 20,
});
Console.WriteLine(result.Data.Count);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.ListWebhookEventsParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEvents().list(
ListWebhookEventsParams.builder()
.deliverySuccess(false)
.limit(20)
.build());
System.out.println(result.getData().size());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEvents.List(ctx, &agilisads.ListWebhookEventsParams{
DeliverySuccess: agilisads.Bool(false),
Limit: 20,
})
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Data))
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_events.list(
delivery_success: false,
limit: 20
)
puts result.data.length
Example response
{
"return_code": "S1",
"data": [
{
"id": "whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M",
"type": "offer.started",
"created": 1821341702,
"livemode": false,
"test": false,
"data": {
"object": {
"offer_id": 45,
"title": "20% off summer sale",
"category": "Retail",
"description": "Discount valid through July",
"terms_and_conditions": "Valid online only.",
"advertised_name": null,
"push_notification_title": "20% off this summer",
"push_notification_message": "Show this at the till for 20% off everything until the end of July.",
"button_preset": "claim_offer",
"button_text": null,
"url": "https://advertiseroffer.com",
"image": "https://ads.agilis.dating/92/offers/45/offer_orig.png",
"latitude": 51.5074,
"longitude": -0.1278,
"radius": 10,
"gender": ["Male", "Female"],
"interests": [
{
"interest_id": 3,
"interest_name": "Cooking"
},
{
"interest_id": 7,
"interest_name": "Fitness"
}
],
"start_datetime": "2027-07-10T08:00:00Z",
"expiry_datetime": "2027-07-12T20:30:00Z",
"creation_datetime": "2027-06-01T10:00:00Z",
"offer_status": "Active",
"status": "enabled"
}
},
"request": {
"source": "system",
"idempotency_key": null
},
"deliveries": [
{
"endpoint_id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"status": "pending",
"attempts": 2,
"last_http_status": 503,
"last_error": null,
"next_attempt_at": "2027-09-21T08:45:00Z",
"delivered_at": null
}
]
}
],
"pagination": {
"limit": 20,
"count": 1,
"has_more": false,
"next_cursor": null
}
}
Get Webhook Event
GET
/webhook-events/{webhook_event_id}
One webhook event: what was sent, and each delivery's status, attempts and last result.
- Header
x-api-key: YOUR_API_KEY_HERE
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
webhook_event_id path |
string | Yes | The webhook event id. Example: whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Event returned. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-events/{webhook_event_id}
curl -X GET "https://ads.agilis.dating/webhook-events/whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M" \
-H "x-api-key: YOUR_API_KEY_HERE"
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEvents.get('whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M');
console.log(result.type);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_events.get("whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M")
print(result["type"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEvents->get('whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M');
echo $result['type'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEvents.GetAsync("whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M");
Console.WriteLine(result.Type);
import dating.agilis.ads.AgilisClient;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEvents().get("whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M");
System.out.println(result.getType());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEvents.Get(ctx, "whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M")
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Type)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_events.get("whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M")
puts result.type
Example response
{
"return_code": "S1",
"id": "whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M",
"type": "offer.started",
"created": 1821341702,
"livemode": false,
"test": false,
"data": {
"object": {
"offer_id": 45,
"title": "20% off summer sale",
"category": "Retail",
"description": "Discount valid through July",
"terms_and_conditions": "Valid online only.",
"advertised_name": null,
"push_notification_title": "20% off this summer",
"push_notification_message": "Show this at the till for 20% off everything until the end of July.",
"button_preset": "claim_offer",
"button_text": null,
"url": "https://advertiseroffer.com",
"image": "https://ads.agilis.dating/92/offers/45/offer_orig.png",
"latitude": 51.5074,
"longitude": -0.1278,
"radius": 10,
"gender": ["Male", "Female"],
"interests": [
{
"interest_id": 3,
"interest_name": "Cooking"
},
{
"interest_id": 7,
"interest_name": "Fitness"
}
],
"start_datetime": "2027-07-10T08:00:00Z",
"expiry_datetime": "2027-07-12T20:30:00Z",
"creation_datetime": "2027-06-01T10:00:00Z",
"offer_status": "Active",
"status": "enabled"
}
},
"request": {
"source": "system",
"idempotency_key": null
},
"deliveries": [
{
"endpoint_id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"status": "succeeded",
"attempts": 1,
"last_http_status": 200,
"last_error": null,
"next_attempt_at": null,
"delivered_at": "2027-09-21T08:15:02Z"
}
]
}
Resend Webhook Event
POST
/webhook-events/{webhook_event_id}/resend
Sends an event again now, exactly as first sent (same id, so your server can recognise a repeat), to one endpoint or to every endpoint it went to. Events can be resent for 15 days. Endpoints that are turned off are skipped.
- Header
x-api-key: YOUR_API_KEY_HERE- Content-Type
application/json
Parameters
| Field | Type | Required | Notes |
|---|---|---|---|
webhook_event_id path |
string | Yes | The webhook event id. Example: whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M |
endpoint_id |
string | No | Send to this endpoint only, including one the event did not go to at first. Omit to send to every endpoint it went to. |
Return codes
| Code | HTTP | Meaning |
|---|---|---|
| S1 | 200 | Sent. deliveries has each result. |
| E2 | 403 | The key is not an Org Admin's or a Developer's. |
| E3 | 404 | Not found in this organisation and mode (HTTP 404). |
| E2 | 409 | The event is more than 15 days old, is still being sent for the first time, or went to no endpoint (give endpoint_id). |
Try it with your TEST key
TEST keys only. The key stays in this page and is sent only to https://ads.agilis.dating.
Response
/webhook-events/{webhook_event_id}/resend
curl -X POST "https://ads.agilis.dating/webhook-events/whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M/resend" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"endpoint_id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y"
}'
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.webhookEvents.resend('whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M', {
endpoint_id: 'we_01JD2X4Q7N8P9R0S1T2V3W4X5Y',
});
console.log(result.webhook_event_id);
from agilis_ads import Agilis
client = Agilis() # reads AGILIS_API_KEY
result = client.webhook_events.resend("whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M", {
"endpoint_id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
})
print(result["webhook_event_id"])
<?php
require 'vendor/autoload.php';
use Agilis\Ads\AgilisClient;
$agilis = new AgilisClient(); // reads AGILIS_API_KEY
$result = $agilis->webhookEvents->resend('whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M', [
'endpoint_id' => 'we_01JD2X4Q7N8P9R0S1T2V3W4X5Y',
]);
echo $result['webhook_event_id'], "\n";
using Agilis.Ads;
using var client = new AgilisClient(); // reads AGILIS_API_KEY
var result = await client.WebhookEvents.ResendAsync("whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M", new WebhookEventResendParams
{
EndpointId = "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
});
Console.WriteLine(result.WebhookEventId);
import dating.agilis.ads.AgilisClient;
import dating.agilis.ads.param.ResendWebhookEventParams;
AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY
var result = client.webhookEvents().resend(
"whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M",
ResendWebhookEventParams.builder()
.endpointId("we_01JD2X4Q7N8P9R0S1T2V3W4X5Y")
.build());
System.out.println(result.getWebhookEventId());
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.WebhookEvents.Resend(ctx, "whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M", &agilisads.ResendWebhookEventParams{
EndpointID: "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.WebhookEventID)
}
require "agilis_ads"
client = AgilisAds::Client.new # reads AGILIS_API_KEY
result = client.webhook_events.resend(
"whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M",
endpoint_id: "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y"
)
puts result.webhook_event_id
Example response
{
"return_code": "S1",
"webhook_event_id": "whevt_01JD2Y8B3C4D5E6F7G8H9J0K1M",
"deliveries": [
{
"endpoint_id": "we_01JD2X4Q7N8P9R0S1T2V3W4X5Y",
"status": "succeeded",
"attempts": 3,
"last_http_status": 200,
"last_error": null,
"next_attempt_at": null,
"delivered_at": "2027-09-21T08:15:02Z"
}
]
}
Return codes by endpoint
Every response carries a return_code: S1 (or S2 on resume) for success, E1 to E9 for errors. A code's meaning depends on the endpoint: E5 on Create Offer means no members match the targeting, but on Pause it means the offer is awaiting payment. Read the row for the endpoint you called. Each meaning links to that endpoint's own table.
| Code | Endpoint | HTTP | Meaning on that endpoint |
|---|---|---|---|
| S1 | POST /offers/price-estimate |
200 | Estimate calculated successfully. |
POST /offers |
200 | Offer created: payment link issued (E), or Active/Scheduled if paid from balance (B). |
|
POST /offers/{offer_id}/pause |
200 | Offer paused successfully. | |
DELETE /offers/{offer_id} |
200 | Offer deleted successfully. | |
POST /events/preview |
200 | Preview returned. category is what publishing this wording will get; image.preview_token is single-use, bound to your organisation and valid for 24 hours (expires_at); image.preview_url is a short-lived signed link to the processed picture. listing_fee is in your billing currency (currency). If your billing currency cannot be billed right now, the preview still returns S1, with listing_fee null and balance_sufficient false, and publishing would return E6. |
|
POST /events |
200 | Event published. amount_charged and currency show what was taken from your balance, in your billing currency (0 for TEST); category is the category determined for it. A LIVE event appears in the app within a few minutes. |
|
PATCH /events/{event_id} |
200 | Event updated. changed_fields lists what changed; category is the category after the change; venue_changed says whether members will be told of a venue change. |
|
POST /events/{event_id}/reschedule |
200 | Event rescheduled. | |
POST /events/{event_id}/cancel |
200 | Event cancelled. The listing fee is not refunded. | |
DELETE /events/{event_id} |
200 | Event deleted. | |
GET /webhook-endpoints |
200 | Endpoints returned (up to 16). | |
POST /webhook-endpoints |
200 | Endpoint created. It starts receiving events straight away. | |
GET /webhook-endpoints/{endpoint_id} |
200 | Endpoint returned. | |
PATCH /webhook-endpoints/{endpoint_id} |
200 | Endpoint updated. | |
DELETE /webhook-endpoints/{endpoint_id} |
200 | Endpoint deleted. | |
POST /webhook-endpoints/{endpoint_id}/roll-secret |
200 | Secret replaced. | |
POST /webhook-endpoints/{endpoint_id}/test |
200 | Sent. delivery.status is succeeded when your server answered 2xx within 10 seconds, otherwise failed with last_http_status or last_error. |
|
GET /webhook-events |
200 | Events returned. | |
GET /webhook-events/{webhook_event_id} |
200 | Event returned. | |
POST /webhook-events/{webhook_event_id}/resend |
200 | Sent. deliveries has each result. |
|
| S2 | POST /offers/{offer_id}/resume |
200 | Offer resumed successfully. |
| E1 | POST /offers/price-estimate |
400 | One or more inputs are missing or invalid, or start_datetime is in the past (more than 60 seconds before now). |
POST /offers/price-estimate |
403 | environment is not your API key's mode. |
|
POST /offers |
400 | One or more inputs are missing or invalid: an invalid datetime, a duration under 60 seconds, a radius outside 5 to 30 miles, an oversized image or wrong file type, an unrecognised gender value, an unknown interests id, or an advertised_name over 100 characters, starting with http://, https:// or www., or containing HTML or a line break. |
|
POST /offers |
400 | start_datetime is more than 60 seconds before now (UTC): nothing created or charged. Message: "start_datetime cannot be in the past. Use the current time or later." |
|
POST /offers |
400 | A card payment (payment_method=E) below Stripe's minimum for your currency: nothing created; the message names the minimum. |
|
POST /offers |
400 | The Idempotency-Key header is missing. Message: "Idempotency-Key header is required." |
|
POST /offers |
403 | environment is not your API key's mode: nothing created or charged. Use a key created in that mode. |
|
GET /offers/{offer_id} |
404 | "Offer not found": no such offer, or it belongs to another account, is in the other mode, or was deleted. | |
POST /offers/{offer_id}/pause |
401 | Invalid API key, disabled account, or the offer does not belong to this account or is in the other mode. | |
POST /offers/{offer_id}/resume |
401 | Invalid API key, disabled account, or the offer does not belong to this account or is in the other mode. | |
DELETE /offers/{offer_id} |
401 | Invalid input, or "Offer not found": the offer does not belong to this account or is in the other mode. | |
POST /events/preview |
400 | Missing or invalid input, including an image that is too large, too small or not a JPEG/PNG. The message says which. |
|
POST /events |
400 | Missing or invalid input: no url; no image source, or more than one; a starts_at in the past, ends_at before starts_at, or more than 5 years ahead; bad country_code; a price without a currency, or a currency not in GET /event-currencies; an image that is too large, too small, not a JPEG/PNG, or whose crop area is below 1280 × 720; an invalid, used or expired preview_token; a source_event_id that is not yours; an advertised_name over 100 characters, starting with http://, https:// or www., or containing HTML or a line break. The message says which. |
|
POST /events |
403 | environment is not your API key's mode. Nothing was created or charged. |
|
GET /events/{event_id} |
404 | The event was not found on this account (HTTP 404). | |
PATCH /events/{event_id} |
400 | Invalid input; dates sent (use Reschedule); or nothing to change. | |
PATCH /events/{event_id} |
404 | The event was not found on this account (HTTP 404). | |
POST /events/{event_id}/reschedule |
400 | Invalid or unchanged dates. | |
POST /events/{event_id}/reschedule |
404 | The event was not found on this account (HTTP 404). | |
POST /events/{event_id}/cancel |
404 | The event was not found on this account (HTTP 404). | |
DELETE /events/{event_id} |
404 | The event was not found on this account (HTTP 404). | |
POST /webhook-endpoints |
400 | Invalid url, enabled_events or description. The message says which. |
|
PATCH /webhook-endpoints/{endpoint_id} |
400 | Invalid input. The message says which. |
|
POST /webhook-endpoints/{endpoint_id}/roll-secret |
400 | Invalid expires_in. |
|
POST /webhook-endpoints/{endpoint_id}/test |
400 | Invalid type. |
|
GET /webhook-events |
400 | Invalid filter, limit or cursor. |
|
| E2 | POST /offers/price-estimate |
400 | A date/time is not in valid ISO 8601 format. |
POST /offers |
200 | The image failed automated content moderation: nothing created. Choose a different image. | |
POST /offers/{offer_id}/pause |
200 | Offer has already ended. | |
POST /offers/{offer_id}/resume |
200 | Offer has already ended. | |
POST /events/preview |
200 | The image failed content moderation. | |
POST /events |
200 | The image failed content moderation. Nothing was charged. Retry with the same Idempotency-Key and a different image. | |
PATCH /events/{event_id} |
200 | A new image failed content moderation (nothing changed), or the event has ended or been cancelled and cannot be edited. | |
POST /events/{event_id}/reschedule |
200 | The event has already ended or been cancelled and cannot be amended. | |
POST /events/{event_id}/cancel |
200 | The event has already ended or been cancelled. | |
GET /webhook-endpoints |
403 | The key is not an Org Admin's or a Developer's. | |
POST /webhook-endpoints |
403 | The key is not an Org Admin's or a Developer's. | |
GET /webhook-endpoints/{endpoint_id} |
403 | The key is not an Org Admin's or a Developer's. | |
PATCH /webhook-endpoints/{endpoint_id} |
403 | The key is not an Org Admin's or a Developer's. | |
PATCH /webhook-endpoints/{endpoint_id} |
409 | Agilis support turned this endpoint off. Contact help@agilis.dating. | |
DELETE /webhook-endpoints/{endpoint_id} |
403 | The key is not an Org Admin's or a Developer's. | |
POST /webhook-endpoints/{endpoint_id}/roll-secret |
403 | The key is not an Org Admin's or a Developer's. | |
POST /webhook-endpoints/{endpoint_id}/test |
403 | The key is not an Org Admin's or a Developer's. | |
POST /webhook-endpoints/{endpoint_id}/test |
409 | The endpoint is turned off. | |
GET /webhook-events |
403 | The key is not an Org Admin's or a Developer's. | |
GET /webhook-events/{webhook_event_id} |
403 | The key is not an Org Admin's or a Developer's. | |
POST /webhook-events/{webhook_event_id}/resend |
403 | The key is not an Org Admin's or a Developer's. | |
POST /webhook-events/{webhook_event_id}/resend |
409 | The event is more than 15 days old, is still being sent for the first time, or went to no endpoint (give endpoint_id). |
|
| E3 | POST /offers |
200 | Your balance (the API key owner's, in the offer's mode) is less than the offer's cost (payment_method=B only): top up in the Ad Portal and retry. |
POST /offers/{offer_id}/pause |
200 | Offer is already paused. | |
POST /events |
200 | Insufficient balance. Nothing was created. Top up in the Ad Portal and retry with the same Idempotency-Key. | |
GET /webhook-endpoints/{endpoint_id} |
404 | Not found in this organisation and mode (HTTP 404). | |
PATCH /webhook-endpoints/{endpoint_id} |
404 | Not found in this organisation and mode (HTTP 404). | |
DELETE /webhook-endpoints/{endpoint_id} |
404 | Not found in this organisation and mode (HTTP 404). | |
POST /webhook-endpoints/{endpoint_id}/roll-secret |
404 | Not found in this organisation and mode (HTTP 404). | |
POST /webhook-endpoints/{endpoint_id}/test |
404 | Not found in this organisation and mode (HTTP 404). | |
GET /webhook-events/{webhook_event_id} |
404 | Not found in this organisation and mode (HTTP 404). | |
POST /webhook-events/{webhook_event_id}/resend |
404 | Not found in this organisation and mode (HTTP 404). | |
| E4 | POST /offers |
400 | Offer quota limit exceeded: the user or organisation has reached its maximum number of offers. |
POST /offers/{offer_id}/resume |
200 | Offer is already running. | |
POST /webhook-endpoints |
409 | Your organisation already has 16 endpoints in this mode. Delete one first. | |
| E5 | POST /offers |
400 | No Agilis users match the targeting supplied: nothing created. Widen the radius or broaden the gender or interests targeting. |
POST /offers/{offer_id}/pause |
200 | Offer is awaiting payment. | |
POST /offers/{offer_id}/resume |
200 | Offer is awaiting payment. | |
DELETE /events/{event_id} |
200 | Members have already interacted with this event. Use POST /events/{event_id}/cancel. |
|
| E6 | POST /offers |
400 | Your billing currency cannot be billed right now: nothing created or charged. The message is either Your organisation's currency (XYZ) is not one Agilis bills in. An Org Admin can choose a supported billing currency in the Ad Portal. You have not been charged. or Prices in XYZ are temporarily unavailable because the exchange rate is out of date. Please try again later. You have not been charged., with your currency code in place of XYZ. |
DELETE /offers/{offer_id} |
409 | The payment for this offer has just been completed, so it is no longer awaiting payment. Nothing has been deleted. Retrieve the offer again; if you still delete it, its Unused Time is credited to your balance. | |
POST /events |
400 | Your organisation's billing currency cannot be billed right now. Nothing was created or charged. The message is either Your organisation's currency (XYZ) is not one Agilis bills in. An Org Admin can choose a supported billing currency in the Ad Portal. You have not been charged. The event has not been created. or Prices in XYZ are temporarily unavailable because the exchange rate is out of date. Please try again later. You have not been charged. The event has not been created., with your currency code in place of XYZ. |
|
| E7 | DELETE /offers/{offer_id} |
503 | The payment page could not be closed. Nothing has been deleted. Try again in a few minutes. |
POST /events |
403 | LIVE publishing is temporarily unavailable. Nothing was created or charged. Retry later with the same Idempotency-Key. | |
| E8 | POST /events/preview |
429 | Too many previews this hour. Wait and retry. |
| E9 | POST /offers |
403 | Your organisation has not accepted the current Agilis Advertising Terms and Conditions: nothing created or charged. An Org Admin must accept them in the Ad Portal (adportal.agilis.dating); then retry with the same Idempotency-Key. |
POST /events |
403 | Your organisation has not accepted the current Agilis Advertising Terms and Conditions. Nothing was created or charged. An Org Admin must accept them in the Ad Portal (adportal.agilis.dating); then retry with the same Idempotency-Key. Editing, rescheduling, cancelling and deleting existing events are not affected. | |
| E10 | POST /offers |
400 | push_notification_title or push_notification_message is missing or empty: nothing created or charged. The message names the field, for example "push_notification_title is required." |
| E11 | POST /offers |
400 | push_notification_title or push_notification_message is shorter than 5 characters: nothing created or charged. The message names the field. |
| E12 | POST /offers |
400 | push_notification_title is over 50 characters, or push_notification_message over 150: nothing created or charged. The message names the field and its limit. |
| E13 | POST /offers |
400 | The notification text failed automated content moderation: nothing created or charged. The message names the field, for example "push_notification_message can't be used in a notification. Please change it." |
| E14 | POST /offers |
400 | button_preset is not one of claim_offer, visit_website, install_app, book_now, get_directions or custom: nothing created or charged. |
| E15 | POST /offers |
400 | button_preset is custom and button_text is missing, empty, or contains a line break or HTML: nothing created or charged. Message: "button_text is required when button_preset is custom, as plain text on one line." |
| E16 | POST /offers |
400 | button_text is over 20 characters: nothing created or charged. Message: "button_text must be 20 characters or fewer." |
| E17 | POST /offers |
200 | LIVE only: this would go over one of your organisation's spending limits (for one listing, a day or a month, the organisation's or the API key owner's own). Nothing was created or charged. limit gives applies_to (organisation or person), period (listing, day or month), amount, spent, price, currency, resets_at (UTC, null for one listing) and time_zone. An Org Admin sets limits in the Ad Portal under Settings. A dry run returns the same. |
POST /events |
200 | LIVE only: this would go over one of your organisation's spending limits (for one listing, a day or a month, the organisation's or the API key owner's own). Nothing was created or charged. limit gives applies_to (organisation or person), period (listing, day or month), amount, spent, price, currency, resets_at (UTC, null for one listing) and time_zone. An Org Admin sets limits in the Ad Portal under Settings. A dry run returns the same. |