Export everything

THE CALL, PART BY PART

method

GET

host

strait.link

version

/v1

resource

/export

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

part required "links" | "taps" | "events" | "installs" | "webhooks" | "worker" query
What to export: links (NDJSON), taps (CSV), events (CSV), installs (CSV), webhooks (JSON) or worker (JavaScript). Optional with token (the token carries it).
from string query
taps / events / installs: inclusive start, ISO date or epoch ms
to string query
taps / events / installs: exclusive end, ISO date or epoch ms
token string 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
Request · curl
curl -X GET "https://strait.link/v1/export?part=links" \
  -H "Authorization: Bearer $SECRET_KEY"

The response, printed

Response 200, part=links (application/x-ndjson)
{"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}
Response 200, part=taps (text/csv)
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_core
Response 200, part=events (text/csv)
created_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,
Response 200, part=installs (text/csv)
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,,
Response 200, part=webhooks (application/json)
{
  "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"
    }
  ]
}
Response 200, part=worker (application/javascript)
// 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
  }
};