> This page is for Developers.

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

# Bulk delete endpoints

DELETE https://iot.telia.lt/api/v2/endpoint/multi
Content-Type: application/json

Deletes a list of endpoints in bulk, along with all child entities.

Unlike [`DELETE /api/v1/endpoint/{endpoint_id}`](/developers/api/endpoint/endpoint-by-id-delete), this bulk endpoint handles multiple endpoints safely in a single request without sequential execution constraints between individual endpoints.

Execute bulk operations sequentially - wait for each bulk request to complete before starting the next.

If a SIM is assigned to one of the endpoints, it's released and suspended.
If the `delete_sims` query parameter is set to `true`, the SIMs are also deleted.

Reference: https://docs.iot.telia.lt/developers/api/endpoint/bulk-delete-endpoint

## Authentication

- `Authorization` header (bearer token, required) — An `auth_token` should be provided to authenticate a session. To obtain an `auth_token`, see the [`/api/v1/authenticate` **POST** request](/developers/api/authentication/authenticate).

## Request

### Query parameters

- `delete_sims` (boolean, optional, default: false) — If `true`, the SIMs will be deleted along with the endpoints. If `false`, the SIMs will only be suspended. Defaults to `false`.

### Body (application/json)

This endpoint expects a list of ApiV2EndpointMultiDeleteRequestBodyContentApplicationJsonSchemaItems.

- `list of ApiV2EndpointMultiDeleteRequestBodyContentApplicationJsonSchemaItems`

## Response

### 204

Endpoints deleted successfully

## Errors

### 400 Bad Request Error

Request body is malformed

- `any`

### 403 Forbidden Error

User doesn't have permission to bulk delete endpoints

- `any`

### 404 Not Found Error

Requested endpoint ID isn't found

- `any`

## Types

### ApiV2EndpointMultiDeleteRequestBodyContentApplicationJsonSchemaItems

- `id` (double, required)

## Examples

**Request**

```json
[
  {
    "id": 123456
  },
  {
    "id": 987654
  }
]
```

**SDK Code**

```python BulkDeleteEndpointExample
import requests

url = "https://iot.telia.lt/api/v2/endpoint/multi"

payload = [{ "id": 123456 }, { "id": 987654 }]
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript BulkDeleteEndpointExample
const url = 'https://iot.telia.lt/api/v2/endpoint/multi';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '[{"id":123456},{"id":987654}]'
};

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

```go BulkDeleteEndpointExample
package main

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

func main() {

	url := "https://iot.telia.lt/api/v2/endpoint/multi"

	payload := strings.NewReader("[\n  {\n    \"id\": 123456\n  },\n  {\n    \"id\": 987654\n  }\n]")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://iot.telia.lt/api/v2/endpoint/multi")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n  {\n    \"id\": 123456\n  },\n  {\n    \"id\": 987654\n  }\n]"

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

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

HttpResponse<String> response = Unirest.delete("https://iot.telia.lt/api/v2/endpoint/multi")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"id\": 123456\n  },\n  {\n    \"id\": 987654\n  }\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://iot.telia.lt/api/v2/endpoint/multi', [
  'body' => '[
  {
    "id": 123456
  },
  {
    "id": 987654
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp BulkDeleteEndpointExample
using RestSharp;

var client = new RestClient("https://iot.telia.lt/api/v2/endpoint/multi");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"id\": 123456\n  },\n  {\n    \"id\": 987654\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift BulkDeleteEndpointExample
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [["id": 123456], ["id": 987654]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://iot.telia.lt/api/v2/endpoint/multi")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```