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 Dashboard2. 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/tokenPOST
/v1/auth/refreshDELETE
/v1/auth/revokeUsers
GET
/v1/usersGET
/v1/users/:idPOST
/v1/usersPATCH
/v1/users/:idDELETE
/v1/users/:idSessions
GET
/v1/sessionsGET
/v1/sessions/:idDELETE
/v1/sessions/:idDELETE
/v1/users/:id/sessionsWebhooks
GET
/v1/webhooksPOST
/v1/webhooksPATCH
/v1/webhooks/:idDELETE
/v1/webhooks/:idCode 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.
| Plan | Rate Limit | Burst Limit |
|---|---|---|
| Starter | 100/minute | 200 |
| Professional | 500/minute | 1,000 |
| Enterprise | 2,000/minute | 5,000 |
Official SDKs
Use our official SDKs for faster integration in your preferred language.
JavaScriptPythonRubyPHPGo