Team API
API Documentation.
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.
Link shortening
Team Link Shortening API Parameters
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. |
Optional |
Examples
$url = urlencode('{{url}}');
$json = file_get_contents("https://cutt.ly/team/API/index.php?key={{key}}&action=shorten&url=$url&name={{name}}&domain={{domainName}}");
$data = json_decode ($json, true);
var_dump($data);
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();
}
}
}
import urllib
import requests
key = '{{key}}'
action = 'shorten'
url = urllib.parse.quote('{{url}}')
name = '{{name}}'
domain = '{{domainName}}'
r = requests.get('https://cutt.ly/team/API/index.php?key={}&action={}&url={}&name={}&domain={}'.format(key, action, url, name, domain))
print(r.text)
Errors
400 Incorrect action | Action is null or incorrect |
400 Url parameter is null | Parameter url was not sent |
401 Unauthorized | Your API key is incorrect and a json with parameter auth:false has been returned |
401 Subscription has expired | Team owner's subscription has expired |
401 This domain is not owned by the team. To use this domain, it must be added to the team by the team owner. | It occurs when Team does not own the provided domain. To use domain in Team - it must be added to the team by the Team Owner |
409 Provided link is already shortened | Provided link's domain is a registered cutt.ly custom domain |
409 Provided link is incorrect | Provided url is not a link |
409 Provided alias contains illegal characters | Name parameter contains illegal characters |
Example: Shorten URL - Team API
This example demonstrates shortening a URL using the Team API with the minimum required parameters.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
action |
shorten |
In order to shorten a link. |
Required |
url |
{{url}} |
URL you want to shorten. It must be encoded using urlencode() . |
Required |
Ensure that the URL {{url}}
is encoded properly using the urlencode()
function to avoid issues with special characters or parameters in the link.
Example 2: Shorten URL with Alias
This example shows how to shorten a URL with an alias using the required parameters and an optional alias.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &name={{name}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
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 |
Remember to encode the URL using urlencode()
to ensure proper interpretation of special characters or parameters.
Example 3: Shorten URL with Custom Domain
This example demonstrates how to shorten a URL with an alias and specify a custom domain using required and optional parameters.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &domain={{domainName}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
action |
shorten |
In order to shorten a link. |
Required |
url |
{{url}} |
URL you want to shorten. It must be encoded using urlencode() . |
Required |
domain |
{{domainName}} |
Your desired domain to be used. Example: your-domain.co |
Optional |
Ensure that the URL you enter is properly encoded using urlencode()
to handle any special characters or parameters correctly.
Example 4: Shorten URL with Alias and Custom Domain
This example demonstrates how to shorten a URL with an alias and specify a custom domain using required and optional parameters.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &name={{name}} &domain={{domainName}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
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 |
Ensure that the URL you enter is properly encoded using urlencode()
to handle any special characters or parameters correctly.
Example 5: Shorten URL with noTitle
This example demonstrates how to shorten a URL using the noTitle
parameter for faster API response, which disables fetching the page title.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &noTitle=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
action |
shorten |
In order to shorten a link. |
Required |
url |
{{url}} |
URL you want to shorten. It must be encoded using urlencode() . |
Required |
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 |
Ensure that the URL you enter is properly encoded using urlencode()
to handle any special characters or parameters correctly.
Example 6: Shorten URL with public stats
This example shows how to shorten a URL while setting public click stats for the shortened link via the API.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &public=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
action |
shorten |
In order to shorten a link. |
Required |
url |
{{url}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &name={{name}} &domain={{domainName}} &noTitle=1 &public=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &domain=2s.ms/{{HEADER}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
domain |
2s.ms/{{HEADER}} |
The domain with the dynamic HEADER (without `/`) appended automatically to the shortened URL for TRAI SMS compliance. |
Required |
Example: Shorten URL with Generic Domain and Custom Alias
This example demonstrates how to shorten a URL with a custom alias and a generic domain for TRAI SMS compliance.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &domain=2s.ms/{{HEADER}} &name={{name}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
domain |
2s.ms/{{HEADER}} |
The domain with the dynamic HEADER appended automatically to the shortened URL. |
Required |
name |
{{name}} |
The custom alias (name) for the shortened URL. |
Optional |
Example: Shorten URL with Custom Domain and Header
This example demonstrates how to shorten a URL using a custom domain and a specific HEADER for TRAI SMS compliance.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &domain={{domainName}} &header={{header}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
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 |
Example: Shorten URL with Custom Domain, Header, and Custom Alias
This example demonstrates how to shorten a URL with a custom alias, using a custom domain and a specific HEADER for TRAI SMS compliance.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=shorten &url={{url}} &name={{name}} &domain={{domainName}} &header={{header}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &tag={{tag}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. Required to authenticate your request. |
Required |
action |
edit |
To initiate link editing. |
Required |
url |
{{shortURL}} |
URL of the shortened link you want to edit. |
Required |
tag |
{{tag}} |
The TAG you want to add for the shortened link. |
Optional |
Example: Edit a Link - Add/Change Alias
This example demonstrates how to edit an existing shortened link by adding or changing its alias (custom short link name).
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &name={{name}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. Required to authenticate your request. |
Required |
action |
edit |
To initiate link editing. |
Required |
url |
{{shortURL}} |
Your shortened link to be edited. Required. |
Required |
name |
{{name}} |
New alias/name, if not already taken. |
Optional |
Ensure that the URL you want to edit is properly encoded using urlencode()
to avoid issues with special characters.
Example: Edit a Link - Change Source
This example demonstrates how to change the source URL of an existing shortened link by specifying the new source URL.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &source={{sourceURL}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
source |
{{sourceURL}} |
It will change the source URL of the shortened link. Should be passed through urlencode() . |
Required |
Ensure that the new source URL is properly encoded using urlencode()
to avoid issues with special characters.
Example: Edit a Link - Unique
This example demonstrates how to set a unique stat count for a short link. It allows tracking unique clicks for the specified time range.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &unique=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &unique=1440 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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
.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &unique=0 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &title={{title}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &mobile=android &destination={{destinationURL}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &mobile=android |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 - Delete
This example demonstrates how to delete a shortened link using the edit action and the delete parameter.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &delete=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
delete |
1 |
It will delete your shortened link. |
Optional |
Example: AB/C Test - B Test
This example demonstrates how to configure an AB test with a specific chance for the B test and a URL for the B variation.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &url={{shortURL}} &action=edit &abtest=1 &abtest_b=70 &abtest_bvariation={{B_variationURL}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
1 |
0 for deleting, 1 for AB test, 2 for ABC test. |
Required |
abtest_b |
0-100 |
Chance for B test. Cannot be lower than 0 or higher than 100. |
Required |
abtest_bvariation |
{{B_variationURL}} |
URL for B variation. |
Required |
Example: AB/C Test - C Test
This example demonstrates how to configure an ABC test with specific chances for the B and C tests and their respective URLs.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &url={{shortURL}} &action=edit &abtest=2 &abtest_b=30 &abtest_bvariation={{B_variationURL}} &abtest_c=40 &abtest_cvariation={{C_variationURL}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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 |
2 |
0 for deleting, 1 for AB test, 2 for ABC test. |
Required |
abtest_b |
0-100 |
Chance for B test. Cannot be lower than 0 or higher than 100. |
Required |
abtest_bvariation |
{{B_variationURL}}
|
URL for B variation. |
Required |
abtest_c |
0-100 |
Chance for C test. Cannot be lower than 0 or higher than 100. The sum of B and C chances cannot be higher than 100. |
Required |
abtest_cvariation |
{{C_variationURL}} |
URL for C variation. |
Required |
Example: AB/C Test - Remove
This example demonstrates how to remove an AB/C test by setting the `abtest` parameter to 0.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &url={{shortURL}} &action=edit &abtest=0 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &url={{shortURL}} &action=edit &expire=0 &expireCond=10 &expireRedirect={{redirectURL}} &expireUnique=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
url |
{{shortURL}} |
The shortened link you want to edit. |
Required |
action |
edit |
To initiate the link editing. |
Required |
expire |
0 |
0 for click expiration, 1 for date expiration. |
Required |
expireCond |
10 |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &url={{shortURL}} &action=edit &expire=1 &expireCond=YYYY-MM-DD &expireRedirect={{redirectURL}} &expireUnique=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
url |
{{shortURL}} |
The shortened link you want to edit. |
Required |
action |
edit |
To initiate the link editing. |
Required |
expire |
1 |
0 for click expiration, 1 for date expiration. |
Required |
expireCond |
YYYY-MM-DD |
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.
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &url={{shortURL}} &action=edit &expire=0 &expireCond=0 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
url |
{{shortURL}} |
The shortened link you want to edit. |
Required |
action |
edit |
To initiate the link editing. |
Required |
expire |
0 |
0 for click expiration, 1 for date expiration. |
Required |
expireCond |
0 |
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.
Method |
Endpoint URL |
POST |
https://cutt.ly/team/API/index.php?key={{key}} &action=edit &url={{shortURL}} &password=1 |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. |
Required |
action |
edit |
To initiate the link editing. |
Required |
url |
{{shortURL}} |
The short link you want to add a password to. |
Required |
password |
1 |
Always 1. |
Required |
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. |
Optional |
Examples
$json = file_get_contents('https://cutt.ly/team/API/index.php?key={{key}}action=stats&url={{shortenedURL}}');
$data = json_decode ($json, true);
var_dump($data);
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();
}
}
}
import urllib
import requests
key = '{{key}}'
action = 'stats'
url = urllib.parse.quote('{{shortenedURL}}')
r = requests.get('https://cutt.ly/team/API/index.php?key={}&action={}&url={}'.format(key, action, url))
print(r.text)
As a reply, json string will be sent, containing following data:
stats=>status: 0 | This shortened link does not exist |
stats=>status: 1 | This link exists and the data has been downloaded |
stats=>status: 2 | Invalid API key |
If status is equal to 1
stats=>date | Date of shortening the link |
stats=>clicks | Total number of clicks |
stats=>title | Title of the shortened link |
stats=>fullLink | Original link |
stats=>shortLink | Shortened link |
stats=>facebook | The number of clicks from Facebook |
stats=>twitter | The number of clicks from twitter |
stats=>linkedin | The number of clicks from linkedin |
stats=>rest | Other clicks |
stats=>bots | The number of clicks from bots |
In order to display subsequent data, it should take place in a loop. (E.g. for
, while
, foreach
loop)
Let $i
to be the next variable in the array.
stats=>refs=>ref=>$i=>link | displaying the domain from which you clicked on the link |
stats=>refs=>ref=>$i=>clicks | displaying the number of clicks from that domain |
stats=>devices=>geo=>$i=>tag | displaying the abbreviation of the country from which the link was clicked |
stats=>devices=>geo=>$i=>clicks | displaying the number of clicks from this country |
stats=>devices=>dev=>$i=>tag | displaying the type of device from which the link was clicked |
stats=>devices=>dev=>$i=>clicks | displaying the number of clicks from this device
|
stats=>devices=>sys=>$i=>tag | displaying the operating system of the device from which the link was clicked
|
stats=>devices=>sys=>$i=>clicks | displaying the number of clicks from this system |
stats=>devices=>bro=>$i=>tag | displaying the browser from which the link was clicked |
stats=>devices=>bro=>$i=>clicks | displaying the number of clicks from this browser |
stats=>devices=>brand=>$i=>tag | displaying the brand from which the link was clicked |
stats=>devices=>brand=>$i=>clicks | displaying the number of clicks from this brand |
stats=>devices=>lang=>$i=>tag | displaying the language set on the device from which the link was clicked |
stats=>devices=>lang=>$i=>clicks | displaying the number of clicks from this language |
stats=>bots=>bots=>$i=>name | displaying the bot from which the link was clicked |
stats=>bots=>bots=>$i=>clicks | displaying the number of clicks from this bot |
Errors
Incorrect date format | In case the date format is incorrect. The correct format of the given dates: YYYY-MM-DD, e.g. 2021-03-02 |
Insufficient subscription level | When using parameters without the required subscription plan. |
Analytics - Get Statistics
To retrieve URL statistics, send a GET request to the following URL:
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=stats &url={{shortenedURL}} |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. Used to authenticate your request. |
Required |
action |
stats |
Action to retrieve the statistics. |
Required |
url |
{{shortenedURL}} |
The shortened URL you want to check statistics of. |
Required |
Analytics - Both Parameters
To retrieve URL statistics for a specific period, send a GET request to the following URL:
Method |
Endpoint URL |
GET |
https://cutt.ly/team/API/index.php?key={{key}} &action=stats &url={{shortenedURL}} &date_from=YYYY-MM-DD &date_to=YYYY-MM-DD |
Parameter |
Value |
Description |
Requirement Level |
key |
{{key}} |
Your API key. Required to authenticate your request. |
Required |
action |
stats |
Action to retrieve the statistics. |
Required |
url |
{{shortenedURL}} |
The shortened URL you want to check statistics of. |
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. |
Optional |
Team API limits
Team API Rate Limits
The following table outlines the API rate limits based on the selected subscription plan.
Plan |
API Rate Limit |
Team |
180 calls / 60 sec. |
Team Enterprise |
360 calls / 60 sec. |