Appearance
Short Links
Introduction
The Short Links API allows you to manage your shortened URLs through a variety of endpoints. This set of endpoints is designed for creating, listing, viewing, updating, and deleting short links associated with your account. All operations within this section require authentication via an API token.
Using these endpoints, you can:
- List all your existing short links with pagination.
- Retrieve detailed information about any specific short link.
- Create new short links for your URLs.
- Update the destination URL and other parameters of any existing short link.
- Delete a short link when it’s no longer needed.
List Short Links
Description: Returns a paginated list of the authenticated user's short links.
- Method:
GET
- Endpoint:
/tools/short-links
- Query Parameters:
page
(integer, optional): Page number for pagination.
Example Request
http
GET /tools/short-links
Content-Type: application/json
Accept: application/json
Authorization: Bearer {API_TOKEN}
Example Response
http
HTTP Status Code: 200
Content-Type: application/json
json
{
"data": [
{
"id": "abc123",
"route": "https://cutr.it/abc123",
"destination_link": "https://example-1.com",
"in_iframe": false,
"alias": null,
"visits": 7,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
},
{
"id": "def456",
"route": "https://cutr.it/unique-link",
"destination_link": "https://example-2.com",
"in_iframe": true,
"alias": "unique-link",
"visits": 7,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
},
...
],
"links": {
"first": "https://cutr.it/api/short-links?page=1",
"last": "https://cutr.it/api/short-links?page=7",
"prev": "https://cutr.it/api/short-links?page=2",
"next": "https://cutr.it/api/short-links?page=4"
},
"meta": {
"current_page": 3,
"from": 31,
"last_page": 7,
"links": [
{
"url": "https://cutr.it/api/short-links?page=2",
"label": "« Previous",
"active": false
},
{
"url": "https://cutr.it/api/short-links?page=1",
"label": "1",
"active": false
},
{
"url": "https://cutr.it/api/short-links?page=2",
"label": "2",
"active": false
},
...
{
"url": "https://cutr.it/api/short-links?page=7",
"label": "7",
"active": false
},
{
"url": "https://cutr.it/api/short-links?page=4",
"label": "Next »",
"active": false
}
],
"path": "https://cutr.it/api/short-links",
"per_page": 15,
"to": 45,
"total": 99
}
}
Show Short Link
Description: Retrieves the details of a single short link by ID.
- Method:
GET
- Endpoint:
/tools/short-links/{id}
- Path Parameters:
id
(integer, required): The ID of the short link.
Example Request
http
GET /tools/short-links/abc123
Content-Type: application/json
Accept: application/json
Authorization: Bearer {API_TOKEN}
Example Response
http
HTTP Status Code: 200
Content-Type: application/json
json
{
"data": {
"id": "abc123",
"route": "https://cutr.it/abc123",
"destination_link": "https://example-1.com",
"in_iframe": false,
"alias": null,
"visits": 7,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}
Create Short Link
Description: Creates a new short link for the authenticated user.
- Method:
POST
- Endpoint:
/tools/short-links
- Body Parameters:
destination_link
(string, required): The original URL to be shortened.in_iframe
(boolean, optional): Do the original URL should be loaded in a frame.alias
(string, optional): Global unique alias of short link.
Example Request
http
POST /tools/short-links
Content-Type: application/json
Accept: application/json
Authorization: Bearer {API_TOKEN}
json
{
"destination_link": "https://example.com",
"in_iframe": false,
"alias": null
}
Example Response
http
HTTP Status Code: 200
Content-Type: application/json
json
{
"data": {
"id": "ghi789",
"route": "https://cutr.it/ghi789",
"destination_link": "https://example.com",
"in_iframe": false,
"alias": null,
"visits": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}
Update Short Link
Description: Updates an existing short link.
- Method:
PUT
- Endpoint:
/tools/short-links/{id}
- Path Parameters:
id
(integer, required): The ID of the short link to update.
- Body Parameters:
destination_link
(string, optional): The original URL to be shortened.in_iframe
(boolean, optional): Do the original URL should be loaded in a frame.alias
(string, optional): Global unique alias of short link.
Example Request
http
PUT /tools/short-links/abc123
Content-Type: application/json
Accept: application/json
Authorization: Bearer {API_TOKEN}
json
{
"destination_link": "https://example-new.com",
"in_iframe": true,
"alias": "example-new-com"
}
Example Response
http
HTTP Status Code: 200
Content-Type: application/json
json
{
"data": {
"id": "abc123",
"route": "https://cutr.it/example-new-com",
"destination_link": "https://example-new.com",
"in_iframe": true,
"alias": "example-new-com",
"visits": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}
Delete Short Link
Description: Deletes a short link by ID.
- Method:
DELETE
- Endpoint:
/tools/short-links/{id}
- Path Parameters:
id
(integer, required): The ID of the short link to delete.
Example Request
http
DELETE /tools/short-links/abc123
Content-Type: application/json
Accept: application/json
Authorization: Bearer {API_TOKEN}
Example Response
http
HTTP Status Code: 200
Content-Type: application/json
json
{
"data": {
"id": "abc123",
"route": "https://cutr.it/example-new-com",
"destination_link": "https://example-new.com",
"in_iframe": true,
"alias": "example-new-com",
"visits": 0,
"created_at": "2024-01-01T00:00:00.000000Z",
"updated_at": "2024-01-01T00:00:00.000000Z"
}
}