The full flow from placements and quotes to a live ad.
The booking flow
| Step | Tool | What happens |
|---|---|---|
| 1 | get_account | Confirms the account, access and limits |
| 2 | list_placements | Lists pages that sell ads with formats, prices, discounts and traffic |
| 3 | check_availability, get_quote | Checks the dates and the exact price, coupon included |
| 4 | upload_image, import_media, create_upload_link | Stores the image or video and returns a key |
| 5 | create_ad | Creates the ad and holds its dates for 30 minutes |
| 6 | checkout_ad | Returns the payment link for the owner |
| 7 | None | The owner pays and the Drefly team reviews the ad |
| 8 | get_ad, get_report | Tracks status and results |
Get a quote
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_quote", "arguments": {"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10", "format": "image", "days": 7, "start_date": "2026-12-01"}}}' result = await session.call_tool(
"get_quote",
{
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "image",
"days": 7,
"start_date": "2026-12-01"
},
)
print(result.structuredContent)const result = await client.callTool({
name: "get_quote",
arguments: {
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "image",
"days": 7,
"start_date": "2026-12-01"
},
});
console.log(result.structuredContent);Create the ad
curl https://ads.drefly.pro/api/ads/mcp \
-H "Authorization: Bearer $DREFLY_ADS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "create_ad", "arguments": {"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10", "format": "image", "days": 7, "start_date": "2026-12-01", "coupon": "WELCOME10", "creative": {"headline": "Record and cut in one app", "body": "Free for your first project.", "cta_label": "Try Nova", "destination_url": "https://nova.example/drefly", "image_key": "sponsor/users/4b1d.../9c1e.webp"}}}}' result = await session.call_tool(
"create_ad",
{
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "image",
"days": 7,
"start_date": "2026-12-01",
"coupon": "WELCOME10",
"creative": {
"headline": "Record and cut in one app",
"body": "Free for your first project.",
"cta_label": "Try Nova",
"destination_url": "https://nova.example/drefly",
"image_key": "sponsor/users/4b1d.../9c1e.webp"
}
},
)
print(result.structuredContent)const result = await client.callTool({
name: "create_ad",
arguments: {
"page_id": "7f6c1a52-0d1e-4c63-9a7e-2f1d3b8c9e10",
"format": "image",
"days": 7,
"start_date": "2026-12-01",
"coupon": "WELCOME10",
"creative": {
"headline": "Record and cut in one app",
"body": "Free for your first project.",
"cta_label": "Try Nova",
"destination_url": "https://nova.example/drefly",
"image_key": "sponsor/users/4b1d.../9c1e.webp"
}
},
});
console.log(result.structuredContent);{
"booking": {
"id": "3d2b9f0e-6a1c-4e55-8f0b-1c2d3e4f5a6b",
"ref": "DA-10421",
"status": "pending_payment",
"start_date": "2026-12-01",
"end_date": "2026-12-08",
"total_cents": 1575,
"currency": "USD"
},
"pay_url": "https://ads.drefly.pro/#ads/3d2b9f0e-...",
"next": "Call checkout_ad for the payment link, or pay in the Drefly Ads portal: https://ads.drefly.pro/#ads/3d2b9f0e-..."
}Creative fields
| Field | Required | Rules |
|---|---|---|
headline | Yes | Up to 90 characters |
destination_url | Yes | Full https link |
body | No | Up to 200 characters |
cta_label | No | Up to 24 characters |
image_key | Image ads | Key from upload_image or import_media |
video_key | Video ads | Key from an uploaded video |
poster_key | No | Poster image for video ads |
Ads can start from tomorrow and run 1 to 365 days. The word Drefly and lookalike spellings aren't allowed in ad text or link domains.
Change or cancel
While the ad is unpaid, update_ad changes the plan and creative and cancel_ad frees the dates. edit_ad_creative changes the creative while the ad is unpaid or in review. Agents can only change ads that the same connection created.
Next steps
Was this page helpful?
Thanks for the feedback. Tell us what was missing