API Reference

SecurePie REST API

Build custom integrations with our comprehensive REST API. Manage users, sessions, and configurations programmatically.

https://api.securepie.com/v1

Quick Start

1. Get Your API Keys

Navigate to Settings → API Keys in your SecurePie dashboard to create a new API key pair.

Go to Dashboard

2. Authenticate

Exchange your API key for an access token. Include the token in all subsequent requests.

Authorization: Bearer your_access_token

Authentication

All API requests require authentication. First, exchange your API key and secret for an access token, then include the token in the Authorization header of all requests.

Token Lifetime

  • • Access tokens expire after 1 hour
  • • Use refresh tokens to get new access tokens
  • • Refresh tokens expire after 30 days
JavaScript
// Authenticate with API key
const response = await fetch('https://api.securepie.com/v1/auth/token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    api_key: 'sk_live_your_api_key',
    api_secret: 'your_api_secret',
  }),
});

const { access_token, expires_in } = await response.json();

API Endpoints

Authentication

POST/v1/auth/token
POST/v1/auth/refresh
DELETE/v1/auth/revoke

Users

GET/v1/users
GET/v1/users/:id
POST/v1/users
PATCH/v1/users/:id
DELETE/v1/users/:id

Sessions

GET/v1/sessions
GET/v1/sessions/:id
DELETE/v1/sessions/:id
DELETE/v1/users/:id/sessions

Webhooks

GET/v1/webhooks
POST/v1/webhooks
PATCH/v1/webhooks/:id
DELETE/v1/webhooks/:id

Code Examples

List Users

// List users with pagination
const response = await fetch('https://api.securepie.com/v1/users?limit=20&offset=0', {
  headers: {
    'Authorization': 'Bearer your_access_token',
  },
});

const { users, total, has_more } = await response.json();

Create User

// Create a new user
const response = await fetch('https://api.securepie.com/v1/users', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your_access_token',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'user@example.com',
    first_name: 'John',
    last_name: 'Doe',
    sso_provider: 'google',
    external_id: 'google_user_123',
  }),
});

const user = await response.json();

Rate Limits

API rate limits vary by plan. When you exceed the limit, you'll receive a 429 Too Many Requests response.

PlanRate LimitBurst Limit
Starter100/minute200
Professional500/minute1,000
Enterprise2,000/minute5,000

Official SDKs

Use our official SDKs for faster integration in your preferred language.

JavaScriptPythonRubyPHPGo