# Delete Connected Account

## Deleting a connected account

<mark style="color:red;">`DELETE`</mark> `https://api2.ourpass.co/v1/business/subaccounts/:subAccountId`

#### Path Parameters

| Name                                           | Type   | Description                                                   |
| ---------------------------------------------- | ------ | ------------------------------------------------------------- |
| subAccountId<mark style="color:red;">\*</mark> | String | This is the unique ID of the connected account to be deleted. |

#### Headers

| Name                                     | Type   | Description                                                   |
| ---------------------------------------- | ------ | ------------------------------------------------------------- |
| apiKey<mark style="color:red;">\*</mark> | String | Pass your api key in the request header to authorise the call |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": true,
    "message": "Business Subaccount deleted"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}

```
curl --location --request DELETE 'https://user-api2-staging.ourpass.co/v1/business/subaccounts/1303' \
--header 'apiKey: {{apikey}}' \
--data-raw ''
```

{% endtab %}

{% tab title="Node.js" %}

```
var axios = require('axios');
var data = '';

var config = {
  method: 'delete',
  url: 'https://api2.ourpass.co/v1/business/subaccounts/1303',
  headers: { 
    'apiKey': '{{apikey}}'
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="PHP" %}

```
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api2.ourpass.co/v1/business/subaccounts/1303');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'apiKey' => '{{apikey}}'
));
$request->setBody('');
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}require "uri"
require "net/http"

url = URI("https://api2.ourpass.co/v1/business/subaccounts/1303")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["apiKey"] = "{{apikey}}"

response = https.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="Ruby" %}

```
require "uri"
require "net/http"

url = URI("https://api2.ourpass.co/v1/business/subaccounts/1303")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["apiKey"] = "{{apikey}}"

response = https.request(request)
puts response.read_body

```

{% endtab %}

{% tab title="Python" %}

```
import requests

url = "https://api2.ourpass.co/v1/business/subaccounts/1303"

payload = ""
headers = {
  'apiKey': '{{apikey}}'
}

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

print(response.text)

```

{% endtab %}
{% endtabs %}
