API Reference

Complete API documentation for issuing and verifying documents.

Issue Document

Create a new blockchain-anchored document.

POST /api/documents
1const response = await fetch("https://api.watheeq.app/v1/documents", {
2 method: "POST",
3 headers: {
4 "Authorization": "Bearer YOUR_API_KEY",
5 "Content-Type": "application/json"
6 },
7 body: JSON.stringify({
8 subjectName: "Abdullah Al-Saud",
9 subjectId: "1029384756",
10 category: "security_clearance",
11 issuedAt: "2024-01-15",
12 expiresAt: "2025-01-15",
13 metadata: {
14 access_level: "RESTRICTED_AREA_A"
15 }
16 })
17});
18
19const { publicId, qrCodeUrl } = await response.json();

Verify Document

Verify a document using its public ID.

GET /api/verify
1const response = await fetch(
2 "https://api.watheeq.app/v1/verify?publicId=WTQ-ABC123XYZ",
3 {
4 headers: {
5 "Authorization": "Bearer YOUR_API_KEY"
6 }
7 }
8);
9
10const { valid, document, blockchainProof } = await response.json();

Response Format

All API responses follow this structure:

response.json
1{
2 "success": true,
3 "data": {
4 "publicId": "WTQ-ABC123XYZ",
5 "subjectName": "Abdullah Al-Saud",
6 "category": "security_clearance",
7 "issuedAt": "2024-01-15T00:00:00Z",
8 "blockchainHash": "0x7f9...2b1a",
9 "qrCodeUrl": "https://api.watheeq.app/qr/WTQ-ABC123XYZ"
10 }
11}