API Reference
The Nayalink REST API — create short links, manage campaigns and tags, and pull privacy-first click analytics. Base URL https://api.nayalink.co.
Nayalink exposes a fully typed REST API. Everything you can do in the dashboard — create short links, manage campaigns and tags, and read privacy-first click analytics — is available programmatically.
For an interactive reference where you can try requests in the browser, open the interactive API reference. The machine-readable contract is the OpenAPI document.
Base URL
All endpoints are served from https://api.nayalink.co.
Authentication
Authenticate with an API key sent as a Bearer token:
Authorization: Bearer <your-api-key>
API keys are available on the Pro and Business plans and can be scoped to specific permissions. Manage them in Settings → API tokens.
Create a short link
Only original_url is required:
curl -X POST https://api.nayalink.co/api/v1/links \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{"original_url": "https://example.com/very/long/url"}'
The response contains the generated short code and the full short URL.
Resources
- Links — create, update, and manage short links: custom codes, expiration, password protection, and routing rules.
- Campaigns — group links into campaigns and roll analytics up across them.
- Tags — organise links with color-coded tags.
- Analytics — read aggregate, privacy-first click analytics: visits over time, countries, cities, referrers, browsers, operating systems, device types, languages, and UTM parameters. No IP addresses are stored.
- API tokens — create and revoke scoped API keys.
- Profile — read and update the authenticated account.
Next steps
- Try requests interactively in the API reference.
- New to Nayalink? Start with the introduction.