← Back to Home

API Reference

Complete API documentation for developers

🔗 Base URL

All API endpoints are relative to: https://blockchain-evidence.onrender.com/api

Authentication

POST /auth/email-login

Authenticate user with email and password

{ "email": "user@example.com", "password": "your_password" }
POST /auth/email-register

Register a new user with email

{ "email": "user@example.com", "password": "your_password", "fullName": "John Doe", "role": "investigator" }
POST /auth/wallet-register

Register a new user with MetaMask wallet

{ "walletAddress": "0x...", "fullName": "John Doe", "role": "investigator", "department": "Crime Unit", "badgeNumber": "12345" }

Evidence Management

POST /evidence/upload

Upload evidence file to a case (multipart/form-data)

Parameter Type Description
file File Evidence file (max 100MB)
caseId String Target case ID
description String Evidence description
POST /evidence/{id}/download

Download evidence file with watermark

Uses POST instead of GET because the request includes a body payload with user wallet address for watermarking and audit logging purposes.

POST /evidence/bulk-export

Export multiple evidence files as ZIP archive

POST /evidence/verify-integrity

Verify file integrity using blockchain hash

User Management

GET /user/{wallet}

Get user information by wallet address

PUT /user/profile/{id}

Update user profile information

Admin Endpoints

These endpoints require administrator privileges.

GET /admin/users

List all registered users

POST /admin/create-user

Create a new user account

POST /admin/create-admin

Create a new admin user

POST /admin/delete-user

Deactivate a user account

Uses POST instead of DELETE because the request requires a body payload with adminWallet and targetWallet for authorization verification.

System

GET /health

Health check endpoint

// Response { "status": "ok", "timestamp": "2025-01-01T00:00:00Z" }
GET /notifications/{wallet}

Get user notifications by wallet address

Supported File Formats

Category Formats Max Size
Images JPEG, PNG, GIF 100MB
Videos MP4, AVI, MOV 100MB
Audio MP3, WAV, M4A 100MB
Documents PDF, DOC, DOCX, TXT 100MB
Archives ZIP, RAR 100MB