# Deferred test mode: claim a test tap

> Deferred test mode: claim a test tap (debug builds).

Source: https://straitlink.in/docs/api/match-test-mode/

`POST /v1/test-mode/match`

Auth: publishable key as publishableKey in the JSON body. Safe in apps and websites.

Lets a debug build prove a deferred link without reinstalling. The SDK sends its debug device id; if a workspace writer opened a 15-minute test window in the dashboard and tapped a link, the answer carries that link (`matchMethod: test`, `test: true`). Never touches production matching. Only mounted when the engine runs with TEST_MODE=on (otherwise 404). Publishable key, current key only.

| Field | Type | Notes |
|---|---|---|
| `publishableKey` (required) | `string` |  |
| `deviceId` (required) | `string` | The SDK debug device id |
| `platform` | `string` |  |

```bash
curl -X POST https://strait.link/v1/test-mode/match \
  -H "Content-Type: application/json" \
  -d '{
    "publishableKey": "st_pub_live_…",
    "deviceId": "dbg_3f9a2c7e",
    "platform": "android"
  }'
```

Response 200:

```json
{
  "matched": true,
  "longUrl": "https://shop.example.com/sale/summer",
  "linkId": "lnk_…",
  "clickId": "c_…",
  "matchMethod": "test",
  "reasons": [
    "test_mode"
  ],
  "test": true
}
```

- `200`: Matched (`longUrl`, `linkId`, `clickId`) or not (`matched: false` with a `reason`)
- `400`: deviceId missing or malformed
- `401`: Missing, invalid or rotated publishable key
- `404`: Test mode is off on this engine
- `429`: Rate limited (per IP)
