Developers

Short Link and QR Code API Reference

Every request needs an API key. API access depends on your plan. If your plan includes it, your key is shown under Getting Started when you are signed in. If it does not, requests return the error "You do not have the permission to use the API."

Getting Started

Send your API key with every request (see the examples under Authentication). If the key is missing or has expired, the API returns an error. Keep your key secret to prevent misuse.

Authentication

To authenticate, send your API key as a Bearer token in the Authorization header of every request. The examples below call the Get Account endpoint.

curl --location --request GET 'https://shorturl.is/api/account' \
  --header 'Authorization: Bearer YOURAPIKEY'

Rate Limit

The API limits how many requests you can make, which keeps it stable during spikes in traffic. The current limit is 30 requests per 1-minute window. The limit can vary by plan.

Each response includes headers that show your limit, the requests you have left and the time the limit resets, as a Unix timestamp.

X-RateLimit-Limit: 30X-RateLimit-Remaining: 29X-RateLimit-Reset: TIMESTAMP

Response Handling

All API responses are returned as JSON. To use the data, parse it with the JSON function for your language. In PHP, json_decode() returns an object by default, or an array if you set the second parameter to true. Always check the error key: it tells you whether the request failed. You can also check the HTTP status code.

{
    "error": 1,
    "message": "An error occurred"
}

Get Account

GET https://shorturl.is/api/account

Get information about your account.

curl --location --request GET 'https://shorturl.is/api/account' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "data": {
        "id": 1,
        "email": "[email protected]",
        "username": "sampleuser",
        "avatar": "https:\/\/domain.com\/content\/avatar.png",
        "status": "pro",
        "expires": "2022-11-15 15:00:00",
        "registered": "2020-11-10 18:01:43"
    }
}

Update Account

PUT https://shorturl.is/api/account/update

Update your account details. Send the new values as JSON in the body of a PUT request.

curl --location --request PUT 'https://shorturl.is/api/account/update' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "email": "[email protected]",
    "password": "NewPassword1"
}'

Server response

{
    "error": 0,
    "message": "Account has been successfully updated."
}

Branded Domains

List Branded Domains

GET https://shorturl.is/api/domains?limit=2&page=1

Get your branded domains. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/domains?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "domains": [
            {
                "id": 1,
                "domain": "https:\/\/domain1.com",
                "redirectroot": "https:\/\/rootdomain.com",
                "redirect404": "https:\/\/rootdomain.com\/404"
            },
            {
                "id": 2,
                "domain": "https:\/\/domain2.com",
                "redirectroot": "https:\/\/rootdomain2.com",
                "redirect404": "https:\/\/rootdomain2.com\/404"
            }
        ]
    }
}

Create a Branded Domain

POST https://shorturl.is/api/domain/add

Add a branded domain. The domain must already point to our server.

Parameter Description
domain (required) The branded domain, including http:// or https://
redirectroot (optional) URL to redirect to when someone visits the root of your domain
redirect404 (optional) URL to redirect to instead of showing a 404 (page not found) error
curl --location --request POST 'https://shorturl.is/api/domain/add' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "domain": "https://domain1.com",
    "redirectroot": "https://rootdomain.com",
    "redirect404": "https://rootdomain.com/404"
}'

Server response

{
    "error": 0,
    "id": 1
}

Update Domain

PUT https://shorturl.is/api/domain/:id/update

To update a branded domain, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.

Parameter Description
redirectroot (optional) URL to redirect to when someone visits the root of your domain
redirect404 (optional) URL to redirect to instead of showing a 404 (page not found) error
curl --location --request PUT 'https://shorturl.is/api/domain/:id/update' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "redirectroot": "https://rootdomain-new.com",
    "redirect404": "https://rootdomain-new.com/404"
}'

Server response

{
    "error": 0,
    "message": "Domain has been updated successfully."
}

Delete Domain

DELETE https://shorturl.is/api/domain/:id/delete

To delete a domain, you need to send a DELETE request.

curl --location --request DELETE 'https://shorturl.is/api/domain/:id/delete' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "Domain has been deleted successfully."
}

CTA Overlays

List CTA Overlays

GET https://shorturl.is/api/overlay?limit=2&page=1

Get your CTA overlays. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/overlay?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "cta": [
            {
                "id": 1,
                "type": "message",
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "contact",
                "name": "Contact Page",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

Campaigns

List Campaigns

GET https://shorturl.is/api/campaigns?limit=2&page=1

Get your campaigns. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/campaigns?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "campaigns": [
            {
                "id": 1,
                "name": "Sample Campaign",
                "rotator": false
            },
            {
                "id": 2,
                "domain": "Facebook Campaign",
                "rotator": "https:\/\/domain.com\/r\/test"
            }
        ]
    }
}

Create a Campaign

POST https://shorturl.is/api/campaign/add

Create a campaign.

Parameter Description
name (optional) Campaign name
slug (optional) Slug used in the campaign's rotator link
curl --location --request POST 'https://shorturl.is/api/campaign/add' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "name": "New Campaign",
    "slug": "new-campaign"
}'

Server response

{
    "error": 0,
    "id": 3,
    "domain": "New Campaign",
    "rotator": "https:\/\/domain.com\/r\/new-campaign"
}
POST https://shorturl.is/api/campaign/:campaignid/assign/:linkid

Add a short link to a campaign. The route needs the campaign ID and the short link ID.

curl --location --request POST 'https://shorturl.is/api/campaign/:campaignid/assign/:linkid' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "Link successfully added to the campaign."
}

Update Campaign

PUT https://shorturl.is/api/campaign/:id/update

To update a campaign, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.

Parameter Description
name (required) Campaign name
slug (optional) Slug used in the campaign's rotator link
curl --location --request PUT 'https://shorturl.is/api/campaign/:id/update' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "name": "Twitter Campaign",
    "slug": "twitter-campaign"
}'

Server response

{
    "error": 0,
    "id": 3,
    "domain": "Twitter Campaign",
    "rotator": "https:\/\/domain.com\/r\/twitter-campaign"
}

Delete Campaign

DELETE https://shorturl.is/api/campaign/:id/delete

To delete a campaign, you need to send a DELETE request.

curl --location --request DELETE 'https://shorturl.is/api/campaign/:id/delete' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "Campaign has been deleted successfully."
}

Channels

List Channels

GET https://shorturl.is/api/channels?limit=2&page=1

Get your channels. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/channels?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "channels": [
            {
                "id": 1,
                "name": "Channel 1",
                "description": "Description of channel 1",
                "color": "#000000",
                "starred": true
            },
            {
                "id": 2,
                "name": "Channel 2",
                "description": "Description of channel 2",
                "color": "#FF0000",
                "starred": false
            }
        ]
    }
}

List Channel Items

GET https://shorturl.is/api/channel/:id?limit=1&page=1

Get the items in one of your channels. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/channel/:id?limit=1&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "items": [
            {
                "type": "links",
                "id": 1,
                "title": "My Sample Link",
                "preview": "https:\/\/google.com",
                "link": "https:\/\/shorturl.is\/google",
                "date": "2022-05-12"
            },
            {
                "type": "bio",
                "id": 1,
                "title": "My Sample Bio",
                "preview": "https:\/\/shorturl.is\/mybio",
                "link": "https:\/\/shorturl.is\/mybio",
                "date": "2022-06-01"
            }
        ]
    }
}

Create a Channel

POST https://shorturl.is/api/channel/add

Create a channel.

Parameter Description
name (required) Channel name
description (optional) Channel description
color (optional) Channel badge colour as a hex code, for example #FF0000
starred (optional) true to star the channel, false to leave it unstarred
curl --location --request POST 'https://shorturl.is/api/channel/add' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}'

Server response

{
    "error": 0,
    "id": 3,
    "name": "New Channel",
    "description": "my new channel",
    "color": "#000000",
    "starred": true
}

Assign an Item to a Channel

POST https://shorturl.is/api/channel/:channelid/assign/:type/:itemid

Add an item to a channel. The route needs the channel ID, the item type (links, bio or qr) and the item ID.

Parameter Description
:channelid (required) Channel ID
:type (required) The item type: links, bio or qr
:itemid (required) Item ID
curl --location --request POST 'https://shorturl.is/api/channel/:channelid/assign/:type/:itemid' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "Item successfully added to the channel."
}

Update Channel

PUT https://shorturl.is/api/channel/:id/update

To update a channel, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.

Parameter Description
name (optional) Channel name
description (optional) Channel description
color (optional) Channel badge colour as a hex code, for example #FF0000
starred (optional) true to star the channel, false to leave it unstarred
curl --location --request PUT 'https://shorturl.is/api/channel/:id/update' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "name": "Acme Corp",
    "description": "channel for items for Acme Corp",
    "color": "#FFFFFF",
    "starred": false
}'

Server response

{
    "error": 0,
    "message": "Channel has been updated successfully."
}

Delete Channel

DELETE https://shorturl.is/api/channel/:id/delete

To delete a channel, send a DELETE request. Every item in the channel is unassigned from it.

curl --location --request DELETE 'https://shorturl.is/api/channel/:id/delete' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "Channel has been deleted successfully."
}

Custom Splash

List Custom Splash

GET https://shorturl.is/api/splash?limit=2&page=1

Get your custom splash pages. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/splash?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "splash": [
            {
                "id": 1,
                "name": "Product 1 Promo",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "name": "Product 2 Promo",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

List Pixels

GET https://shorturl.is/api/pixels?limit=2&page=1

Get your pixels. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/pixels?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "pixels": [
            {
                "id": 1,
                "type": "gtmpixel",
                "name": "GTM Pixel",
                "tag": "GA-123456789",
                "date": "2020-11-10 18:00:00"
            },
            {
                "id": 2,
                "type": "twitterpixel",
                "name": "Twitter Pixel",
                "tag": "1234567",
                "date": "2020-11-10 18:10:00"
            }
        ]
    }
}

Create a Pixel

POST https://shorturl.is/api/pixel/add

Create a pixel. You need to send the pixel type, a name and the tag.

Parameter Description
type (required) gtmpixel | gapixel | fbpixel | adwordspixel | linkedinpixel | twitterpixel | adrollpixel | quorapixel | pinterest | bing | snapchat | reddit | tiktok
name (required) Custom name for your pixel
tag (required) The tag for the pixel
curl --location --request POST 'https://shorturl.is/api/pixel/add' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "type": "gtmpixel",
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'

Server response

{
    "error": 0,
    "id": 1
}

Update Pixel

PUT https://shorturl.is/api/pixel/:id/update

To update a pixel, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.

Parameter Description
name (optional) Custom name for your pixel
tag (required) The tag for the pixel
curl --location --request PUT 'https://shorturl.is/api/pixel/:id/update' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "name": "My GTM",
    "tag": "GTM-ABCDE"
}'

Server response

{
    "error": 0,
    "message": "Pixel has been updated successfully."
}

Delete Pixel

DELETE https://shorturl.is/api/pixel/:id/delete

To delete a pixel, you need to send a DELETE request.

curl --location --request DELETE 'https://shorturl.is/api/pixel/:id/delete' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "Pixel has been deleted successfully."
}

QR Codes

List QR codes

GET https://shorturl.is/api/qr?limit=2&page=1

Get your QR codes. Use the parameters below to choose the page and the number of results per page.

Parameter Description
limit (optional) Number of results per page
page (optional) Page number to return
curl --location --request GET 'https://shorturl.is/api/qr?limit=2&page=1' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": "0",
    "data": {
        "result": 2,
        "perpage": 2,
        "currentpage": 1,
        "nextpage": 1,
        "maxpage": 1,
        "qrs": [
            {
                "id": 2,
                "link": "https:\/\/shorturl.is\/qr\/a2d5e",
                "scans": 0,
                "name": "Google",
                "date": "2020-11-10 18:01:43"
            },
            {
                "id": 1,
                "link": "https:\/\/shorturl.is\/qr\/b9edfe",
                "scans": 5,
                "name": "Google Canada",
                "date": "2020-11-10 18:00:25"
            }
        ]
    }
}

Get a single QR Code

GET https://shorturl.is/api/qr/:id

Get the details of a single QR code.

curl --location --request GET 'https://shorturl.is/api/qr/:id' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "details": {
        "id": 1,
        "link": "https:\/\/shorturl.is\/qr\/b9edfe",
        "scans": 5,
        "name": "Google Canada",
        "date": "2020-11-10 18:00:25"
    },
    "data": {
        "clicks": 1,
        "uniqueClicks": 1,
        "topCountries": {
            "Unknown": "1"
        },
        "topReferrers": {
            "Direct, email and other": "1"
        },
        "topBrowsers": {
            "Chrome": "1"
        },
        "topOs": {
            "Windows 10": "1"
        },
        "socialCount": {
            "facebook": 0,
            "twitter": 0,
            "instagram": 0
        }
    }
}

Create a QR Code

POST https://shorturl.is/api/qr/add

To create a QR code, send a POST request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.

Parameter Description
type (required) One of: text, vcard, link, email, phone, sms or wifi
data (required) The data to put in the QR code. This is a string or an array, depending on the type.
background (optional) Background colour as RGB, for example rgb(255,255,255)
foreground (optional) Foreground colour as RGB, for example rgb(0,0,0)
logo (optional) Path to the logo, either PNG or JPG
name (optional) QR Code name
curl --location --request POST 'https://shorturl.is/api/qr/add' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "type": "link",
    "data": "https://google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https://site.com/logo.png",
    "name": "QR Code API"
}'

Server response

{
    "error": 0,
    "id": 3,
    "link": "https:\/\/shorturl.is\/qr\/a58f79"
}

Update QR Code

PUT https://shorturl.is/api/qr/:id/update

To update a QR code, send a PUT request with the data as JSON in the raw body, as shown in the example. The example includes every parameter you can send. You do not have to send them all: the table shows which are required.

Parameter Description
data (required) The data to put in the QR code. This is a string or an array, depending on the type.
background (optional) Background colour as RGB, for example rgb(255,255,255)
foreground (optional) Foreground colour as RGB, for example rgb(0,0,0)
logo (optional) Path to the logo, either PNG or JPG
curl --location --request PUT 'https://shorturl.is/api/qr/:id/update' \
  --header 'Authorization: Bearer YOURAPIKEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "type": "link",
    "data": "https://google.com",
    "background": "rgb(255,255,255)",
    "foreground": "rgb(0,0,0)",
    "logo": "https://site.com/logo.png"
}'

Server response

{
    "error": 0,
    "message": "QR has been updated successfully."
}

Delete a QR Code

DELETE https://shorturl.is/api/qr/:id/delete

To delete a QR code, you need to send a DELETE request.

curl --location --request DELETE 'https://shorturl.is/api/qr/:id/delete' \
  --header 'Authorization: Bearer YOURAPIKEY'

Server response

{
    "error": 0,
    "message": "QR Code has been deleted successfully."
}