Read the referral report
method
GET
host
strait.
version
/v1
resource
/
GET /v1/referrals
Auth: secret key as Authorization: Bearer. Server-side only.
Request
For each referral code in [from, to): the taps that carried it and the referred installs (an install that opened and matched a tap with that code, at most one per tap). A tap counts at its tap time, a referred install at its first open; days are UTC. Most conversions first. Secret key only (a publishable key gets 401). At most 92 days per call and 30 calls a minute per workspace (429 with Retry-After). Each new referred install also fires the referral.converted webhook.
Parameters
fromstring query- Inclusive start: ISO date (2026-10-01, UTC), ISO date-time or epoch ms. Default: 30 days before
to. tostring query- Exclusive end, same formats. Default: now.
Response
- 200 Totals plus one row per referral code
- 400 Bad from / to (or a range over 92 days)
- 401 Missing or invalid secret key, or a publishable key
- 404 Referrals are switched off on this engine (REFERRALS=off)
- 429 Over 30 calls a minute for this workspace
curl -X GET https://strait.link/v1/referrals \
-H "Authorization: Bearer $SECRET_KEY"const res = await fetch('https://strait.link/v1/referrals', {
headers: { Authorization: `Bearer ${process.env.SECRET_KEY}` },
});
const data = await res.json();
console.log(res.status, data);import os
import requests
res = requests.get(
"https://strait.link/v1/referrals",
headers={"Authorization": f"Bearer {os.environ['SECRET_KEY']}"},
)
print(res.status_code, res.json())<?php
// Plain PHP with ext-curl, no packages. In Laravel, Http::withToken($secretKey)->get($url) sends the same request.
$ch = curl_init('https://strait.link/v1/referrals');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SECRET_KEY'),
],
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL;
print_r(json_decode($response, true));import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
// Java 17+, java.net.http only (no dependencies).
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://strait.link/v1/referrals"))
.header("Authorization", "Bearer " + System.getenv("SECRET_KEY"))
.GET()
.build();
HttpResponse<String> res = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());
}
}package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest(http.MethodGet, "https://strait.link/v1/referrals", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SECRET_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(res.StatusCode, string(data))
}The response, printed
{
"from": "2026-10-01T00:00:00.000Z",
"to": "2026-11-01T00:00:00.000Z",
"timezone": "UTC",
"totals": {
"codes": 2,
"taps": 57,
"conversions": 14
},
"rows": [
{
"code": "ASHA42",
"taps": 41,
"conversions": 11,
"lastTapAt": "2026-10-30T18:12:00.000Z",
"lastConversionAt": "2026-10-30T18:20:00.000Z"
},
{
"code": "RAVI7",
"taps": 16,
"conversions": 3,
"lastTapAt": "2026-10-28T09:41:00.000Z",
"lastConversionAt": "2026-10-27T11:05:00.000Z"
}
]
}