Preview moving a node inside an organization
/api/v1/organizations/{id}/nodes/{nodeId}/move/previewReports what moving the node beneath parent_node_id would change, without moving it: the same answer as POST /nodes/{id}/move/preview (blockers, subtree_size, the counts per key and a page of the holders gaining and losing keys at the node, with the same query, and the invitations and directory groups that move with the subtree), authorized as the move 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
directionenum Optional Only the people gaining access, or only those losing it
permissionstring Optional Only the people gaining or losing this permission key (with `direction`, only that side)
Request body
application/json
parent_node_idstring Required parent_versionnumber Optional The destination's `version`, as the move's preview read it: the move answers `409 version_mismatch` when the destination has changed since
Responses
application/json
data *NodeMovePreviewDto
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/move/preview?page=0&take=0&q=value&direction=gains&permission=value" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "parent_node_id": "string", "parent_version": 0 }'
{ "data": { "blockers": [ { "code": "hierarchy.reparent_cycle", "message": "string" } ], "people_named": false, "identities_gaining": 0, "identities_losing": 0, "permissions": [ { "permission": "string", "gaining": 0, "losing": 0 } ], "people": { "items": [ { "identity": { "id": "string", "first_name": "string", "last_name": "string", "name": "string", "email": "string", "avatar_url": "string" }, "gained": [ "string" ], "lost": [ "string" ], "via": [ { "role": {}, "node": {} } ] } ], "pagination": { "page": 0, "take": 0, "item_count": 0, "page_count": 0, "has_previous_page": false, "has_next_page": false } }, "node_id": "string", "parent_node_id": "string", "version": 0, "parent_version": 0, "subtree_size": 0, "invites": { "total": 0, "names": [ "string" ] }, "directory_groups": { "total": 0, "names": [ "string" ] } } }
Tell us how we can improve this guide.