The API is available only to registered users with minimum Team subscription plan - API key can be generate in Team edit page
To interact with the Team URL shortening service, make a request to https://cutt.ly/team/API/index.php remotely (e.g., using the PHP file_get_contents function). Depending on the action you wish to perform—whether shortening a link, editing an existing short link, or accessing link analytics—you will need to include specific parameters in your request. The required parameters and their descriptions for each operation are outlined in the sections below.
Below is the list of all possible parameters for the Team Link Shortening API. Required parameters are marked with Required, while optional ones are marked with Optional.
Parameter
Value
Description
Requirement Level
key
{{key}}
Your API key. Required to authenticate your request.
Required
action
shorten
In order to shorten a link.
Required
url
{{url}}
URL you want to shorten. It must be encoded using urlencode().
Required
name
{{name}}
Your desired short link – alias, if not already taken.
Optional
domain
{{domainName}}
Your desired domain to be used. Example: your-domain.co
Optional
noTitle
1
Disables getting the page title from the source page meta tag, resulting in faster API response time. Available for Team Enterprise plan.
Optional
public
1
Sets public click stats for shortened link via API.
public class Class1
{
private const string URL = "https://cutt.ly/team/API/index.php";
private string urlParameters = "?key={{key}}&action=shorten&url={{url}}&name={{name}}&domain{{domainName}}";
static void Main(string[] args)
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(URL);
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
// List data response.
HttpResponseMessage response = client.GetAsync(urlParameters).Result; // Blocking call! Program will wait here until a response is received or a timeout occurs.
if (response.IsSuccessStatusCode)
{
// Parse the response body.
var dataObjects = response.Content.ReadAsAsync>().Result; //Make sure to add a reference to System.Net.Http.Formatting.dll
foreach (var d in dataObjects)
{
Console.WriteLine("{0}", d.Name);
}
}
else
{
Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
}
//Make any other calls using HttpClient here.
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class NetClientGet {
public static void main(String[] args) {
try {
URL url = new URL("https://cutt.ly/team/API/index.php?key={{key}}&action=shorten&url={{url}}&name={{name}}&domain={{domainName}}");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader(
(conn.getInputStream())));
String output;
System.out.println("Output from Server .... \n");
while ((output = br.readLine()) != null) {
System.out.println(output);
}
conn.disconnect();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
URL you want to shorten. It must be encoded using urlencode().
Required
public
1
Sets public click stats for the shortened link via the API. Available from Single plan.
Optional
Ensure that the URL you enter is properly encoded using urlencode() to handle any special characters or parameters correctly.
Example 7: Shorten URL with all parameters
This example demonstrates shortening a URL with all the available parameters, including custom alias, domain, and additional options like disabling the page title and setting public stats.
Your API key. Required to authenticate your request.
Required
action
shorten
To shorten a link.
Required
url
{{url}}
URL you want to shorten. It must be encoded using urlencode().
Required
name
{{name}}
Your desired short link alias if not already taken.
Optional
domain
{{domainName}}
Your desired domain to be used. Example: your-domain.co
Optional
noTitle
1
Disables fetching the page title, leading to faster API response times. Available for Team Enterprise plan.
Optional
public
1
Sets public click stats for the shortened link via API. Available from Single plan.
Optional
Ensure that the URL you enter is properly encoded using urlencode() to handle any special characters or parameters correctly.
Example: Shorten URL with Generic Domain
This example demonstrates how to shorten a URL using the generic 2s.ms domain for TRAI SMS compliance. The HEADER will be automatically appended after the shortened part.
Your API key. Required to authenticate the request.
Required
action
shorten
The action to perform for shortening the URL.
Required
url
{{url}}
The full URL you want to shorten.
Required
name
{{name}}
The custom alias (name) for the shortened URL.
Optional
domain
{{domainName}}
Your custom domain to shorten the link.
Required
header
{{header}}
The specific HEADER to append for the shortened URL for TRAI SMS compliance.
Required
Link editing
Editing short links
In order to edit short link, open the file https://cutt.ly/team/API/index.php remotely (eg via the php file_get_contents), with the following parameters
Parameter
Value
Description
key
{{key}}
Your API key to authenticate the request.
action
edit
Action to initiate link editing.
url
{{shortURL}}
The shortened link URL to be edited.
tag
{{tag}}
The TAG to add for the shortened link.
name
{{name}}
New alias or name for the shortened link, if not taken.
source
{{sourceURL}}
The new source URL to change for the shortened link.
unique
1, 15-1440, 0
Sets a unique stat count for the short link. unique=0 removes counting unique clicks, and unique=1 enables it for Single subscription plans. For Team subscription plans, the uniqueness time can range from 15 minutes to 1440 minutes (24 hours).
delete
1
Delete the shortened link.
title
{{title}}
Set the custom title for the shortened link.
mobile
android, ios, windowsMobile
Set alternative redirects for mobile devices based on OS.
destination
{{destinationURL}}
Set the destination URL for mobile redirect.
abtest
0, 1, 2
Set 0 for removing AB test, 1 for AB test, 2 for ABC test.
abtest_b
0-100
Set the chance for B variation test (between 0-100).
abtest_bvariation
{{B_variationURL}}
URL for B test variation.
abtest_c
0-100
Set the chance for C variation test (between 0-100).
abtest_cvariation
{{C_variationURL}}
URL for C test variation.
expire
0 or 1
Set expiration mode: 0 for click-based, 1 for date-based expiration.
expireCond
number of clicks - integers, YYYY-MM-DD, 0
Set expiration condition: date in format YYYY-MM-DD or number of clicks.
expireRedirect
{{redirectURL}}
URL to redirect after expiration condition is met.
expireUnique
1 or 0
Track unique clicks for expiration. 1 for unique, 0 for all clicks.
password
1
Set or remove password protection for the shortened link.
Status for editing short links
status => 1
OK
status => 2
Could not save in database
status => 3
The url does not exist or you do not own it
status => 4 (for source and for destination only)
URL didn't pass the validation
Errors
Insufficient subscription level
When using parameters without the required subscription.
Unique time must be between 15 - 1440 minutes
Time to count unique clicks must be from 15 minutes to 1440 minutes (24h).
Provided alias is unavailable
This alias is already in use and cannot be used.
Example: Edit a Link - Add / Change Tag
In this example, we demonstrate how to edit an existing shortened link by changing its associated tag.
Your API key. Required to authenticate your request.
Required
action
edit
To initiate the link editing process.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
unique
1
Sets a unique stat count for the short link. unique=0 removes counting unique clicks, and unique=1 enables it for Single subscription plans. For Team subscription plans, the uniqueness time can range from 15 minutes to 1440 minutes (24 hours).
Optional
The time of uniqueness for Team plans can be set from 15 minutes to 1440 minutes (24 hours). Ensure that the unique parameter is correctly used according to your subscription plan.
Example: Edit a Link - Unique Custom
This example demonstrates how to customize the unique stat count time for a short link. The uniqueness time can be set for a specific duration.
Your API key. Required to authenticate your request.
Required
action
edit
To initiate the link editing process.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
unique
15-1440
Sets a unique stat count for a short link. unique=0 removes counting unique clicks, unique=1 enables it for Single subscription plans, and for Team subscription plans, the uniqueness time can be customized from 15 minutes to 1440 minutes (24 hours).
Optional
The time of uniqueness can be set to a custom range from 15 minutes to 1440 minutes (24 hours) for Team plans. Ensure the unique parameter is properly configured based on your subscription plan.
Example: Edit a Link - Remove Unique
This example demonstrates how to remove unique stat counting for a short link by setting the unique parameter to 0.
Your API key. Required to authenticate your request.
Required
action
edit
To initiate the link editing process.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
unique
0
Removes counting unique clicks for the shortened link.
Optional
The unique parameter can be set to 0 to disable unique stat counting. If you wish to re-enable it, set the unique parameter to 1 or customize the uniqueness time as per your subscription plan.
Example: Edit a Link - Set Title
This example demonstrates how to edit a link and set a custom title for the shortened link using the title parameter.
Your API key. Required to authenticate your request.
Required
action
edit
To initiate the link editing process.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
title
{{title}}
It will change the title of the shortened link.
Optional
Example: Edit a Link - Set Mobile
This example demonstrates how to edit a link to set up alternative redirects for mobile devices based on the operating system (e.g., Android) and set a custom destination URL.
Your API key. Required to authenticate your request.
Required
action
edit
To initiate the link editing process.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
mobile
android, ios, windowsMobile, redirect
Sets up alternative redirects for mobile devices based on the operating system. Supported values are redirect (for all devices), android, ios, or windowsMobile.
Optional
destination
{{destinationURL}}
An encoded URL to be assigned for the mobile redirect. If omitted, the destination from the mobile option will be removed.
Optional
Example: Edit a Link - Remove Mobile
This example demonstrates how to edit a link and remove the mobile redirect option for Android devices by omitting the destination parameter.
Your API key. Required to authenticate your request.
Required
action
edit
To initiate the link editing process.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
mobile
android, ios, windowsMobile, redirect
Sets up alternative redirects depending on the operating system. For this case, android was selected. Supported values are redirect (for all devices), android, ios, or windowsMobile.
Optional
Example: Edit a Link - Set Mobile Deep Link
This example demonstrates how to edit a link and set a direct mobile deep link.
Works for both Android and iOS by changing the mobile parameter.
Example: Edit a Link - Set Android Deferred Deep Link with Referrer
This example demonstrates how to set a deferred deep link payload for Android.
The referrer value is passed to the app via Google Play Install Referrer API.
Your API key. Required to authenticate your request.
Required
url
{{shortURL}}
Your shortened link to be edited.
Required
action
edit
To initiate the link editing process.
Required
abtest
0
Set to 0 to remove the AB/C test configuration.
Required
Edit a Link - Set Expiration (Clicks)
To edit a shortened link to set expiration based on clicks, make a GET request to the endpoint below. You must include your API key, the shortened link URL to be edited, and the expiration settings.
Set date of expiration in format: YYYY-MM-DD, expiration after reaching certain number of clicks, or delete expiration by providing 0.
Required
expireRedirect
{{redirectURL}}
Set the link destination after the expiration condition is met.
Required
expireUnique
1
Define if clicks should be unique. 1 = yes, 0 = no.
Optional
Edit a Link - Set Expiration (Date)
To edit a shortened link to set expiration based on a specific date, make a GET request to the endpoint below. You must include your API key, the shortened link URL to be edited, and the expiration settings.
Set date of expiration in format: YYYY-MM-DD - expiration after reaching a certain number of clicks, or delete expiration by providing 0.
Required
expireRedirect
{{redirectURL}}
Set the link destination after the expiration condition is met.
Required
expireUnique
1
Define if clicks should be unique. 1 = yes, 0 = no.
Optional
Expiration - Remove Expiration
To remove the expiration from a shortened link, make a GET request to the endpoint below. You must include your API key, the shortened link URL to be edited, and set the expiration parameters to remove the expiration date.
Set date of expiration in format: YYYY-MM-DD, expiration after reaching a certain number of clicks, or delete expiration by providing 0.
Required
Set Password
To set a password for a shortened link, make a POST request to the endpoint below. You must include your API key, the shortened link you want to edit, and the password parameter set to 1. The actual password should be included in the request body.
In the request body, include the password using form-data as shown below:
Key
Value
Description
password
Your password or blank if you want to remove
The password you want to set for the link. Leave blank to remove the password.
Link analytics
Analytics
In order to access URL statistics, open the file https://cutt.ly/team/API/index.php remotely (e.g., via the PHP file_get_contents), with the following parameters:
Parameter
Value
Description
Requirement Level
key
{{key}}
Your Team API key. Used to authenticate your request.
Required
action
stats
Your action to retrieve statistics.
Required
url
{{shortenedURL}}
The shortened URL for which you want to check statistics.
Required
date_from
YYYY-MM-DD
Returns clicks from the start date. Can be used with date_to or separately.
Optional
date_to
YYYY-MM-DD
Returns clicks until the end date. Can be used with date_from or separately.
public class Class1
{
private const string URL = "https://cutt.ly/team/API/index.php";
private string urlParameters = "?key={{key}}action=stats&url={{shortenedURL}}";
static void Main(string[] args)
{
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(URL);
// Add an Accept header for JSON format.
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
// List data response.
HttpResponseMessage response = client.GetAsync(urlParameters).Result; // Blocking call! Program will wait here until a response is received or a timeout occurs.
if (response.IsSuccessStatusCode)
{
// Parse the response body.
var dataObjects = response.Content.ReadAsAsync>().Result; //Make sure to add a reference to System.Net.Http.Formatting.dll
foreach (var d in dataObjects)
{
Console.WriteLine("{0}", d.Name);
}
}
else
{
Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
}
//Make any other calls using HttpClient here.
//Dispose once all HttpClient calls are complete. This is not necessary if the containing object will be disposed of; for example in this case the HttpClient instance will be disposed automatically when the application terminates so the following call is superfluous.
client.Dispose();
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class NetClientGet {
public static void main(String[] args) {
try {
URL url = new URL("https://cutt.ly/team/API/index.php?key={{key}}&action=stats&url={{shortenedURL}}");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ conn.getResponseCode());
}
BufferedReader br = new BufferedReader(new InputStreamReader(
(conn.getInputStream())));
String output;
System.out.println("Output from Server .... \n");
while ((output = br.readLine()) != null) {
System.out.println(output);
}
conn.disconnect();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}