Links API
Create, read, update, and delete tracked links programmatically.
Endpoints
GET /api/links - List all links
GET /api/links/:id - Get a single link
POST /api/links - Create a link
PATCH /api/links/:id - Update a link
DELETE /api/links/:id - Delete a link
Link Object
{
"id": "abc123-def456",
"user_id": "user-uuid",
"slug": "my-link",
"name": "My Marketing Link",
"destination": "https://example.com/landing",
"is_active": true,
"created_at": "2025-12-17T10:00:00Z",
"updated_at": "2025-12-17T10:00:00Z",
"total_clicks": 150,
"unique_clicks": 120
}List All Links
GET https://api.gettrack.link/api/links
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| start_date | string | Filter analytics from this date (ISO 8601) |
| end_date | string | Filter analytics to this date (ISO 8601) |
Example Request
curl "https://api.gettrack.link/api/links?start_date=2025-12-01&end_date=2025-12-31" \ -H "Authorization: Bearer YOUR_TOKEN"
Response
{
"links": [
{
"id": "abc123",
"slug": "my-link",
"name": "My Link",
"destination": "https://example.com",
"is_active": true,
"total_clicks": 150,
"unique_clicks": 120,
"created_at": "2025-12-01T00:00:00Z"
}
]
}Create a Link
POST https://api.gettrack.link/api/links
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Display name for the link |
| destination | string | Yes | URL to redirect to |
| slug | string | No | Custom slug (auto-generated if not provided) |
Example Request
curl -X POST "https://api.gettrack.link/api/links" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring Sale Campaign",
"destination": "https://example.com/spring-sale",
"slug": "spring-sale"
}'Update a Link
PATCH https://api.gettrack.link/api/links/:id
Request Body
All fields are optional. Only include fields you want to update.
{
"name": "Updated Name",
"destination": "https://new-url.com",
"slug": "new-slug",
"is_active": false
}Delete a Link
DELETE https://api.gettrack.link/api/links/:id
Example Request
curl -X DELETE "https://api.gettrack.link/api/links/abc123" \ -H "Authorization: Bearer YOUR_TOKEN"
Deleting a link also removes all associated click data.
Rate Limits
| Plan | Rate Limit |
|---|---|
| Free | 100 requests/minute |
| Pro | 1000 requests/minute |