Preview deleting a node inside an organization
/api/v1/organizations/{id}/nodes/{nodeId}/delete/previewReports what deleting the node would remove, without deleting it: the same answer as POST /nodes/{id}/delete/preview (blockers, subtree_size, the assignments that go by role and who is left with no access, a page of the people whose assignments go, with the same query, the invitations revoked and the directory groups unmapped), authorized as the delete is. Read-only.
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 nodeIdstring 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/organizations/value/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.