Report a won deal for revenue attribution
Report a won deal. Mailr resolves the deal’s address back to the campaign that mailed it (geo-first, last-touch, 180-day window, org-scoped) and upserts an idempotent conversion. Unmatched deals are discarded. The address is also recorded as an existing customer regardless of whether revenue attributes.
curl --request POST \
--url https://app.getmailr.com/api/v1/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "3134 River Valley Dr, Austin, TX 78701",
"deal_id": "deal-9931",
"deal_amount": "6400.00",
"deal_stage": "closed_won",
"deal_name": "Reyes roof replacement",
"contact_first_name": "Dana",
"contact_last_name": "Reyes",
"contact_email": "dana.reyes@example.com",
"deal_date": "2026-08-19"
}
'import requests
url = "https://app.getmailr.com/api/v1/conversions"
payload = {
"address": "3134 River Valley Dr, Austin, TX 78701",
"deal_id": "deal-9931",
"deal_amount": "6400.00",
"deal_stage": "closed_won",
"deal_name": "Reyes roof replacement",
"contact_first_name": "Dana",
"contact_last_name": "Reyes",
"contact_email": "dana.reyes@example.com",
"deal_date": "2026-08-19"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: '3134 River Valley Dr, Austin, TX 78701',
deal_id: 'deal-9931',
deal_amount: '6400.00',
deal_stage: 'closed_won',
deal_name: 'Reyes roof replacement',
contact_first_name: 'Dana',
contact_last_name: 'Reyes',
contact_email: 'dana.reyes@example.com',
deal_date: '2026-08-19'
})
};
fetch('https://app.getmailr.com/api/v1/conversions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getmailr.com/api/v1/conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '3134 River Valley Dr, Austin, TX 78701',
'deal_id' => 'deal-9931',
'deal_amount' => '6400.00',
'deal_stage' => 'closed_won',
'deal_name' => 'Reyes roof replacement',
'contact_first_name' => 'Dana',
'contact_last_name' => 'Reyes',
'contact_email' => 'dana.reyes@example.com',
'deal_date' => '2026-08-19'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.getmailr.com/api/v1/conversions"
payload := strings.NewReader("{\n \"address\": \"3134 River Valley Dr, Austin, TX 78701\",\n \"deal_id\": \"deal-9931\",\n \"deal_amount\": \"6400.00\",\n \"deal_stage\": \"closed_won\",\n \"deal_name\": \"Reyes roof replacement\",\n \"contact_first_name\": \"Dana\",\n \"contact_last_name\": \"Reyes\",\n \"contact_email\": \"dana.reyes@example.com\",\n \"deal_date\": \"2026-08-19\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.getmailr.com/api/v1/conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"3134 River Valley Dr, Austin, TX 78701\",\n \"deal_id\": \"deal-9931\",\n \"deal_amount\": \"6400.00\",\n \"deal_stage\": \"closed_won\",\n \"deal_name\": \"Reyes roof replacement\",\n \"contact_first_name\": \"Dana\",\n \"contact_last_name\": \"Reyes\",\n \"contact_email\": \"dana.reyes@example.com\",\n \"deal_date\": \"2026-08-19\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getmailr.com/api/v1/conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"3134 River Valley Dr, Austin, TX 78701\",\n \"deal_id\": \"deal-9931\",\n \"deal_amount\": \"6400.00\",\n \"deal_stage\": \"closed_won\",\n \"deal_name\": \"Reyes roof replacement\",\n \"contact_first_name\": \"Dana\",\n \"contact_last_name\": \"Reyes\",\n \"contact_email\": \"dana.reyes@example.com\",\n \"deal_date\": \"2026-08-19\"\n}"
response = http.request(request)
puts response.read_body{
"matched": true,
"attribution_type": "direct",
"campaign_id": "aa11bb22-0000-0000-0000-0000000000cc",
"match_method": "geo",
"match_confidence": "high",
"conversion_id": "d4e5f6a7-0000-0000-0000-000000000030"
}Authorizations
Organization-scoped Mailr API key. Header: Authorization: Bearer ak_….
Body
Fields may also be nested under a properties object (HubSpot/Zapier mappings are tolerated).
Deal value. Accepts a number or a numeric string.
Optional Mailr campaign id for exact, address-independent attribution.
Close date (ISO-8601). Drives last-touch attribution.
Response
Match result. Unmatched is { "matched": false }. A match returns the
attributed campaign, method and confidence.
- Option 1
- Option 2
curl --request POST \
--url https://app.getmailr.com/api/v1/conversions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"address": "3134 River Valley Dr, Austin, TX 78701",
"deal_id": "deal-9931",
"deal_amount": "6400.00",
"deal_stage": "closed_won",
"deal_name": "Reyes roof replacement",
"contact_first_name": "Dana",
"contact_last_name": "Reyes",
"contact_email": "dana.reyes@example.com",
"deal_date": "2026-08-19"
}
'import requests
url = "https://app.getmailr.com/api/v1/conversions"
payload = {
"address": "3134 River Valley Dr, Austin, TX 78701",
"deal_id": "deal-9931",
"deal_amount": "6400.00",
"deal_stage": "closed_won",
"deal_name": "Reyes roof replacement",
"contact_first_name": "Dana",
"contact_last_name": "Reyes",
"contact_email": "dana.reyes@example.com",
"deal_date": "2026-08-19"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
address: '3134 River Valley Dr, Austin, TX 78701',
deal_id: 'deal-9931',
deal_amount: '6400.00',
deal_stage: 'closed_won',
deal_name: 'Reyes roof replacement',
contact_first_name: 'Dana',
contact_last_name: 'Reyes',
contact_email: 'dana.reyes@example.com',
deal_date: '2026-08-19'
})
};
fetch('https://app.getmailr.com/api/v1/conversions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.getmailr.com/api/v1/conversions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '3134 River Valley Dr, Austin, TX 78701',
'deal_id' => 'deal-9931',
'deal_amount' => '6400.00',
'deal_stage' => 'closed_won',
'deal_name' => 'Reyes roof replacement',
'contact_first_name' => 'Dana',
'contact_last_name' => 'Reyes',
'contact_email' => 'dana.reyes@example.com',
'deal_date' => '2026-08-19'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.getmailr.com/api/v1/conversions"
payload := strings.NewReader("{\n \"address\": \"3134 River Valley Dr, Austin, TX 78701\",\n \"deal_id\": \"deal-9931\",\n \"deal_amount\": \"6400.00\",\n \"deal_stage\": \"closed_won\",\n \"deal_name\": \"Reyes roof replacement\",\n \"contact_first_name\": \"Dana\",\n \"contact_last_name\": \"Reyes\",\n \"contact_email\": \"dana.reyes@example.com\",\n \"deal_date\": \"2026-08-19\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.getmailr.com/api/v1/conversions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"3134 River Valley Dr, Austin, TX 78701\",\n \"deal_id\": \"deal-9931\",\n \"deal_amount\": \"6400.00\",\n \"deal_stage\": \"closed_won\",\n \"deal_name\": \"Reyes roof replacement\",\n \"contact_first_name\": \"Dana\",\n \"contact_last_name\": \"Reyes\",\n \"contact_email\": \"dana.reyes@example.com\",\n \"deal_date\": \"2026-08-19\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.getmailr.com/api/v1/conversions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"3134 River Valley Dr, Austin, TX 78701\",\n \"deal_id\": \"deal-9931\",\n \"deal_amount\": \"6400.00\",\n \"deal_stage\": \"closed_won\",\n \"deal_name\": \"Reyes roof replacement\",\n \"contact_first_name\": \"Dana\",\n \"contact_last_name\": \"Reyes\",\n \"contact_email\": \"dana.reyes@example.com\",\n \"deal_date\": \"2026-08-19\"\n}"
response = http.request(request)
puts response.read_body{
"matched": true,
"attribution_type": "direct",
"campaign_id": "aa11bb22-0000-0000-0000-0000000000cc",
"match_method": "geo",
"match_confidence": "high",
"conversion_id": "d4e5f6a7-0000-0000-0000-000000000030"
}