API Reference
zkID API
API reference for zkID identity operations
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API reference for zkID identity operations
POST /api/auth/register
{
"username": "alice",
"password": "secure_password_123",
"identityPublicKey": "base64_public_key",
"identityPrivateKeyEncrypted": "base64_encrypted",
"identityPrivateKeyIv": "base64_iv",
"kdfSalt": "base64_salt",
"kdfIterations": 200000
}
{
"message": "zkID created successfully",
"user": {
"id": "uuid",
"username": "alice",
"zkId": "did:zk:a7Bk9mX2pQ4r",
"identityPublicKey": "base64_public_key"
}
}
POST /api/auth/login
{
"username": "alice",
"password": "secure_password_123"
}
{
"message": "Login successful",
"user": {
"id": "uuid",
"username": "alice",
"zkId": "did:zk:a7Bk9mX2pQ4r"
}
}
POST /api/auth/logout
{
"message": "Logged out successfully"
}
GET /api/auth/session
{
"authenticated": true,
"user": {
"id": "uuid",
"username": "alice",
"zkId": "did:zk:a7Bk9mX2pQ4r",
"identityPublicKey": "base64_public_key"
}
}
{
"authenticated": false
}
POST /api/auth/upgrade-legacy
{
"identityPublicKey": "base64_public_key",
"identityPrivateKeyEncrypted": "base64_encrypted",
"identityPrivateKeyIv": "base64_iv",
"kdfSalt": "base64_salt",
"kdfIterations": 200000
}
POST /api/starknet/submit-proof
{
"zkId": "did:zk:a7Bk9mX2pQ4r",
"publicKey": "base64_public_key",
"signature": "base64_signature"
}
{
"success": true,
"txHash": "0x123...",
"contractAddress": "0x456..."
}
| Code | Description |
|---|---|
| 400 | Username already exists |
| 401 | Invalid credentials |
| 401 | Not authenticated |
| 409 | Proof already exists |
| 500 | Failed to create zkID |