Create a link
curl --request POST \
--url https://linkryse.com/v1/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"domain": "<string>",
"key": "<string>",
"tags": [
{}
],
"publicStats": true
}
'import requests
url = "https://linkryse.com/v1/links"
payload = {
"url": "<string>",
"domain": "<string>",
"key": "<string>",
"tags": [{}],
"publicStats": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
domain: '<string>',
key: '<string>',
tags: [{}],
publicStats: true
})
};
fetch('https://linkryse.com/v1/links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://linkryse.com/v1/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'domain' => '<string>',
'key' => '<string>',
'tags' => [
[
]
],
'publicStats' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://linkryse.com/v1/links"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"domain\": \"<string>\",\n \"key\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"publicStats\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://linkryse.com/v1/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"domain\": \"<string>\",\n \"key\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"publicStats\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://linkryse.com/v1/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"domain\": \"<string>\",\n \"key\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"publicStats\": true\n}"
response = http.request(request)
puts response.read_bodyLinks API
Create a link
Create a new short link.
POST
/
v1
/
links
Create a link
curl --request POST \
--url https://linkryse.com/v1/links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"domain": "<string>",
"key": "<string>",
"tags": [
{}
],
"publicStats": true
}
'import requests
url = "https://linkryse.com/v1/links"
payload = {
"url": "<string>",
"domain": "<string>",
"key": "<string>",
"tags": [{}],
"publicStats": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
domain: '<string>',
key: '<string>',
tags: [{}],
publicStats: true
})
};
fetch('https://linkryse.com/v1/links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://linkryse.com/v1/links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'domain' => '<string>',
'key' => '<string>',
'tags' => [
[
]
],
'publicStats' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://linkryse.com/v1/links"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"domain\": \"<string>\",\n \"key\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"publicStats\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://linkryse.com/v1/links")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"domain\": \"<string>\",\n \"key\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"publicStats\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://linkryse.com/v1/links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"domain\": \"<string>\",\n \"key\": \"<string>\",\n \"tags\": [\n {}\n ],\n \"publicStats\": true\n}"
response = http.request(request)
puts response.read_bodyBody Parameters
string
required
The destination URL where the short link will redirect.
string
The custom domain for the short link. Defaults to
linkry.se if not provided.string
The custom slug (alias) for the short link. If not provided, a random 7-character key will be generated.
array
An array of tags to assign to the link.
boolean
Whether to enable public statistics for this link. Defaults to
false.Response
Returns the created Link Object.Code Examples
cURL
curl --request POST \
--url https://linkryse.com/v1/links \
--header 'Authorization: Bearer sk_live_...' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://google.com",
"domain": "dub.sh",
"key": "search"
}'
Node.js
const link = await linkryse.links.create({
url: 'https://google.com',
domain: 'dub.sh',
key: 'search'
});
⌘I