Rank the events to put a contract on
Every event that fired in the window, plus every event wired to an ad platform, ranked by tier: optimized (delivered to Meta, Google Ads, GA4, or OpenAI Ads as a conversion), mapped (wired and firing, nothing delivered), conversion_name (named like a conversion, not sent anywhere), sent (upper-funnel signal), not_firing (wired as a conversion, never fired), other. Within a tier, by deliveries then volume.
Mythic does not read campaign optimization goals, so optimized means what Mythic sends as a conversion, not what each campaign bids on. Internal $-prefixed events that no ad platform receives are hidden unless include_internal=1.
curl -X GET "https://mythic-analytics.gulp.workers.dev/client/v1/contracts/candidates?location_id=example_string&days=30&include_internal=0&limit=200&goals=0" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/contracts/candidates?location_id=example_string&days=30&include_internal=0&limit=200&goals=0"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/contracts/candidates?location_id=example_string&days=30&include_internal=0&limit=200&goals=0", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://mythic-analytics.gulp.workers.dev/client/v1/contracts/candidates?location_id=example_string&days=30&include_internal=0&limit=200&goals=0", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/contracts/candidates?location_id=example_string&days=30&include_internal=0&limit=200&goals=0')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"window": {
"days": 30,
"date_from": "2026-09-19"
},
"meta_goals": {
"available": true,
"reason": "example_string",
"source": "managed",
"ad_sets_synced": true,
"goals": [
{
"platform": "meta_ads",
"meta_event": "Purchase",
"kind": "standard",
"spend": 3210.5,
"currency": "USD",
"ad_sets": 4,
"campaigns": 2,
"pixel_ids": [
"example_string"
]
}
],
"unmatched": [
{
"platform": "meta_ads",
"meta_event": "Purchase",
"kind": "standard",
"spend": 3210.5,
"currency": "USD",
"ad_sets": 4,
"campaigns": 2,
"pixel_ids": [
"example_string"
]
}
],
"other_goals": [
{
"optimization_goal": "LINK_CLICKS",
"spend": 3.14
}
]
},
"deliveries_available": true,
"summary": {
"candidates": 14,
"by_tier": {
"optimized": 2,
"mapped": 0,
"conversion_name": 1,
"sent": 1,
"not_firing": 1,
"other": 9
},
"optimized_without_contract": [
"purchase"
]
},
"candidates": [
{
"event": "purchase",
"tier": "campaign_goal",
"has_contract": false,
"total_events": 1240,
"unique_users": 1180,
"delivered": 2470,
"reason": "Sent as a conversion to Meta as Purchase 1,240 times, Google Ads (conversion action 987654) 1,230 times.",
"campaign_goals": [
{
"platform": "meta_ads",
"meta_event": "Purchase",
"kind": "standard",
"spend": 3210.5,
"currency": "USD",
"ad_sets": 4,
"campaigns": 2,
"pixel_ids": [
"example_string"
]
}
],
"destinations": [
{
"source": "server",
"destination_type": "meta_capi",
"platform": "Meta",
"action_id": "example_string",
"name": "John Doe",
"target": "Purchase",
"conversion": true,
"enabled": true,
"delivered": 42,
"failed_attempts": 42,
"last_delivered_at": "2026-10-19 10:00:00.000"
}
]
}
],
"truncated": false,
"note": "example_string"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
/client/v1/contracts/candidates
Target server for requests. Edit to use your own host.
Agency key (ak_) or location secret key (sk_). Scoped keys (mcp_) are accepted too and need contracts:read or contracts:write. See Using an mcp_ key over HTTP.
ak_) or location secret key (sk_). Scoped keys (mcp_) are accepted too and need contracts:read or contracts:write. See Using an mcp_ key over HTTP.Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.
Window in days.
Set to 1 to keep $-prefixed SDK events that are not sent to an ad platform.
Set to 0 to skip reading the Meta ad set optimization goals.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Agency key (ak_) or location secret key (sk_). Scoped keys (mcp_) are accepted too and need contracts:read or contracts:write. See Using an mcp_ key over HTTP.
Query Parameters
Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.
Window in days.
Set to 1 to keep $-prefixed SDK events that are not sent to an ad platform.
01