1. Docs
  2. API Reference
  3. Preview deleting an organization

Preview deleting an organization

POST/api/v1/organizations/{id}/delete/preview

Reports what deleting the organization would remove, without deleting it: members, whose memberships end (the first 100 and the total); assignments_removed, every assignment in its tree; nodes_deleted, beneath it; roles, its own roles; invites, the pending invitations revoked, by email; domains, its verified domains; sso_bindings and sso_connections, the connections bound to it and owned by it, by name; machine_clients, by name; and directory, whether its directory connection goes. The same sets the delete removes. 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 empty lists. Read-only. Send version as If-Match on the delete. Requires the hierarchy.manage permission at the organization. Returns 404 when the id does not name a live organization in this Environment.

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

Responses

application/json

  • dataOrganizationDeletePreviewDto*

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/delete/preview" \
  -H "X-API-Key: $CANOPY_API_KEY"
Response
{
  "data": {
    "organization_id": "string",
    "version": 0,
    "people_named": false,
    "members": {
      "total": 0,
      "sample": [
        {
          "id": "string",
          "first_name": "string",
          "last_name": "string",
          "name": "string",
          "email": "string",
          "avatar_url": "string"
        }
      ]
    },
    "assignments_removed": 0,
    "nodes_deleted": 0,
    "roles": [
      {
        "id": "string",
        "name": "string"
      }
    ],
    "invites": {
      "total": 0,
      "names": [
        "string"
      ]
    },
    "domains": [
      "string"
    ],
    "sso_bindings": [
      "string"
    ],
    "sso_connections": [
      "string"
    ],
    "machine_clients": [
      "string"
    ],
    "directory": false
  }
}
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
POSTPreview moving 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
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.