Skip to content

Remove an admin

DELETE/admins/{adminId}

Organization API · Organization Admins

Remove an admin by ID.

Required permissionaccount_management:write

Parameters

Name In Type Required Description
X-Organization-ID header string (uuid) Yes Organization ID.
adminId path string Yes Admin ID.

Request samples

curl -X DELETE "https://api.central.sophos.com/organization/v1/admins/<adminId>" -H "Authorization: Bearer <access-token>" -H "X-Organization-ID: <organization-id>"

import requests

response = requests.delete(
    "https://api.central.sophos.com/organization/v1/admins/<adminId>",
    headers={
        "Authorization": "Bearer <access-token>",
        "X-Organization-ID": "<organization-id>",
    },
)
print(response.json())

$headers = @{
    "Authorization" = "Bearer <access-token>"
    "X-Organization-ID" = "<organization-id>"
}
Invoke-RestMethod -Method DELETE -Uri "https://api.central.sophos.com/organization/v1/admins/<adminId>" -Headers $headers

package main

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

func main() {
    req, err := http.NewRequest("DELETE", "https://api.central.sophos.com/organization/v1/admins/<adminId>", nil)
    if err != nil {
        panic(err)
    }
    req.Header.Set("Authorization", "Bearer <access-token>")
    req.Header.Set("X-Organization-ID", "<organization-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.central.sophos.com/organization/v1/admins/<adminId>", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer <access-token>",
    "X-Organization-ID": "<organization-id>",
  },
});
const data = await response.json();
console.log(data);

Responses

200 — Requested admin already removed.

Response fields

deletedbooleanrequired
Whether it has been truly deleted.

Errors

Status Meaning
404 Can't find admin.
409 Can't remove last Super admin.
500 Internal server error.

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

Response examples

200

{
  "deleted": true
}

See the guide for a narrative walkthrough of this API.