---
title: "Delete another user's account and all associated data (admin only)."
method: DELETE
path: "/api/v1/user/{user}"
---

# Delete another user's account and all associated data (admin only).

`DELETE /api/v1/user/{user}`

**Authentication**: JWT token required
**Authorization**: Admin level access required (ADMIN or SUPERADMIN)
**Warning**: This action is irreversible and deletes all user data

**Path Parameters**:
- `user`: User identifier (email address or numeric ID) to delete

**Protection**: Cannot delete protected admin accounts configured via
API_ENVIRONMENT_USER

**Deletion Process**:
- Cancels all running executions for the target user
- Deletes all execution history and logs
- Removes user-created scripts (if user is owner)
- Deletes user profile and authentication data
- Revokes all active sessions and tokens
- Removes user from any Google Groups (if enabled)
- Transfers or deletes shared resources

**Success Response Schema**:
```json
{
  "data": {
    "id": "user-456",
    "email": "user@example.com",
    "name": "John Doe",
    "role": "USER",
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T14:30:00Z",
    "deleted_at": "2025-01-15T14:30:00Z",
    "deleted_by": "admin-123",
    "status": "DELETED"
  }
}
```

**Administrative Features**:
- Action is logged with admin user who performed deletion
- All user data is permanently removed
- User's scripts and executions are cleaned up
- Email address becomes available for re-registration

**Data Cleanup**:
- User profile information permanently deleted
- Execution history and logs removed
- Script ownership transferred or scripts deleted
- Session tokens invalidated immediately
- Audit logs maintain record of deletion action

**Use Cases**:
- Account cleanup and user management
- Compliance with data retention policies
- Removing inactive or problematic accounts
- GDPR "right to erasure" compliance

**Error Responses**:
- `401 Unauthorized`: JWT token required
- `403 Forbidden`: Admin access required or cannot delete system admin
- `404 Not Found`: User does not exist
- `500 Internal Server Error`: Account deletion failed

## Path parameters

- `user` string, required

## Response `200`

Success

- object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/trends/apis/trends-earth-api.md) · [All operations](https://skmtc.dev/trends/apis/trends-earth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trends/trends-earth-api/revisions/6bdbc0b84666/schema)
