Check whether a team can be deleted
Reports whether the team can be deleted right now, and lists everything standing in the way. Each blocker carries the error code the delete endpoint returns while it stands, how many rows it covers, and how it is cleared.
A blocker with resolution: "transfer" is cleared by naming another team
in the delete request's transfer_domains_to parameter. One with
resolution: "wait" clears itself once the work it names settles, and
nothing sent on the delete request resolves it. One with
resolution: "none" is final: the system team cannot be deleted at all.
The verdict is a point-in-time snapshot. Work started against the team after the check will block a delete that this endpoint reported as available.
Permissions
| Key type | Accepted | Permission required | Notes |
|---|---|---|---|
| Org API key | yes | team:write |
Checks teams in the key's org scope |
| Personal API key | yes | team:write |
Caller must have an active membership in the org identified by X-Org-ID, and be on the team |
Blockers
| Code | Resolution | Meaning |
|---|---|---|
| team.delete.system_team | none | The team is the organization's system team |
| team.delete.has_domains | transfer | The team is the primary owner of domains |
| team.delete.pending_orders | wait | Orders placed by the team have not settled |
| team.delete.running_imports | wait | A domain import the team started is still running |
| team.delete.referenced_by_change_rule | wait | A live change rule names the team |
| team.delete.referenced_by_pending_change | wait | A pending change is waiting on an approval from the team |
Error Codes
| Code | HTTP | Description |
|---|---|---|
| team.unauthorized | 401 | No valid credentials |
| team.invalid_id | 400 | Team id is malformed |
| team.forbidden | 403 | Team belongs to your org but you are not on it |
| team.no_org | 403 | The credentials carry no active organization |
| team.not_found | 404 | Team not found or belongs to another org |
| team.lookup_failed | 500 | Failed to look up team |
| team.deletion_check.failed | 500 | Failed to determine what blocks the delete |
Path Parameters
- Type: stringteam
_id requiredTeam ID
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
Request Example for get/teams/{team_id}/deletion-check
curl 'https://api.nametrust.com/teams/{team_id}/deletion-check'
{
"object": "team_deletion_check",
"team_id": "team_01h455vb4pex5vsknk084sn02q",
"deletable": false,
"blockers": [
{
"object": "team_deletion_blocker",
"code": "team.delete.has_domains",
"message": "The team is the primary owner of 42 domains.",
"count": 42,
"resolution": "transfer"
}
]
}