> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.heyreach.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.heyreach.io/_mcp/server.

# DeleteLinkedInAccount

DELETE https://api//api/public/management/organizations/linkedin-accounts/{linkedInAccountId}?forceDelete=false

Delete a LinkedIn account by its ID. This soft-deletes the LinkedIn account.

- `forceDelete=false` (default): deletion fails with 400 if the account belongs to an active campaign.
- `forceDelete=true`: the account is removed from active campaigns and then deleted.

Requires the Master (Organization) API Key.

Reference: https://docs.heyreach.io/hey-reach-api/organization/linked-in-accounts/delete-linked-in-account

## Request

### Path parameters

- `linkedInAccountId` (string, required)

### Query parameters

- `forceDelete` (boolean, optional) — false: deletion fails if the account belongs to an active campaign. true: the account is removed from active campaigns and then deleted.

### Headers

- `X-API-KEY` (string, optional) — Master (Organization) API Key

## Examples

**SDK Code**

```python
import requests

url = "https://api//api/public/management/organizations/linkedin-accounts/123"

querystring = {"forceDelete":"false"}

headers = {"X-API-KEY": "<YOUR_MASTER_API_KEY>"}

response = requests.delete(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false';
const options = {method: 'DELETE', headers: {'X-API-KEY': '<YOUR_MASTER_API_KEY>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("X-API-KEY", "<YOUR_MASTER_API_KEY>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false")

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

request = Net::HTTP::Delete.new(url)
request["X-API-KEY"] = '<YOUR_MASTER_API_KEY>'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false")
  .header("X-API-KEY", "<YOUR_MASTER_API_KEY>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false', [
  'headers' => [
    'X-API-KEY' => '<YOUR_MASTER_API_KEY>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-API-KEY", "<YOUR_MASTER_API_KEY>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-KEY": "<YOUR_MASTER_API_KEY>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/management/organizations/linkedin-accounts/123?forceDelete=false")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```