Export everything
method
GET
host
strait.
version
/v1
resource
/
GET /v1/export
Auth: secret key as Authorization: Bearer. Server-side only.
Request
Everything your workspace needs to leave Strait, streamed as a download. Auth: a secret key (a publishable key gets 401), or token from POST /v1/export/token (one use, 60 seconds; this is how the dashboard downloads). part=links: NDJSON, one link per line (active and inactive). part=taps: CSV of every tap joined to its first app open and install, oldest first, no date cap. part=events: CSV of every conversion / revenue event, oldest first; channel, campaign and variant come from the tap the event is attributed to (when it has a click_id). part=installs: CSV of every install, matched or organic, oldest first, with the Google Play install referrer campaign the Android SDK sent (referrer_utm_*), so installs from campaigns that never used a Strait link still say where they came from. part=webhooks: JSON of your webhook configuration (url, events, active, createdAt) — signing secrets are never exported. part=worker: a single-file Cloudflare Worker (export default { fetch }) that keeps your active links redirecting by device (Android / iPhone-iPad / desktop) without Strait.
Parameters
partrequired "links" | "taps" | "events" | "installs" | "webhooks" | "worker" query- What to export:
links(NDJSON),taps(CSV),events(CSV),installs(CSV),webhooks(JSON) orworker(JavaScript). Optional withtoken(the token carries it). fromstring query- taps / events / installs: inclusive start, ISO date or epoch ms
tostring query- taps / events / installs: exclusive end, ISO date or epoch ms
tokenstring query- A one-time download token from POST /v1/export/token, instead of the Authorization header
Response
- 200 The export, as a download (Content-Disposition: attachment)
- 400 Unknown part, a bad from / to, or a token issued for another part
- 401 Missing or invalid secret key, or an expired / used token
curl -X GET "https://strait.link/v1/export?part=links" \
-H "Authorization: Bearer $SECRET_KEY"const res = await fetch('https://strait.link/v1/export?part=links', {
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/export?part=links",
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/export?part=links');
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/export?part=links"))
.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/export?part=links", 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
{"id":"lnk_123","slug":"summer","longUrl":"https://shop.example.com/product/42","iosFallbackUrl":null,"androidFallbackUrl":null,"desktopUrl":null,"title":"Summer sale","description":null,"imageUrl":null,"campaign":"summer-2026","tags":["spring"],"variants":null,"expiresAt":null,"active":true}
{"id":"lnk_124","slug":"winter","longUrl":"https://shop.example.com/product/7","iosFallbackUrl":null,"androidFallbackUrl":null,"desktopUrl":"https://shop.example.com/winter","title":"Winter sale","description":null,"imageUrl":null,"campaign":null,"tags":[],"variants":null,"expiresAt":"2026-01-31T00:00:00.000Z","active":false}click_id,clicked_at,link_id,slug,source,platform,device_class,os_major,in_app_browser,channel,sent_to,campaign,variant,billable,opened_at,open_kind,open_route,app_state,is_new_user,opens,installed_at,install_matched,match_method
c_123,2026-01-01T09:30:00.000Z,lnk_123,summer,web,ios,phone,18,whatsapp,whatsapp,app_store_page,summer-2026,,true,2026-01-01T09:32:10.000Z,deferred,/product/42,closed,true,1,2026-01-01T09:31:40.000Z,true,exact_corecreated_at,name,value,currency,platform,link_id,slug,click_id,channel,campaign,variant
2026-01-01T09:40:00.000Z,purchase,49.99,USD,ios,lnk_123,summer,c_123,whatsapp,summer-2026,installed_at,open_id,platform,matched,match_method,link_id,slug,click_id,app_version,sdk_version,referrer_utm_source,referrer_utm_medium,referrer_utm_campaign,referrer_utm_term,referrer_utm_content
2026-01-01T09:31:40.000Z,o_123,android,true,install_referrer,lnk_123,summer,c_123,2.4.0,android/0.10.3,google,cpc,diwali,,{
"exportedAt": "2026-01-01T00:00:00.000Z",
"note": "Signing secrets are not exported. Create new ones when you recreate these webhooks.",
"webhooks": [
{
"id": "7f3e2c1a-9b4d-4e8f-a6c5-2d1b0e9f8a73",
"url": "https://api.example.com/strait-webhook",
"events": [
"install.matched",
"app.opened"
],
"active": true,
"createdAt": "2026-01-01T00:00:00.000Z"
}
]
}// Keeps your short links redirecting on your own Cloudflare account.
// (generated header and setup notes trimmed)
const LINKS = {
"summer": {
"android": "https://shop.example.com/product/42",
"ios": "https://shop.example.com/product/42",
"desktop": "https://shop.example.com/product/42"
}
};
const ASSET_LINKS = null;
const AASA = null;
export default {
async fetch(request) {
// Android -> android, iPhone/iPad -> ios, everything else -> desktop
}
};