Overview
The Links API allows you to manage shortened Spotify links. All write operations (create, update, delete) require authentication unless using Turnstile for anonymous link creation.Base URL
List Links
Retrieve paginated list of links owned by the authenticated user.Query Parameters
Page number for pagination
Number of items per page (max: 50)
Response
Array of link objects
Current page number
Items per page
Total number of pages
Total number of links
Example Response
Error Responses
Authentication required - missing or invalid auth token
Create Link
Create a new shortened link. Requires authentication OR a valid Turnstile token.Request Body
Original Spotify URL to shorten (must be a valid URL)
Custom slug for the short link. If not provided, a random slug will be generated (4-8 characters, alphanumeric).Constraints:
- Must be unique
- Cannot be a reserved word (e.g., “api”, “admin”, “dash”)
- Alphanumeric characters only
Subdomain to use for the short link
Cloudflare Turnstile token (required if not authenticated)
Response
Returns the created link object with status code201 Created.
Error Responses
Bad request - missing
from parameter or invalid dataConflict - slug already taken
Service unavailable - maintenance mode active
Update Link
Update an existing link’s destination URL, slug, or subdomain. Requires authentication and ownership.URL Parameters
PocketBase record ID of the link to update
Request Body
All fields are optional - only include fields you want to update.New destination URL
New slug (must be unique)
New subdomain
Response
Returns the updated link object.Error Responses
Not authenticated
Forbidden - you don’t own this link
Link not found
Conflict - new slug already taken
Update failed
Delete Link
Delete a link. Requires authentication and ownership.URL Parameters
PocketBase record ID of the link to delete
Response
Returns status code204 No Content on success (empty body).
Error Responses
Authentication required
Not authorized to delete this link
Link not found
Server error during deletion
Bulk Delete Links
Delete multiple links in a single request. Maximum 5 links per request (free tier limit).Request Body
Array of record IDs to delete (max 5 items)
Response
Returns a summary of the deletion operation.Array of successfully deleted record IDs
Array of failed deletions with reasons
Error Responses
Authentication required
Invalid request - missing/invalid ids array or exceeds limit
Expand Spotify URL
Expand shortened Spotify URLs (spotify.link, spotify.app.link) to their final open.spotify.com destination.Request Body
Shortened Spotify URL to expand (must be from spotify.link or spotify.app.link)
Response
Final expanded URL (open.spotify.com)
Original URL that was provided
Whether expansion was performed (false if already a Spotify URL)
Error Responses
Invalid URL or unsupported domain
Failed to expand URL
Redirect Endpoint
Access a shortened link and redirect to the original URL.Endpoint
URL Parameters
Short link slug (e.g., “abc123”)
Behavior
Analytics Tracking
If not a bot, creates an analytics record with:
- User agent
- Country (from CF-IPCountry header)
- Timestamp
- Link ID
Response
HTTP 301 redirect to the original Spotify URL. Headers:Error Responses
Link not found
Bot Detection
The following user agents are detected as bots and will NOT trigger analytics or view count increments:- telegram
- bot, crawler, spider
- facebookexternalhit
- google-safety, google-firebase
- okhttp, axios, node-fetch
- python-requests
- And more…
Bot requests are logged but do not affect analytics to prevent inflated statistics.