Record a conversion: an upgrade or an order in your product, with its value
# REPUTECAST_API_KEY: an API key (rc_live_…) with conversions:create.# Replace reputecast.example.com with your public URL and your-workspace with your workspace slug.# Add "click_token" with the rc_click value of the link the reader followed, when you have it.curl --request POST \ --url https://reputecast.example.com/api/v1/workspaces/your-workspace/conversions \ --header "Authorization: Bearer $REPUTECAST_API_KEY" \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-1042' \ --data '{ "name": "Upgraded to Team plan", "value": "29.00", "currency": "USD", "email": "sam.rivera@outlook.com", "metadata": { "order_id": "1042" } }'// REPUTECAST_API_KEY: an API key (rc_live_…) with conversions:create.// Replace reputecast.example.com with your public URL and your-workspace with your workspace slug.const response = await fetch('https://reputecast.example.com/api/v1/workspaces/your-workspace/conversions', { method: 'POST', headers: { Authorization: `Bearer ${process.env.REPUTECAST_API_KEY}`, 'Content-Type': 'application/json', // Sending the same key again answers with the first conversion instead of recording a second. 'Idempotency-Key': 'order-1042', }, body: JSON.stringify({ name: 'Upgraded to Team plan', value: '29.00', // a decimal string, not a number currency: 'USD', email: 'sam.rivera@outlook.com', // the email, the click token, or both // click_token: the rc_click value of the link the reader followed, when you have it metadata: { order_id: '1042' }, }),})const result = await response.json()if (!response.ok) throw new Error(`${response.status} ${result.code}: ${result.detail}`)// matched: click_token, email or none; credited: the campaign or automation email it counts for.console.log(result.id, result.matched, result.credited?.name)// REPUTECAST_API_KEY: an API key (rc_live_…) with conversions:create.// Replace reputecast.example.com with your public URL and your-workspace with your workspace slug.package main
import ( "bytes" "encoding/json" "fmt" "log" "net/http" "os")
func main() { body, err := json.Marshal(map[string]any{ "name": "Upgraded to Team plan", "value": "29.00", // a decimal string, not a number "currency": "USD", "email": "sam.rivera@outlook.com", // the email, the click token, or both "metadata": map[string]string{"order_id": "1042"}, // "click_token": the rc_click value of the link the reader followed, when you have it }) if err != nil { log.Fatal(err) } req, err := http.NewRequest(http.MethodPost, "https://reputecast.example.com/api/v1/workspaces/your-workspace/conversions", bytes.NewReader(body)) if err != nil { log.Fatal(err) } req.Header.Set("Authorization", "Bearer "+os.Getenv("REPUTECAST_API_KEY")) req.Header.Set("Content-Type", "application/json") // Sending the same key again answers with the first conversion instead of recording a second. req.Header.Set("Idempotency-Key", "order-1042")
resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close()
var result struct { ID string `json:"id"` Matched string `json:"matched"` // click_token, email or none Credited *struct { Kind string `json:"kind"` // campaign or automation Name string `json:"name"` } `json:"credited"` Code string `json:"code"` Detail string `json:"detail"` } if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { log.Fatal(err) } if resp.StatusCode >= 300 { log.Fatalf("%d %s: %s", resp.StatusCode, result.Code, result.Detail) } fmt.Println(result.ID, result.Matched) if result.Credited != nil { fmt.Println("Credited to", result.Credited.Kind, result.Credited.Name) }}# REPUTECAST_API_KEY: an API key (rc_live_…) with conversions:create.# Replace reputecast.example.com with your public URL and your-workspace with your workspace slug.import os
import requests
conversion = { "name": "Upgraded to Team plan", "value": "29.00", # a decimal string, not a number "currency": "USD", "email": "sam.rivera@outlook.com", # the email, the click token, or both "metadata": {"order_id": "1042"}, # "click_token": the rc_click value of the link the reader followed, when you have it}
response = requests.post( "https://reputecast.example.com/api/v1/workspaces/your-workspace/conversions", headers={ "Authorization": f"Bearer {os.environ['REPUTECAST_API_KEY']}", # Sending the same key again answers with the first conversion instead of recording a second. "Idempotency-Key": "order-1042", }, json=conversion, timeout=10,)result = response.json()if not response.ok: raise RuntimeError(f"{response.status_code} {result.get('code')}: {result.get('detail')}")# matched: click_token, email or none; credited: the campaign or automation email it counts for.print(result["id"], result["matched"], (result.get("credited") or {}).get("name"))<?php// REPUTECAST_API_KEY: an API key (rc_live_…) with conversions:create.// Replace reputecast.example.com with your public URL and your-workspace with your workspace slug.$payload = [ 'name' => 'Upgraded to Team plan', 'value' => '29.00', // a decimal string, not a number 'currency' => 'USD', 'email' => 'sam.rivera@outlook.com', // the email, the click token, or both 'metadata' => ['order_id' => '1042'], // 'click_token' => the rc_click value of the link the reader followed, when you have it];
$ch = curl_init('https://reputecast.example.com/api/v1/workspaces/your-workspace/conversions');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('REPUTECAST_API_KEY'), 'Content-Type: application/json', // Sending the same key again answers with the first conversion instead of recording a second. 'Idempotency-Key: order-1042', ], CURLOPT_POSTFIELDS => json_encode($payload, JSON_THROW_ON_ERROR),]);$body = curl_exec($ch);if ($body === false) { throw new RuntimeException(curl_error($ch));}$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);$result = json_decode($body, true, flags: JSON_THROW_ON_ERROR);if ($status >= 300) { throw new RuntimeException("{$status} {$result['code']}: {$result['detail']}");}// matched: click_token, email or none; credited: the campaign or automation email it counts for.echo $result['id'], ' ', $result['matched'], ' ', $result['credited']['name'] ?? '', PHP_EOL;Permission: conversions:create
Credits the conversion to the last campaign or automation email the reader clicked within the attribution window: by click token (rc_click), else by email address. Answers 202 with how it was matched. Errors: missing_identity, invalid_value, invalid_currency, occurred_at_out_of_range (422), idempotency_key_reused (409), rate_limited (429, with Retry-After). Conversions are logged in Earn › Settings › Attribution, not in the audit log.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace slug
Workspace slug
Header Parameters
Section titled “Header Parameters”Sending the same key again answers with the first conversion instead of recording a second
Sending the same key again answers with the first conversion instead of recording a second
Request Bodyrequired
Section titled “Request Bodyrequired”object
The rc_click token from the link the reader followed, if present
ISO 4217: USD, EUR, GBP…
The reader’s address; send it, the click token, or both
Your own fields, kept with the conversion
object
What happened: “Upgraded to Team plan”
When it happened (now when absent): up to 30 days back
A decimal string: “29.00”, not 29
Example generated
{ "click_token": "example", "currency": "example", "email": "example", "metadata": { "additionalProperty": "example" }, "name": "example", "occurred_at": "2026-04-15T12:00:00Z", "value": "example"}Responses
Section titled “Responses”Accepted
object
object
Example
{ "credited": { "kind": "campaign" }, "matched": "click_token"}default
Section titled “default”Error
object
Stable error code, e.g. permission_denied
A human-readable explanation specific to this occurrence of the problem.
Optional list of individual error details
object
Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’
Error message text
The value at the given location
Members who hold the missing permission
A URI reference that identifies the specific occurrence of the problem.
object
The missing permission key
HTTP status code
A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
A URI reference to human-readable documentation for the error.
Example
{ "detail": "Property foo is required but is missing.", "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "about:blank"}