Quickstart
Create your first link in under a minute.
- Copy your tokenFrom the API page.
- Save it on your serverAs
KEYSTORM_API_TOKEN. - Run the exampleThe response has the
urlto share.
import { randomUUID } from 'node:crypto';const response = await fetch('https://api.keystorm.xyz/v1/integrations/links', { method: 'POST', headers: { Authorization: `Bearer ${process.env.KEYSTORM_API_TOKEN}`, 'Content-Type': 'application/json', 'Idempotency-Key': randomUUID(), }, body: JSON.stringify({ title: 'Complete texture pack', destinationUrl: 'https://example.com/pack.zip', keysRequired: 3, campaignKey: 'instagram-bio', }),});if (!response.ok) throw new Error(`Request failed: ${response.status}`);const { data } = await response.json();console.log(data.url); // share this linkimport os, uuid, requestsresponse = requests.post( 'https://api.keystorm.xyz/v1/integrations/links', json={ 'title': 'Complete texture pack', 'destinationUrl': 'https://example.com/pack.zip', 'keysRequired': 3, 'campaignKey': 'instagram-bio', }, headers={'Authorization': f"Bearer {os.environ['KEYSTORM_API_TOKEN']}", 'Idempotency-Key': str(uuid.uuid4())}, timeout=15,)response.raise_for_status()print(response.json()['data']['url']) # share this linkcurl -s -X POST https://api.keystorm.xyz/v1/integrations/links \ -H "Authorization: Bearer $KEYSTORM_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{"title":"Complete texture pack","destinationUrl":"https://example.com/pack.zip","keysRequired":3,"campaignKey":"instagram-bio"}'The new link shows up in Links right away, with its own views, visitors and unlocks.