⚙️

API Documentation

Simple REST API for generating and verifying secure temporary PINs

Generate PIN

POST /api/create

Request Body

{
  "email": "user@example.com"  // Required: Email to send PIN to
}

Response (200 OK)

{
  "message": "PIN created and email sent successfully",
  "pinId": "abc123...",  // 32 character hex string
  "expiresIn": "300 seconds"
}

• PIN will be sent to provided email address

• PIN expires after 5 minutes

• Store the pinId for verification

Verify PIN

POST /api/verify

Request Body

{
  "pinId": "abc123...",  // Required: PIN ID from generation
  "pin": "123456"       // Required: 6-digit PIN code
}

Response (200 OK)

{
  "valid": true,
  "message": "PIN verified successfully"
}

• Verifies if provided PIN matches stored PIN

• Returns 404 if PIN ID not found or expired

• Rate limited to prevent brute force attempts