Skip to content

Delete profiles

DELETE/profiles

Cloud Security API · runtime-detections

Delete profiles with provided IDs.

Required permissioncns_runtime_detection:write

Parameters

Name In Type Required Description
X-Tenant-ID header string (uuid) Yes Tenant ID.
profileIds query array of string (uuid) Yes List of runtime detection profile IDs to be deleted.
Must contain at most 500 items.

Request samples

curl -X DELETE "https://api-<data-region>.central.sophos.com/cloud-security/v1/profiles?profileIds=<profileIds>" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"

import requests

response = requests.delete(
    "https://api-<data-region>.central.sophos.com/cloud-security/v1/profiles?profileIds=<profileIds>",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Tenant-ID": "<tenant-id>",
    },
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method DELETE -Uri "https://api-<data-region>.central.sophos.com/cloud-security/v1/profiles?profileIds=<profileIds>" -Headers $headers

package main

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

func main() {
    req, err := http.NewRequest("DELETE", "https://api-<data-region>.central.sophos.com/cloud-security/v1/profiles?profileIds=<profileIds>", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Tenant-ID", "<tenant-id>")

    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/cloud-security/v1/profiles?profileIds=<profileIds>", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Tenant-ID": "<tenant-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Runtime detection profiles deleted successfully.

Response fields

skippedProfilesarray of string (uuid)
List of profile IDs not deleted because they're in use. Remove them from the deletion request and try again.

Errors

Status Meaning
400 Invalid request for deleting profiles.
401 Authentication failed.
403 Authorization failed.
500 Unexpected error.

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

Response examples

200

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

See the guide for a narrative walkthrough of this API.