MENU navbar-image

Introduction

API reference for the Linked URL shortener.

Use this API to manage links, domains, QR codes, and bulk imports.

<aside>All API requests require a Bearer token created from your dashboard.</aside>

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_API_TOKEN}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your token by visiting your dashboard and clicking Generate API token.

Endpoints

GET api/domain/verify

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/domain/verify" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"domain\": \"b\"
}"
const url = new URL(
    "https://linked.bd/api/domain/verify"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "domain": "b"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (403):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 120
x-ratelimit-remaining: 119
access-control-allow-origin: *
 

{
    "message": "Domain is not authorized for TLS issuance.",
    "errors": {}
}
 

Request      

GET api/domain/verify

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

domain   string     

Must match the regex /^(?!-)[A-Za-z0-9-]{1,63}(?<!-)(.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*$/. Must not be greater than 255 characters. Example: b

POST api/v1/agents/start

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/agents/start" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"[email protected]\"
}"
const url = new URL(
    "https://linked.bd/api/v1/agents/start"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "[email protected]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/agents/start

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

email   string     

Must be a valid email address. Must not be greater than 255 characters. Example: [email protected]

POST api/v1/agents/verify

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/agents/verify" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"challenge_id\": \"architecto\",
    \"code\": \"ngzmiyvd\"
}"
const url = new URL(
    "https://linked.bd/api/v1/agents/verify"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "challenge_id": "architecto",
    "code": "ngzmiyvd"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/agents/verify

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

challenge_id   string     

The id of an existing record in the agent_auth_challenges table. Example: architecto

code   string     

Must contain only letters and numbers. Must be 8 characters. Example: ngzmiyvd

Handle the incoming request.

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/me" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/me"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

Request      

GET api/v1/me

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/links" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/links"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/links/architecto" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/links/architecto"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/links/architecto/qr" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/links/architecto/qr"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/links" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"link_type\": \"dynamic\",
    \"destination_url\": \"http:\\/\\/www.bailey.biz\\/quos-velit-et-fugiat-sunt-nihil-accusantium-harum.html\",
    \"fallback_destination_url\": \"https:\\/\\/www.runte.com\\/ab-provident-perspiciatis-quo-omnis-nostrum-aut-adipisci\",
    \"domain_id\": 16,
    \"alias\": \"n\",
    \"password\": \"|{+-0pBNvYgx\",
    \"expires_at\": \"2052-05-06\",
    \"rules\": [
        {
            \"priority\": 22,
            \"destination_url\": \"http:\\/\\/crooks.biz\\/et-fugiat-sunt-nihil-accusantium\",
            \"enabled\": true,
            \"conditions\": [
                {
                    \"condition_type\": \"country\",
                    \"operator\": \"in\"
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://linked.bd/api/v1/links"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "link_type": "dynamic",
    "destination_url": "http:\/\/www.bailey.biz\/quos-velit-et-fugiat-sunt-nihil-accusantium-harum.html",
    "fallback_destination_url": "https:\/\/www.runte.com\/ab-provident-perspiciatis-quo-omnis-nostrum-aut-adipisci",
    "domain_id": 16,
    "alias": "n",
    "password": "|{+-0pBNvYgx",
    "expires_at": "2052-05-06",
    "rules": [
        {
            "priority": 22,
            "destination_url": "http:\/\/crooks.biz\/et-fugiat-sunt-nihil-accusantium",
            "enabled": true,
            "conditions": [
                {
                    "condition_type": "country",
                    "operator": "in"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

requires authentication

Example request:
curl --request DELETE \
    "https://linked.bd/api/v1/links/architecto" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/links/architecto"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

GET api/v1/domains

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/domains" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/domains"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

Request      

GET api/v1/domains

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

GET api/v1/domains/{id}

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/domains/16" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/domains/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

Request      

GET api/v1/domains/{id}

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the domain. Example: 16

POST api/v1/domains

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/domains" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"hostname\": \"b\"
}"
const url = new URL(
    "https://linked.bd/api/v1/domains"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "hostname": "b"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/domains

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

hostname   string     

Must match the regex /^(?!-)[A-Za-z0-9-]{1,63}(?<!-)(.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*$/. Must not be one of linked.bd Must not be greater than 255 characters. Example: b

POST api/v1/domains/{domain_id}/disable

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/domains/16/disable" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/domains/16/disable"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/domains/{domain_id}/disable

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

domain_id   integer     

The ID of the domain. Example: 16

DELETE api/v1/domains/{id}

requires authentication

Example request:
curl --request DELETE \
    "https://linked.bd/api/v1/domains/16" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/domains/16"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Request      

DELETE api/v1/domains/{id}

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

id   integer     

The ID of the domain. Example: 16

POST api/v1/domains/{domain_id}/verify

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/domains/16/verify" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/domains/16/verify"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/v1/domains/{domain_id}/verify

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

domain_id   integer     

The ID of the domain. Example: 16

GET api/v1/bulk-imports/{job}

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/bulk-imports/architecto" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/bulk-imports/architecto"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

Request      

GET api/v1/bulk-imports/{job}

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

job   string     

Example: architecto

GET api/v1/bulk-imports/{job}/items

requires authentication

Example request:
curl --request GET \
    --get "https://linked.bd/api/v1/bulk-imports/architecto/items" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://linked.bd/api/v1/bulk-imports/architecto/items"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "message": "Unauthenticated.",
    "errors": {}
}
 

Request      

GET api/v1/bulk-imports/{job}/items

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

URL Parameters

job   string     

Example: architecto

POST api/v1/bulk-imports

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/bulk-imports" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"urls\": \"architecto\",
    \"domain_id\": 16,
    \"password\": \"]|{+-0pBNvYg\",
    \"expires_at\": \"2052-05-06\",
    \"deduplicate\": true
}"
const url = new URL(
    "https://linked.bd/api/v1/bulk-imports"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "urls": "architecto",
    "domain_id": 16,
    "password": "]|{+-0pBNvYg",
    "expires_at": "2052-05-06",
    "deduplicate": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/v1/bulk-imports

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: application/json

Accept        

Example: application/json

Body Parameters

urls   string     

Example: architecto

domain_id   integer     

The id of an existing record in the domains table. Example: 16

password   string  optional    

Must be at least 6 characters. Must not be greater than 255 characters. Example: ]|{+-0pBNvYg

expires_at   string  optional    

Must be a valid date. Must be a date after now. Example: 2052-05-06

deduplicate   boolean  optional    

Example: true

POST api/v1/blogs/{blog_id}/media/upload

requires authentication

Example request:
curl --request POST \
    "https://linked.bd/api/v1/blogs/architecto/media/upload" \
    --header "Authorization: Bearer {YOUR_API_TOKEN}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "image_type=cover"\
    --form "image=@/tmp/php89v6t9dskb1hey2Qvjb" 
const url = new URL(
    "https://linked.bd/api/v1/blogs/architecto/media/upload"
);

const headers = {
    "Authorization": "Bearer {YOUR_API_TOKEN}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('image_type', 'cover');
body.append('image', document.querySelector('input[name="image"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/v1/blogs/{blog_id}/media/upload

Headers

Authorization        

Example: Bearer {YOUR_API_TOKEN}

Content-Type        

Example: multipart/form-data

Accept        

Example: application/json

URL Parameters

blog_id   string     

The ID of the blog. Example: architecto

Body Parameters

image_type   string     

Example: cover

Must be one of:
  • cover
image   file     

Must be an image. Must not be greater than 5120 kilobytes. Example: /tmp/php89v6t9dskb1hey2Qvjb