Skip to content

Delete endpoints

POST/endpoints/delete

Endpoint API · Endpoints

Delete a list of endpoints.

Required permissionendpoint-computer:delete OR endpoint-server:delete

Parameters

Name In Type Required Description
X-Tenant-ID header string (uuid) Yes Tenant ID.

Request body

Content type: application/json

Request body fields

endpointIdsarray of string (uuid)required
Endpoint IDs to delete.
Must contain 1–1000 items. Items must be unique.

Request samples

curl -X POST "https://api-<data-region>.central.sophos.com/endpoint/v1/endpoints/delete" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>" -H "Content-Type: application/json" -d "{
  \"endpointIds\": [
    \"fcf47d9f-7ba6-4ac9-bda2-1d4f6de49c0f\",
    \"3d8ecdb5-37bf-4f26-b47b-1b185781ff9b\"
  ]
}"

import requests

response = requests.post(
    "https://api-<data-region>.central.sophos.com/endpoint/v1/endpoints/delete",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Tenant-ID": "<tenant-id>",
        "Content-Type": "application/json",
    },
    json={   'endpointIds': [   'fcf47d9f-7ba6-4ac9-bda2-1d4f6de49c0f',
                       '3d8ecdb5-37bf-4f26-b47b-1b185781ff9b']},
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Tenant-ID" = "<tenant-id>"
    "Content-Type" = "application/json"
}
$body = '{
  "endpointIds": [
    "fcf47d9f-7ba6-4ac9-bda2-1d4f6de49c0f",
    "3d8ecdb5-37bf-4f26-b47b-1b185781ff9b"
  ]
}'
Invoke-RestMethod -Method POST -Uri "https://api-<data-region>.central.sophos.com/endpoint/v1/endpoints/delete" -Headers $headers -Body $body -ContentType "application/json"

package main

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

func main() {
    req, err := http.NewRequest("POST", "https://api-<data-region>.central.sophos.com/endpoint/v1/endpoints/delete", strings.NewReader(`{
  "endpointIds": [
    "fcf47d9f-7ba6-4ac9-bda2-1d4f6de49c0f",
    "3d8ecdb5-37bf-4f26-b47b-1b185781ff9b"
  ]
}`))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Tenant-ID", "<tenant-id>")
    req.Header.Set("Content-Type", "application/json")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}

const response = await fetch("https://api-<data-region>.central.sophos.com/endpoint/v1/endpoints/delete", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "endpointIds": [
    "fcf47d9f-7ba6-4ac9-bda2-1d4f6de49c0f",
    "3d8ecdb5-37bf-4f26-b47b-1b185781ff9b"
  ]
}),
});
const data = await response.json();
console.log(data);

Responses

200 — Deleted endpoint IDs.

Response fields

endpointIdsarray of string (uuid)required
Endpoint IDs that have been queued for deletion.
Items must be unique.

Errors

Status Meaning
400 Bad request.
500 Unexpected error.

All error responses share the same shape — see the error response object.

Response examples

200

{
  "endpointIds": [
    "00000000-0000-0000-0000-000000000000"
  ]
}

See the guide for a narrative walkthrough of this API.