API ReferenceUsers
Delete User
Soft-delete a user with a 30-day grace period, or force hard-delete immediately.
Endpoint
DELETE /v1/identities/{id}Base URL: https://api-id.avnology.net
Authentication: API Key or OAuth token with admin:users:write scope
By default, deletion is a soft-delete that moves the user to scheduled_deletion state with a 30-day grace period. During this period, the deletion can be cancelled. After the grace period, a 14-point cascade cleanup permanently removes all user data.
Set force=true to skip the grace period and hard-delete immediately (requires elevated admin permissions).
Request
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | User ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
force | boolean | No | Skip grace period, hard-delete immediately |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <api_key> |
If-Match | No | ETag for conditional delete |
Example Request
# Soft delete (30-day grace period)
curl -X DELETE "https://api-id.avnology.net/v1/identities/usr_4f18acec-2712-4be7-a9af-b063b4f6deba" \
-H "Authorization: Bearer ak_live_..."
# Force hard delete
curl -X DELETE "https://api-id.avnology.net/v1/identities/usr_4f18acec-2712-4be7-a9af-b063b4f6deba?force=true" \
-H "Authorization: Bearer ak_live_..."Response
Success (204 No Content)
No response body.
Errors
| Status | Code | Description |
|---|---|---|
| 404 | AVNOLOGY_AUTH_901 | User not found |
| 403 | AVNOLOGY_AUTH_100 | Insufficient permissions |
| 409 | AVNOLOGY_AUTH_903 | ETag mismatch |
Code Examples
JavaScript (fetch)
async function deleteUser(apiKey, userId, force = false) {
const url = `https://api-id.avnology.net/v1/identities/${userId}${force ? '?force=true' : ''}`;
await fetch(url, { method: 'DELETE', headers: { 'Authorization'
Python (httpx)
import httpx
def delete_user(api_key: str, user_id: str, force: bool = False) -> None:
params = {"force": "true"}
Go (net/http)
func deleteUser(ctx context.Context, apiKey, userID string, force bool) error {
u := fmt.
Related
- Disable User -- deactivate without deleting
- Get User -- check deletion status
- SDK:
client.admin.deleteUser(userId)(TypeScript)