Preview deleting a node
/api/v1/nodes/{id}/delete/previewReports what deleting the node would remove, without deleting it. blockers lists what would refuse the delete (the root node, or an organization node, which is deleted through the organizations API); when any is listed nothing else is counted. Otherwise: subtree_size, the node and every node beneath it; roles, the role assignments made in the subtree counted by role, and assignments_total; identities_affected, and identities_losing_all_access, those holding no assignment anywhere else in the Environment; invites, the pending invitations there, by email; and directory_groups, the directory groups mapped there, by name. The same sets the delete removes. people is one page of the holders whose assignments go, one row per person by name, with via, their assignments that go as role at node, and pagination; q (name or email), role_id, page and take (up to 5000) narrow the page and never the counts. People are named only for a reader who may see the Environment's people (people_named: env_identities.view in the Console, and production_identities.access in a production Environment; identity.view for an API key; access administration at the node for a tenant's administrator); anyone else gets the counts and an empty page, whatever the query. Read-only. Send version as If-Match on the delete. Gated as the delete is: hierarchy.manage on the node. Returns 404 when the node is not found in this Environment.
Authentication
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
X-API-Key Option B API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.
Path Parameters
idstring Required Query Parameters
pagenumber Optional Page of people (1-based)
takenumber Optional People per page (1-5000, default 20)
qstring Optional Only people whose name or email contains this, ignoring case
role_idstring · uuid Optional Only the people holding this role in the subtree
Responses
application/json
data *NodeDeletePreviewDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X POST "https://auth.canopy-io.com/api/v1/nodes/value/delete/preview?page=0&take=0&q=value&role_id=value" \ -H "X-API-Key: $CANOPY_API_KEY"
{ "data": { "node_id": "string", "version": 0, "people_named": false, "blockers": [ { "code": "hierarchy.reparent_cycle", "message": "string" } ], "subtree_size": 0, "identities_affected": 0, "identities_losing_all_access": 0, "roles": [ { "role": { "id": "string", "name": "string" }, "assignments": 0, "identities": 0 } ], "assignments_total": 0, "people": { "items": [ { "identity": { "id": "string", "first_name": "string", "last_name": "string", "name": "string", "email": "string", "avatar_url": "string" }, "via": [ { "role": {}, "node": {} } ] } ], "pagination": { "page": 0, "take": 0, "item_count": 0, "page_count": 0, "has_previous_page": false, "has_next_page": false } }, "invites": { "total": 0, "names": [ "string" ] }, "directory_groups": { "total": 0, "names": [ "string" ] } } }
Tell us how we can improve this guide.