Documentation
Getting Started/Getting Started

Getting Started

What is K-OTP?

K-OTP is a comprehensive OTP (One-Time Password) delivery service that helps you secure your applications with reliable verification codes. Whether you need SMS, email, or voice-based authentication, K-OTP provides the infrastructure you need.

Prerequisites

Before you begin, ensure you have:

  • A K-OTP account (sign up at k-otp.dev)
  • An active subscription plan
  • Basic knowledge of REST APIs
  • A development environment for testing

Step 1: Create Your Account

  1. Visit k-otp.dev and click "Sign Up"
  2. Complete the registration process
  3. Verify your email address
  4. Choose a subscription plan that fits your needs

Step 2: Generate API Keys

  1. Navigate to your dashboard
  2. Go to Settings > API Keys
  3. Click "Generate New Key"
  4. Copy and securely store your API key
  5. Configure allowed domains/IPs for security

Step 3: Send Your First OTP

Here's a simple example to send an SMS OTP:

const response = await fetch('https://api.k-otp.dev/v1/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: '+1234567890',
    method: 'sms',
    type: 'verification',
    template: 'default'
  })
});

const result = await response.json();
console.log('OTP ID:', result.id);

Step 4: Verify the OTP

Once the user receives the code, verify it:

const verifyResponse = await fetch('https://api.k-otp.dev/v1/verify', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    id: result.id,
    code: '123456' // Code entered by user
  })
});

const verifyResult = await verifyResponse.json();
if (verifyResult.valid) {
  console.log('OTP verified successfully!');
}

Testing Your Integration

We recommend testing with our sandbox environment first:

  • Use the test API endpoint: https://api-sandbox.k-otp.dev
  • Test phone numbers: +1555000XXXX
  • Test emails: [email protected]

Common Integration Patterns

User Registration Flow

  1. User enters phone number/email
  2. Send OTP for verification
  3. User enters received code
  4. Verify OTP and create account

Login with 2FA

  1. User enters username/password
  2. Send OTP as second factor
  3. User enters OTP code
  4. Verify and grant access

Password Reset

  1. User requests password reset
  2. Send OTP to registered contact
  3. Verify OTP
  4. Allow password change

Next Steps

Need Help?

  • Check our FAQ for common questions
  • Contact support at [email protected]
  • Join our developer community on Discord