API Documentation
Complete REST API for managing sites, users, and authentication sessions. Build powerful integrations with Signin.fast's authentication platform.
API Not Required for Basic Integration
You don't need this API to integrate Signin.fast with your site. Our standard integration works with simple redirects and callbacks - no API calls required!
This API is for advanced use cases:
• Programmatically managing your user data
• Onboarding existing users into Signin.fast
• Building custom dashboards and analytics
• Exporting or migrating your user data
Quick Start
Get your API token from your account dashboard and start making requests:
Table of Contents
Authentication
All API requests require authentication using a Bearer token. You can find your API token in your account dashboard.
Security Notes
- Keep your API token secure and never expose it in client-side code
- All API requests are made over HTTPS
- API tokens are scoped to your account - you can only access your own data
- Tokens do not expire but can be regenerated in your dashboard
Embed Widget Integration
The easiest way to integrate Signin.fast is with our JavaScript embed widget. No API calls required!
Recommended Integration Method
Use the embed widget for most integrations. It provides a clean modal interface that works with any website and handles all authentication flows automatically.
Benefits of the embed widget:
• No backend integration required
• Clean modal interface that doesn't navigate away
• Works with React, Vue, and any JavaScript framework
• Automatic CSRF protection and security
• Mobile responsive design
Basic Integration
Add one script tag to your website. No visible UI is added until triggered:
Programmatic Control
Use these JavaScript methods when you want to control the modal flow yourself, without using the automatic data attributes or CSS class approach:
When to Use Programmatic Control
Most integrations don't need this. The widget automatically binds to elements with data-signin-fast attributes or CSS classes like .signin-fast-login.
Use programmatic control when you need to:
• Trigger authentication from custom JavaScript logic
• Integrate with complex UI frameworks or state management
• Control modal timing based on user interactions
• Handle authentication within existing event handlers
Authentication Flow & Callback Handling
After successful authentication via the embed widget, users are redirected to your site's callback URL with an authentication token.
Callback URL Setup
Configure your success callback URL in your site settings (e.g., https://yoursite.com/auth/callback). After authentication, users will be redirected to:
Token Exchange
Exchange the token for user information on your backend:
Complete Flow Example
Security Best Practices
• Always exchange tokens on your backend - Never expose API tokens to the client
• Mark tokens as used immediately - Prevents replay attacks
• Validate tokens server-side - Don't trust client-side authentication
• Handle token expiration - Tokens are valid for a limited time
React Integration
Use the embed widget in React applications:
Vue.js Integration
Use the embed widget in Vue applications:
Framework Compatibility
The widget automatically works with:
- Turbo (Rails 7+): Automatically re-binds after navigation
- htmx: Automatically detects content swaps
- React/Vue/Angular: Works with all modern frameworks
- Dynamic Content: Uses MutationObserver to detect new elements
Custom Styling
Override widget styles to match your brand:
Complete Documentation
For complete embed widget documentation, examples, and advanced configuration options, visit our Embed Widget Documentation.
Sites API
Manage your authentication sites programmatically.
Retrieve a list of all sites in your account.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search |
string | optional | Search sites by name |
slug |
string | optional | Filter by specific slug |
Example Response
Create a new site in your account.
Request Body
Site Users API
Manage users across your sites with full CRUD operations.
Retrieve a paginated list of users across all sites or filtered by specific site.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
site_id |
integer | optional | Filter users by specific site |
search |
string | optional | Search users by email |
page |
integer | optional | Page number (default: 1) |
per_page |
integer | optional | Items per page (default: 25, max: 100) |
Create a new user for a specific site.
Request Body
Site User Sessions API
Manage authentication sessions and track user login activity.
Retrieve authentication sessions with flexible filtering options.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
site_user_id |
integer | optional | Filter by specific user |
site_id |
integer | optional | Filter by specific site |
used |
boolean | optional | Filter by session usage status |
Mark a session as used for security tracking.
Example Response
Error Handling
The API returns appropriate HTTP status codes and detailed error messages.
HTTP Status Codes
| Status Code | Description |
|---|---|
200 |
Success |
201 |
Created |
400 |
Bad Request |
401 |
Unauthorized |
404 |
Not Found |
422 |
Unprocessable Entity |