1. Docs
  2. API Reference
  3. Preview moving a node inside an organization

Preview moving a node inside an organization

POST/api/v1/organizations/{id}/nodes/{nodeId}/move/preview

Reports 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

Bearer TokenAuthorization Option A

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

API KeyX-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)

min 1

takenumber Optional

People per page (1-5000, default 20)

range 1–5000

qstring Optional

Only people whose name or email contains this, ignoring case

max length 200

directionenum Optional

Only the people gaining access, or only those losing it

one of "gains" · "loses"

permissionstring Optional

Only the people gaining or losing this permission key (with `direction`, only that side)

max length 200

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

  • dataNodeMovePreviewDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
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
  }'
Response
{
  "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"
      ]
    }
  }
}
Related endpoints
GETWhat the caller administers in an organization
GETList the organization's tree as the caller sees it
GETList who holds a role at a node in the organization
GETList who holds a permission at a node in the organization
GETSummarize who holds a role at a node in the organization
GETList the roles the caller may grant at a node
GETList the organization's members, for granting a role at a node
POSTGrant a role at a node beneath the organization
PATCHChange a grant in the organization
DELETETake a grant in the organization away
GETRead the schema an organization's tree follows
POSTCreate a node inside an organization
GETRead a node inside an organization
PATCHRename a node inside an organization
DELETEDelete a node inside an organization
POSTMove a node inside an organization
POSTPreview deleting a node inside an organization
GETList organizations
POSTCreate an organization
DELETEDelete every organization
GETGet an organization
PATCHUpdate an organization
DELETEDelete an organization
POSTPreview deleting an organization
GETGet an organization's authentication policy
PATCHUpdate an organization's authentication policy
GETList staff entries into an organization
POSTRegenerate the organization's SSO recovery codes
POSTStart a test sign-in on the organization's connection
GETRead the organization's test sign-in
GETList the organization's domain claims
POSTClaim a domain for the organization
POSTVerify one of the organization's domains
DELETERemove one of the organization's domain claims
GETList an organization's SSO connections
POSTBind an SSO connection to an organization
DELETEUnbind an SSO connection from an organization
GETList an organization's members
POSTAdd a member to an organization
DELETERemove a member from an organization
POSTReset a member's multi-factor authentication
GETList an organization's invitations
POSTInvite a member into an organization
GETList the roles an organization may assign
POSTCreate an organization's own role
DELETERevoke an organization invitation
GETGet an organization's SSO connection
POSTSet up an organization's SSO connection
PATCHChange an organization's SSO connection
DELETERemove an organization's SSO connection
POSTActivate an organization's SSO connection
POSTDisable an organization's SSO connection
POSTImport the identity provider's SAML metadata
GETList the connection's recent sign-ins
GETList the roles the organization's SSO sign-ins may arrive with
GETGet the service-provider values for an organization's SSO connection
GETGet an organization's directory connection
POSTCreate an organization's directory connection
DELETERemove an organization's directory connection
GETList an organization's directory-sync tokens
POSTMint a directory-sync token for an organization
POSTReplace a directory-sync token without an outage
DELETERevoke a directory-sync token
GETRecent directory-sync activity for an organization
GETList the roles an organization's directory may grant
PUTReplace the roles an organization's directory may grant
GETList an organization's integrations
POSTCreate an integration
GETList the roles an organization may give its integrations
GETGet one of an organization's integrations
PATCHRename, disable or enable an integration
DELETEDelete an integration
POSTRotate an integration's secret
GETList an integration's roles
POSTGive an integration a role
PATCHChange one of an integration's roles
DELETETake one of an integration's roles away
GETCount an organization's own roles
GETList the permissions a role editor may attach
GETGet one role an organization can use
PATCHRename or describe an organization's own role
DELETEDelete an organization's own role
PUTReplace an organization role's permissions
GETList the groups an organization's provider has pushed
PUTMap a pushed group to one of the available roles
DELETEClear a pushed group's role mapping
Was this page helpful?

Tell us how we can improve this guide.