Deleting a short URL

Instructions on how to remove an existing short link

To delete an existing short link

  1. Create a secret API key from the Integrations and API menu: https://app.short.io/settings/integrations/api-key
  2. Get the ID of the short link which you want to delete:
  • In the Short.io Dashboard open the link for editing:
  • Copy the link ID from your browser's address bar:
  1. Install prerequisites for requests (if necessary, depending on your programming language):
pip install requests
  1. Using the code snippet below, create a file: filename.py/ .js/ .rb

📘

Please replace LINK_ID and APIKEY with the appropriate values.

import requests

url = "https://api.short.io/links/LINK_ID"

headers = {'authorization': '<<apiKey>>'}

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

print(response.text)
const data = {
  "link_id":'LINK_ID'
};

const options = {
  headers: {
    accept: 'application/json',
    'content-type': 'application/json',
    authorization: '<<apiKey>>'
  },
  method: "delete",
  body: JSON.stringify(data)
};

const response = await fetch('https://api.short.io/links/LINK_ID', options)
console.log(await response.json());
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.short.io/links/LINK_ID")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["authorization"] = 'API_KEY'

response = http.request(request)
puts response.read_body
  1. Launch the file:
python filename.py
node filename.js
ruby filename.rb
  1. The JSON response should be "success": true, idString: 'LINK_ID' :
{
  "success": true,
  idString: 'LINK_ID'
}

Most important key in the response is idString.