Where a short link goes, without recording anything
Where a short link goes, without recording anything (user opted out).
method
POST
host
strait.
version
/v1
resource
/
POST /v1/lookup
Auth: publishable key as publishableKey in the JSON body. Safe in apps and websites.
Request
Called by the Strait SDKs instead of /v1/resolve when the app's user has opted out (setEnabled(false)), so a short link that opens the app still lands on the right screen. Same lookup as /v1/resolve (scoped to the key's workspace, old Firebase host + code first), but nothing is recorded: no tap, no app open, no counter, no webhook, and no clickId comes back. Only publishableKey and url are read, and Strait's code writes no IP address or user agent for this call (our hosting providers keep their usual short-lived request logs). An A/B link answers one variant at random. Rate limited per IP.
Body (JSON)
publishableKeyrequired stringurlrequired string
Response
- 200 { matched, longUrl?, linkId?, slug?, reason? } — reason: not_found | link_unavailable (blocked for abuse or an unsafe destination) | expired | not_live (scheduled, before go-live) | password_protected | long_link (an old page.link long link: read its link= in the app).
- 400 url is not a short link
- 401 Missing or invalid key
- 429 Too many lookups from this IP; try again shortly
curl -X POST https://strait.link/v1/lookup \
-H "Content-Type: application/json" \
-d '{
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer"
}'const res = await fetch('https://strait.link/v1/lookup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer"
}),
});
const data = await res.json();
console.log(res.status, data);import requests
res = requests.post(
"https://strait.link/v1/lookup",
json={
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer",
},
)
print(res.status_code, res.json())<?php
// Plain PHP with ext-curl, no packages. In Laravel, Http::post($url, $body) sends the same request.
$ch = curl_init('https://strait.link/v1/lookup');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'publishableKey' => 'st_pub_live_…',
'url' => 'https://hilltop.strait.link/summer',
], JSON_THROW_ON_ERROR),
]);
$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 {
String body = """
{
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer"
}
""";
HttpRequest request = HttpRequest.newBuilder(URI.create("https://strait.link/v1/lookup"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.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"
"strings"
)
func main() {
body := strings.NewReader(`{
"publishableKey": "st_pub_live_…",
"url": "https://hilltop.strait.link/summer"
}`)
req, err := http.NewRequest(http.MethodPost, "https://strait.link/v1/lookup", body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
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
{
"matched": true,
"longUrl": "https://shop.example.com/sale/summer?utm_source=whatsapp&utm_campaign=summer-2026",
"linkId": "lnk_5f0c2a8e-3b1d-4f6a-9c7e-2d8b1a0e4f63",
"slug": "summer"
}