Platform Limits (Not use API requests limit)

Provides data on the user's system limits for API requests.
Our limits for API requests are 100 per minute and 1000 per hour. When these limits are reached, you will receive a notification, and you will need to wait a minute or an hour, respectively, before your used limit is reset to zero.

Request
curl --location 'https://api.surl.li/user-api/v1/user/platform-limits' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: {YOUR_KEY}'
$curl = curl_init();
$url = "https://api.surl.li/user-api/v1/user/platform-limits";

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();

$request = new Request('GET', 'https://api.surl.li/user-api/v1/user/platform-limits', [
'X-API-KEY' => '{YOUR_KEY}'
]);

$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.surl.li/user-api/v1/user/platform-limits',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");

const requestOptions = {
  method: "GET",
  headers: myHeaders,
};

fetch("https://api.surl.li/user-api/v1/user/platform-limits", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/user/platform-limits"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests

url = "https://api.surl.li/user-api/v1/user/platform-limits"

payload = {}
headers = {
  'X-API-KEY': '{YOUR_KEY}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "minute": {
            "used": int,
            "max": int
        },
        "hour": {
            "used": int,
            "max": int
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Plan Limits (Not use API requests limit)

Provides information about the user's usage limits based on their tariff plan.
- A value of -1 indicates unlimited access.
- A value of 0 in the max field means the feature is unavailable under the current tariff plan.

Request
curl --location 'https://api.surl.li/user-api/v1/user/plan-limits' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: {YOUR_KEY}'
$curl = curl_init();
$url = "https://api.surl.li/user-api/v1/user/plan-limits";

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();

$request = new Request('GET', 'https://api.surl.li/user-api/v1/user/plan-limits', [
'X-API-KEY' => '{YOUR_KEY}'
]);

$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.surl.li/user-api/v1/user/plan-limits',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");

const requestOptions = {
  method: "GET",
  headers: myHeaders,
};

fetch("https://api.surl.li/user-api/v1/user/plan-limits", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/user/plan-limits"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests

url = "https://api.surl.li/user-api/v1/user/plan-limits"

payload = {}
headers = {
  'X-API-KEY': '{YOUR_KEY}'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "UTM builder": {
            "used": -1,
            "max": -1
        },
        "URL password": {
            "used": 0,
            "max": 0
        },
        "Max Urls per Account": {
            "used": int,
            "max": int
        },
        ...
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
URL Shortening

Shortens the url with additional options.

Triggered Limits:

  • Max Urls per Account
  • Max Shorts per plan period

Request Body Schema

url
string
Required
The link you want to shorten
options
array
Optional
Additional options for link shortening
alias
string
Optional
The alias that will be assigned to the new link, if it is free.
The “Alias updates” limit will be affected on use!
Default:
Random
title
string
Optional
Title/name that will be assigned to the link after shortening
Default:
Fetching `url`
password
string
Optional
Password that will be assigned to the link after shortening.
Requires access to the “URL password” functionality!
domain_name
string
Optional
The domain on which the link will be shortened. To use it, you need to have access to the “Domains” functionality and use the domain that you own in the Surli system.
Default:
surl.li
Request
curl --location 'https://api.surl.li/user-api/v1/urls/short' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "url": "google.com",
    "options": {
        "alias": "aaa",
        "title": "Some Example Title",
        "password": "123ABC",
        "domain_name": "surl.li",
    }
}'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/short';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => '{
    "url": "google.com",
    "options": {
        "alias": "aaa",
        "title": "Some Example Title",
        "password": "123ABC",
        "domain_name": "surl.li",
    }
}',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$body = '{
    "url": "google.com",
    "options": {
        "alias": "aaa",
        "title": "Some Example Title",
        "password": "123ABC",
        "domain_name": "surl.li",
    }
}';
$request = new Request('POST', 'https://api.surl.li/user-api/v1/urls/short', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.surl.li/user-api/v1/urls/short',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}',
    'Content-Type': 'application/json'
  },
  body: '{
    "url": "google.com",
    "options": {
        "alias": "aaa",
        "title": "Some Example Title",
        "password": "123ABC",
        "domain_name": "surl.li",
    }
}'

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const raw = "{
    "url": "google.com",
    "options": {
        "alias": "aaa",
        "title": "Some Example Title",
        "password": "123ABC",
        "domain_name": "surl.li",
    }
}";

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/short", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/short"
  method := "POST"

  payload := strings.NewReader(`{`+"
"+`
    "url": "google.com",`+"
"+`
    "options": {`+"
"+`
        "alias": "aaa",`+"
"+`
        "title": "Some Example Title",`+"
"+`
        "password": "123ABC",`+"
"+`
        "domain_name": "surl.li",`+"
"+`
    }`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/short"

payload = "{
    "url": "google.com",
    "options": {
        "alias": "aaa",
        "title": "Some Example Title",
        "password": "123ABC",
        "domain_name": "surl.li",
    }
}"
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "url": {
            "long": "https://google.com",
            "short": "https://surl.li/aaa",
            "stat": "https://surl.li/aaa+",
            "title": "Some Example Title",
            "alias": "aaa",
            "status": "Linked",
            "domain": "surl.li",
            "password": "123ABC",
            "created_at": "2001-11-21"
        },
        "reference": {
            "url": "https://google.com",
            "options": {
                "alias": "aaa",
                "title": "Some Example Title",
                "password": "123ABC",
                "domain_name": "surl.li",
            }
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 422,
    "locale": "en",
    "message": "Error #422",
    "data": {
        "errors": array
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Short Url Info

Provides information about the created short link.
{surl} - This represents your short link, e.g., surl.li/aa.

Request
curl --location 'https://api.surl.li/user-api/v1/urls/{surl}' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$request = new Request('GET', 'https://api.surl.li/user-api/v1/urls/{surl}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.surl.li/user-api/v1/urls/{surl}',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}',
    'Content-Type': 'application/json'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
var settings = {
  "url": "https://api.surl.li/user-api/v1/urls/{surl}",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "X-API-KEY": "{YOUR_KEY}",
    "Content-Type": "application/json"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}"
  method := "GET"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}"

payload = {}
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "long": "https://google.com",
        "short": "https://surl.li/aaa",
        "stat": "https://surl.li/aaa+",
        "title": "",
        "alias": "aaa",
        "status": "Linked",
        "domain": "surl.li",
        "password": "",
        "created_at": "2001-11-21"
        "reference": {}
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Delete Short Url

Deletes a short link.

Request
curl --location --request DELETE 'https://api.surl.li/user-api/v1/urls/{surl}' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$request = new Request('DELETE', 'https://api.surl.li/user-api/v1/urls/{surl}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'DELETE',
  'url': 'https://api.surl.li/user-api/v1/urls/{surl}',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}',
    'Content-Type': 'application/json'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const requestOptions = {
  method: "DELETE",
  headers: myHeaders,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/{surl}", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}"
  method := "DELETE"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}"

payload = {}
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "reference": []
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Adds a password to a short link.

Requires access to the "URL password" functionality

Request
curl --location --request PATCH 'https://api.surl.li/user-api/v1/urls/{surl}/password' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "password": "123ABC"
}'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}/password';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS => '{
    "password": "123ABC"
}',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$body = '{
  "password": "123ABC"
}';
$request = new Request('PATCH', 'https://api.surl.li/user-api/v1/urls/{surl}/password', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'PATCH',
  'url': 'https://api.surl.li/user-api/v1/urls/{surl}/password',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "password": "123ABC"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "password": "123ABC"
});

const requestOptions = {
  method: "PATCH",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/{surl}/password", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}/password"
  method := "PATCH"

  payload := strings.NewReader(`{`+"
"+`
    "password": "123ABC"`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}/password"

payload = json.dumps({
  "password": "123ABC"
})
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "reference": {
            "password": "123ABC"
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 422,
    "locale": "en",
    "message": "Error #422",
    "data": {
        "errors": array
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Updates the password for a short link.

Requires access to the "URL password" functionality

Request
curl --location --request PATCH 'https://api.surl.li/user-api/v1/urls/{surl}/password-change' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "password": "123ABC"
}'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}/password-change';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS => '{
    "password": "123ABC"
}',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$body = '{
  "password": "123ABC"
}';
$request = new Request('PATCH', 'https://api.surl.li/user-api/v1/urls/{surl}/password-change', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'PATCH',
  'url': 'https://api.surl.li/user-api/v1/urls/{surl}/password-change',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "password": "123ABC"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "password": "123ABC"
});

const requestOptions = {
  method: "PATCH",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/{surl}/password-change", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}/password-change"
  method := "PATCH"

  payload := strings.NewReader(`{`+"
"+`
    "password": "123ABC"`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}/password-change"

payload = json.dumps({
  "password": "123ABC"
})
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "reference": {
            "password": "123ABC"
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 422,
    "locale": "en",
    "message": "Error #422",
    "data": {
        "errors": array
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Removes the password from a short link.

Requires access to the "URL password" functionality

Request
curl --location --request PATCH 'https://api.surl.li/user-api/v1/urls/{surl}/password-remove' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "password": "123ABC"
}'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}/password-remove';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS => '{
    "password": "123ABC"
}',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$body = '{
  "password": "123ABC"
}';
$request = new Request('PATCH', 'https://api.surl.li/user-api/v1/urls/{surl}/password-remove', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
  'method': 'PATCH',
  'url': 'https://api.surl.li/user-api/v1/urls/{surl}/password-remove',
  'headers': {
    'X-API-KEY': '{YOUR_KEY}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "password": "123ABC"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "password": "123ABC"
});

const requestOptions = {
  method: "PATCH",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/{surl}/password-remove", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}/password-remove"
  method := "PATCH"

  payload := strings.NewReader(`{`+"
"+`
    "password": "123ABC"`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}/password-remove"

payload = json.dumps({
  "password": "123ABC"
})
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "reference": {
            "password": "123ABC"
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 422,
    "locale": "en",
    "message": "Error #422",
    "data": {
        "errors": array
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Changes the alias.

Changes the alias of your short link

Requires access to the "Alias updates" functionality

Request Body Schema

alias
string
Required
New alias for your short link
Request
curl --location --request PATCH 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "alias": "aab"
}'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS => '{
    "alias": "aab"
}',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$body = '{
  "alias": "aab"
}';
$request = new Request('PATCH', 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias',
'headers': {
'X-API-KEY': '{YOUR_KEY}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"alias": "aab"
})

};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "alias": "aab"
});

const requestOptions = {
  method: "PATCH",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/{surl}/change-alias", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}/change-alias"
  method := "PATCH"

  payload := strings.NewReader(`{`+"
"+`
    "alias": "aab"`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}/change-alias"

payload = json.dumps({
  "alias": "aab"
})
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "url": {
            "long": "http://hyperhost.ua",
            "short": "https://surl.li/aab",
            "stat": "https://surl.li/aab+",
            "title": "",
            "alias": "aab",
            "status": "Linked",
            "domain": "surl.li",
            "password": "",
            "created_at": "2001-11-21"
        },
        "reference": {
            "alias": "aab"
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 422,
    "locale": "en",
    "message": "Error #422",
    "data": {
        "errors": array
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}
Changes the destination.

Changes the destination link of your short link

Requires access to the "Destination Url updates" functionality

Request Body Schema

url
string
Required
New destination url for your surl
Request
curl --location --request PATCH 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias' \
--header 'X-API-KEY: {YOUR_KEY}' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://google.com"
}'
$curl = curl_init();
$url = 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias';

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PATCH',
  CURLOPT_POSTFIELDS => '{
    "url": "https://google.com"
}',
  CURLOPT_HTTPHEADER => [
    'X-API-KEY: {YOUR_KEY}',
    'Content-Type: application/json'
  ],
]);

$response = curl_exec($curl);

curl_close($curl);
echo $response;
$client = new Client();
$headers = [
  'X-API-KEY' => '{YOUR_KEY}',
  'Content-Type' => 'application/json'
];
$body = '{
  "url": "https://google.com"
}';
$request = new Request('PATCH', 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
var request = require('request');
var options = {
'method': 'PATCH',
'url': 'https://api.surl.li/user-api/v1/urls/{surl}/change-alias',
'headers': {
'X-API-KEY': '{YOUR_KEY}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"url": "https://google.com"
})

};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
const myHeaders = new Headers();
myHeaders.append("X-API-KEY", "{YOUR_KEY}");
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
 "url": "https://google.com"
});

const requestOptions = {
  method: "PATCH",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://api.surl.li/user-api/v1/urls/{surl}/change-alias", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io"
)

func main() {

  url := "https://api.surl.li/user-api/v1/urls/{surl}/change-alias"
  method := "PATCH"

  payload := strings.NewReader(`{`+"
"+`
    "url": "https://google.com"`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("X-API-KEY", "{YOUR_KEY}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := io.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
import requests
import json

url = "https://api.surl.li/user-api/v1/urls/{surl}/change-alias"

payload = json.dumps({
  "url": "https://google.com"
})
headers = {
  'X-API-KEY': '{YOUR_KEY}',
  'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, data=payload)

print(response.text)
Response
{
    "success": bool,
    "code": 0,
    "locale": "en",
    "message": "OK",
    "data": {
        "url": {
            "long": "https://google.com",
            "short": "https://surl.li/aaa",
            "stat": "https://surl.li/aaa+",
            "title": "Google",
            "alias": "aaa",
            "status": "Linked",
            "domain": "surl.li",
            "password": "",
            "created_at": "2001-11-21"
        },
        "reference": {
            "url": "https://google.com"
        }
    }
}
{
    "success": false,
    "code": 401,
    "locale": "en",
    "message": "Error #401",
    "data": {
        "result": false,
        "message": "Invalid API key.",
        "code": 401
    }
}
{
    "success": false,
    "code": 422,
    "locale": "en",
    "message": "Error #422",
    "data": {
        "errors": array
    }
}
{
    "success": false,
    "code": 429,
    "locale": "en",
    "message": "Error #429",
    "data": {
        "result": false,
        "message": "string",
        "code": 429
    }
}
{
    "success": false,
    "code": 500,
    "locale": "en",
    "message": "Error #500",
    "data": {
        "message": "Something went wrong. Try again later.",
        "reference": []
    }
}