> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a Team

> Delete a team by ID, with soft/hard delete options

# Delete a Team

Delete a team by ID. Supports soft delete (default), hard delete, and restore operations.

## Delete by ID

**id** `string` *required*

UUID of the team to delete.

**recursive** `boolean` (default: false)

Recursively delete child entities.

**hardDelete** `boolean` (default: false)

Permanently delete the team. If `false`, the team is soft-deleted and can be restored.

## Restore a Soft-Deleted Team

Use `PUT /v1/teams/restore` to restore a soft-deleted team.

**id** `string` *required*

UUID of the soft-deleted team to restore.

```python DELETE /v1/teams/{id} theme={null}
from metadata.sdk import configure
from metadata.sdk.entities import Teams

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)

# Soft delete by ID
Teams.delete("449b5f25-4cbb-42db-8f71-3be2c5cd888a")

# Hard delete
Teams.delete(
    "449b5f25-4cbb-42db-8f71-3be2c5cd888a",
    hard_delete=True
)

# Delete by name
Teams.delete(Teams.retrieve_by_name("Accounting").id)

# Delete by name with options
Teams.delete(
    Teams.retrieve_by_name("Accounting").id,
    hard_delete=True
)

# Restore a soft-deleted team
Teams.restore("449b5f25-4cbb-42db-8f71-3be2c5cd888a")
```

```java DELETE /v1/teams/{id} theme={null}
import java.util.Map;

// client is an initialized OpenMetadataClient.
var id = "449b5f25-4cbb-42db-8f71-3be2c5cd888a";

// Soft delete
client.teams().delete(id);

// Restore
client.teams().restore(id);

// Hard delete
client.teams().delete(id, Map.of("hardDelete", "true"));

// Delete by name: look up the ID first
var team = client.teams().getByName("Accounting");
client.teams().delete(team.getId().toString());
```

```bash DELETE /v1/teams/{id} theme={null}
# Soft delete by ID
curl -X DELETE "{base_url}/api/v1/teams/449b5f25-4cbb-42db-8f71-3be2c5cd888a" \
  -H "Authorization: Bearer {access_token}"

# Hard delete
curl -X DELETE "{base_url}/api/v1/teams/449b5f25-4cbb-42db-8f71-3be2c5cd888a?hardDelete=true" \
  -H "Authorization: Bearer {access_token}"

# Restore soft-deleted team
curl -X PUT "{base_url}/api/v1/teams/restore" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{"id": "449b5f25-4cbb-42db-8f71-3be2c5cd888a"}'
```

```json Response (Soft Delete) theme={null}
{
  "id": "449b5f25-4cbb-42db-8f71-3be2c5cd888a",
  "teamType": "Group",
  "name": "Accounting",
  "fullyQualifiedName": "Accounting",
  "version": 0.2,
  "updatedAt": 1769982623753,
  "updatedBy": "admin",
  "parents": [
    {
      "id": "4f87a3ea-d798-4509-8c64-5b11f8a96f89",
      "type": "team",
      "name": "Finance",
      "fullyQualifiedName": "Finance"
    }
  ],
  "deleted": true,
  "owners": [],
  "domains": [],
  "children": [],
  "policies": []
}
```

***

## Returns

Soft delete returns the team object with `deleted: true`. Hard delete returns no content (204). Restore returns the restored team object.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to delete this team |
| `404` | `NOT_FOUND` | Team with given ID does not exist |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.