---
updatedAt: 2025-11-05T21:11:36.000Z
agentTools:
  projectIndex: https://developers.short.io/llms.txt
---

# Deleting a Domain

This method deletes a domain from your Short.io account

> 📘 Information below might be outdated - please visit our recently updated [API Reference](https://developers.short.io/reference/)

The instruction below shows how to delete a domain from your Short.io account

### **1)** Get your secret API key here: <https://app.short.io/settings/integrations/api-key>

* Click "Create API key".
* Add a **Secret** key.

![](https://files.readme.io/eb77928-Screen_Shot_2021-08-11_at_2.57.06_PM.png "Screen Shot 2021-08-11 at 2.57.06 PM.png")

### **2)** Copy an ID of a domain you want to delete.

* Open Domain settings.
* Copy domain ID.

![](https://files.readme.io/7086052-dom-set.png "dom-set.png")

![](https://files.readme.io/bf52901-domain-id.png "domain-id.png")

### **3)** Install prerequisites for requests.

```python
pip install requests
```
```javascript Node.js
npm install --save axios
```

Now everything is ready to run the following snippet. It will delete a domain.

### **4)** Create a file: **filename.py/ .js/ .rb**. Use the code snippet below.

> 📘
>
> Please, replace domainID with appropriate value.

```python
import requests

url = "https://api.short.io/domains/delete/domainID"

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

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

print(response.text)
```
```javascript Node.js
const axios = require('axios');

const options = {
    headers: {
      accept: 'application/json',
      'content-type': 'application/json',
      authorization: '<<apiKey>>'
    }
  };

  axios.post('https://api.short.io/domains/delete/domainID', '', options)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (response) {
    console.log(response);
  });
```
```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.short.io/domains/delete/domainID")

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

request = Net::HTTP::Post.new(url)
request["authorization"] = '<<apiKey>>'

response = http.request(request)
puts response.read_body
```

### **5)** Launch the file.

```python
python filename.py
```
```javascript Node.js
node filename.js
```
```ruby Ruby
ruby filename.rb
```

### **6)** JSON Response (the domain will be deleted).

Once you run the code, you will see the response.

```json
{ 
  success: true
}
```