DELETE
/
auth
/
proxy
curl -X DELETE https://api.electronhub.ai/v1/auth/proxy \
  -H "Authorization: Bearer $ELECTRONHUB_API_KEY"
{
  "message": "Proxy keys deleted"
}
curl -X DELETE https://api.electronhub.ai/v1/auth/proxy \
  -H "Authorization: Bearer $ELECTRONHUB_API_KEY"
{
  "message": "Proxy keys deleted"
}

Overview

Delete all proxy keys associated with your account in a single operation. This is useful for bulk cleanup, security incidents, or account reset scenarios.

Irreversible Action: This permanently deletes ALL proxy keys. This action cannot be undone, and all deleted keys will immediately stop working.

Important Considerations

Before Bulk Deletion

Make sure to:

  1. Audit Current Keys: Use List Proxy Keys to review what will be deleted
  2. Update Applications: Remove or replace proxy keys in all applications
  3. Backup Configurations: Save key settings if you might need to recreate them
  4. Notify Team: Inform team members who might be using the keys
  5. Check Dependencies: Verify no critical services depend on the proxy keys

Example Workflow

Python - Safe Bulk Deletion
import httpx

def safe_bulk_delete_proxy_keys(api_key: str) -> dict:
    """Safely delete all proxy keys with confirmation"""
    client = httpx.Client()
    
    # First, list current keys for confirmation
    list_response = client.get(
        "https://api.electronhub.ai/v1/auth/proxy",
        headers={"Authorization": f"Bearer {api_key}"}
    )
    proxy_keys = list_response.json()
    
    if not proxy_keys:
        print("No proxy keys to delete")
        return {"message": "No proxy keys found"}
    
    print(f"Found {len(proxy_keys)} proxy keys:")
    for key in proxy_keys:
        print(f"  - {key['name']} ({key['key']})")
    
    # Confirm deletion
    confirm = input("Delete ALL proxy keys? (type 'DELETE' to confirm): ")
    if confirm != "DELETE":
        print("Deletion cancelled")
        return {"message": "Deletion cancelled"}
    
    # Perform bulk deletion
    delete_response = client.delete(
        "https://api.electronhub.ai/v1/auth/proxy",
        headers={"Authorization": f"Bearer {api_key}"}
    )
    
    result = delete_response.json()
    print(f"Bulk deletion completed: {result['message']}")
    return result

# Execute safe bulk deletion
result = safe_bulk_delete_proxy_keys(api_key)

Use Cases

Security Incident

Quickly revoke all delegated access during a security breach

Account Reset

Clean slate when restructuring API access patterns

Project Cleanup

Remove all temporary keys after project completion

Key Rotation

Part of a complete key rotation strategy

Alternative Approaches

Consider these alternatives before using bulk deletion:

Error Codes

401
error

Unauthorized - Invalid or missing API key

403
error

Forbidden - API key doesn’t have permission to delete proxy keys

429
error

Rate Limited - Too many requests, please slow down

Authorizations

Authorization
string
header
required

Enter your API key (starts with 'ek-')

Response

200 - application/json

Success

The response is of type object.