Links Endpoints
Complete reference for managing short links in TinyRebrand.
The Links API allows you to create, read, update, and delete short links. All endpoints require authentication and appropriate scopes.
Available Endpoints
Complete CRUD operations for managing your short links:
Endpoint | Method | Purpose | Required Scope |
---|---|---|---|
/user/link | GET | List user's links | links:read |
/user/link/{id} | GET | Get specific link | links:read |
/user/link | POST | Create new link | links:write |
/user/link/{id} | PUT | Update existing link | links:write |
/user/link/{id} | DELETE | Delete link | links:write |
GET /user/link
GET /user/link
List user's links with pagination and filtering.
Required Scope: links:read
Request:
curl -X GET "https://api.tinyrebrand.com/api/user/link?q=analytics&start=0&limit=10" \
-H "Authorization: Bearer at_1234567890abcdef"
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
q | string | ❌ | Search query |
start | integer | ❌ | Offset for pagination |
limit | integer | ❌ | Number of results to return |
Response:
{
"status": 200,
"code": "OK",
"message": "Links fetched successfully",
"data": [
{
"id": "507f1f77bcf86cd799439013",
"title": "Analytics Dashboard",
"slug": "analytics",
"url": "https://mysite.com/analytics",
"status": true,
"createdAt": "2024-01-15T10:30:00.000Z",
"clicks": 156
}
],
"meta": {
"total": 1,
"start": 0,
"limit": 10
}
}
GET /user/link/{id}
GET /user/link/{id}
Get specific link details.
Required Scope: links:read
Request:
curl -X GET https://api.tinyrebrand.com/api/user/link/507f1f77bcf86cd799439013 \
-H "Authorization: Bearer at_1234567890abcdef"
Response:
{
"status": 200,
"code": "OK",
"message": "Link fetched successfully",
"data": {
"id": "507f1f77bcf86cd799439013",
"title": "Analytics Dashboard",
"slug": "analytics",
"url": "https://mysite.com/analytics",
"description": "Main analytics page",
"status": true,
"domainId": "507f1f77bcf86cd799439014",
"hasPassword": false,
"createdAt": "2024-01-15T10:30:00.000Z",
"clicks": 156
}
}
POST /user/link
POST /user/link
Create a new link.
Required Scope: links:write
Request:
curl -X POST https://api.tinyrebrand.com/api/user/link \
-H "Authorization: Bearer at_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"status": true,
"title": "My Product Page",
"slug": "product",
"url": "https://mysite.com/product",
"description": "Main product landing page",
"domainId": "507f1f77bcf86cd799439014",
"hasPassword": false
}'
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
status | boolean | ✅ | Link active status |
title | string | ✅ | Link title |
slug | string | ✅ | URL slug |
url | string | ✅ | Destination URL |
description | string | ❌ | Link description |
domainId | string | ✅ | Domain ID |
hasPassword | boolean | ❌ | Password protection |
Response:
{
"status": 200,
"code": "OK",
"message": "Link created successfully",
"data": {
"id": "507f1f77bcf86cd799439015",
"title": "My Product Page",
"slug": "product",
"url": "https://mysite.com/product",
"description": "Main product landing page",
"status": true,
"domainId": "507f1f77bcf86cd799439014",
"hasPassword": false,
"createdAt": "2024-07-02T15:00:00.000Z"
}
}
PUT /user/link/{id}
PUT /user/link/{id}
Update existing link properties.
Required Scope: links:write
Request:
curl -X PUT https://api.tinyrebrand.com/api/user/link/507f1f77bcf86cd799439015 \
-H "Authorization: Bearer at_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Title",
"url": "https://newurl.com"
}'
Parameters:
Parameter | Type | Required | Description |
---|---|---|---|
title | string | ❌ | Link title |
url | string | ❌ | Destination URL |
description | string | ❌ | Link description |
status | boolean | ❌ | Link active status |
Response:
{
"status": 200,
"code": "OK",
"message": "Link updated successfully",
"data": {
"id": "507f1f77bcf86cd799439015",
"title": "Updated Title",
"slug": "product",
"url": "https://newurl.com",
"updatedAt": "2024-07-02T15:00:00.000Z"
}
}
DELETE /user/link/{id}
DELETE /user/link/{id}
Permanently delete a link.
Required Scope: links:write
Request:
curl -X DELETE https://api.tinyrebrand.com/api/user/link/507f1f77bcf86cd799439015 \
-H "Authorization: Bearer at_1234567890abcdef"
Response:
{
"status": 200,
"code": "OK",
"message": "Link deleted successfully",
"data": {
"deletedAt": "2024-07-02T15:00:00.000Z"
}
}