API Documentation
Comprehensive API documentation for Zapier integration and third-party developers
Overview
The Rewiser API provides endpoints for managing financial transactions and folders through Zapier integrations. This documentation covers all API endpoints used in the Zapier integration with comprehensive examples and schemas.
Base URL: https://nzkqapsaeatytqrnitpj.supabase.co/functions/v1
Authentication
All API endpoints require authentication using API keys generated in the Rewiser application.
API Key Authentication
Authorization: Bearer {api_key}
Example:
Authorization: Bearer rwsk_live_YOUR_API_KEY_HERE
Getting API Keys
- Log in to your Rewiser account at app.rewiser.io
- Navigate to Settings > API Keys
- Generate a new API key for Zapier integration
- Copy the generated key (format:
rwsk_live_...
)
Rate Limits & Protection Systems
🛡️ Multi-Layer Protection
Our API implements several protection mechanisms to prevent automation loops and ensure data integrity:
1. Rate Limiting
Endpoint Type | Limit | Window | Description |
---|---|---|---|
General API | 1000 requests | 1 hour | Overall API usage limit |
Create Multiple Transactions | 20 requests | 5 minutes | Prevents automation loops |
Get Recent Transactions | 100 records | 1 hour | Trigger endpoint optimization |
Bulk Operations | 50 transactions | per request | Maximum batch size |
429
status with retry_after
seconds and detailed limit information. 2. Duplicate Detection System
Advanced duplicate protection prevents accidental data duplication and automation loops:
Database-Level Duplicate Detection (24-hour window)
- Exact Match Prevention: Blocks identical transactions within 24 hours
- Multi-field Comparison: Checks user_id, folder_id, name, amount, type, and planned_date
- Smart Recurring Support: Allows legitimate recurring payments with different dates
Request-Level Protection
- Request Fingerprinting: Prevents identical requests within 2 minutes
- Batch Duplicate Detection: Removes duplicates within the same request
- Memory Cache: Tracks recent requests to prevent re-submission
3. Intelligent Time Controls
Feature | Time Window | Purpose |
---|---|---|
Duplicate Detection | 24 hours | Prevent automation loops while allowing recurring payments |
Request Fingerprinting | 2 minutes | Block identical request re-submission |
Recent Transactions Trigger | 1 hour | Optimize Zapier polling frequency |
Rate Limit Reset | 5 minutes | Allow recovery from temporary rate limits |
4. Response Headers for Monitoring
X-Polling-Timestamp: 2025-06-12T10:30:00.000Z
X-Total-Count: 15
X-Time-Window: 1-hour
X-Rate-Limit-Remaining: 18
X-Rate-Limit-Reset: 2025-06-12T10:35:00.000Z
Endpoints
1. Authentication Verification
Endpoint: POST /verify-auth
Verifies the validity of an API key and returns user information.
Request
POST /verify-auth
Authorization: Bearer {api_key}
Content-Type: application/json
Response
{
"success": true,
"user": {
"id": "user_uuid_here",
"email": "user@example.com",
"full_name": "John Doe"
}
}
Error Responses
{
"success": false,
"error": "Unauthorized - Invalid or expired key"
}
Status Codes:
200
- Success401
- Invalid or expired API key
2. Get Recent Transactions (Zapier Trigger)
Endpoint: GET /get-recent-transactions
Retrieves transactions from the last 1 hour only. Optimized for Zapier triggers with automatic polling protection.
Authentication
Supports both authentication methods:
- Header:
Authorization: Bearer {api_key}
(recommended for Zapier) - Query Parameter:
?api_key={api_key}
(alternative method)
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
folder_mode | string | No | "all" | Filter mode: "all" or "single" |
type | string | No | null | Transaction type: "Expense", "Income", or null for all |
folder_id | string | No | null | Specific folder ID (required if folder_mode="single") |
format | string | No | "standard" | Response format: "standard" or "zapier" |
Request Examples
Get all recent transactions (Header auth):
GET /get-recent-transactions?format=zapier
Authorization: Bearer YOUR_API_KEY
Get expenses from all folders (Query auth):
GET /get-recent-transactions?api_key=YOUR_API_KEY&type=Expense
Get transactions from specific folder:
GET /get-recent-transactions?folder_mode=single&folder_id=YOUR_FOLDER_ID&format=zapier
Authorization: Bearer YOUR_API_KEY
Response (Standard Format)
{
"success": true,
"count": 3,
"timestamp": "2025-06-12T10:30:00.000Z",
"data": [
{
"id": "transaction_uuid_here",
"name": "Notion Subscription",
"amount": 19.99,
"type": "Expense",
"created_at": "2025-06-11T19:44:44.109694+00:00",
"folder_id": "folder_uuid_here",
"is_paid": false,
"planned_date": "2025-06-15T22:44:00.000Z",
"note": "Monthly subscription"
}
]
}
Response (Zapier Format)
Add ?format=zapier
for Zapier-optimized response:
[
{
"id": "transaction_uuid_here",
"transaction_id": "transaction_uuid_here",
"name": "Notion Subscription",
"amount": 19.99,
"type": "Expense",
"created_at": "2025-06-11T19:44:44.109694+00:00",
"folder_id": "folder_uuid_here",
"is_paid": false,
"planned_date": "2025-06-15T22:44:00.000Z",
"note": "Monthly subscription",
"transaction_name": "Notion Subscription",
"amount_formatted": "19.99",
"status": "pending",
"has_planned_date": true,
"_sync_timestamp": "2025-06-12T10:30:00.000Z",
"_zapier_dedup_key": "transaction_uuid_here"
}
]
3. Create Multiple Transactions
Endpoint: POST /create_multiple_transactions
Creates multiple transactions in a single request with AI-powered data normalization and advanced duplicate protection.
Authentication
Header only: Authorization: Bearer {api_key}
Request Body
{
"transactions": [
{
"folder_id": "YOUR_FOLDER_ID",
"type": "Expense",
"name": "Notion",
"amount": 19.99,
"planned_date": "2025-06-16T00:00:00Z",
"is_paid": true,
"note": "June subscription"
}
]
}
Required Fields (for each transaction)
folder_id
(string): UUID of the target folder (get from /get-folders endpoint)type
(string): "Expense" or "Income" (supports variations like "expense", "spending", "income", "earning")name
(string): Transaction descriptionamount
(number/string): Transaction amount (positive, supports currency symbols)planned_date
(string): ISO 8601 date string or various formats (YYYY-MM-DD, DD/MM/YYYY, etc.)
Optional Fields
is_paid
(boolean/string): Payment status ("true", "false", "paid", "pending")paid_date
(string): Payment date (auto-filled with planned_date if is_paid=true)note
(string): Additional notesrepeat_type
(string): "monthly", "weekly", "yearly", "daily", or null
Response with Protection Details
{
"success": true,
"request_id": "req_uuid_here",
"inserted_count": 3,
"failed_count": 1,
"duplicate_count": 2,
"skipped_count": 1,
"total_processed": 7,
"timestamp": "2025-06-12T10:30:00.000Z",
"inserted": [
{
"id": "tx_uuid_1",
"name": "Office Supplies",
"amount": 29.99,
"type": "Expense",
"planned_date": "2025-06-16T10:00:00Z"
}
],
"duplicates": [
{
"index": 2,
"message": "Duplicate transaction detected (within last 24 hours)",
"duplicate_id": "existing_tx_uuid",
"transaction": {
"name": "Netflix Subscription",
"amount": 15.99,
"type": "Expense",
"planned_date": "2025-06-15T00:00:00Z"
}
}
],
"skipped": [
{
"index": 4,
"reason": "Duplicate within the same batch",
"transaction": {
"name": "Duplicate Entry",
"amount": 10.00,
"type": "Expense"
}
}
],
"rate_limit_info": {
"remaining_requests": 17,
"reset_time": "2025-06-12T10:35:00.000Z"
}
}
Limits & Protection
- Batch Limit: Maximum 50 transactions per request
- Rate Limit: 20 requests per 5 minutes (prevents automation loops)
- Request Fingerprinting: 2-minute cooldown for identical requests
- Duplicate Detection: 24-hour window for identical transactions
- AI Fallback: Automatic data correction for invalid inputs
- Data Normalization: Supports various input formats for amounts, dates, and types
4. Get Folders
Endpoint: GET /get-folders
Retrieves accessible folders for the authenticated user in Zapier dropdown format.
Request
GET /get-folders
Authorization: Bearer {api_key}
Response
[
{
"key": "folder_uuid_1",
"label": "Personal Finance"
},
{
"key": "folder_uuid_2",
"label": "Business Expenses"
}
]
Data Normalization & AI Support
The API includes intelligent data normalization for handling inconsistent input formats with built-in protection against automation errors:
Type Normalization
"expense"
,"expenses"
,"spending"
→"Expense"
"income"
,"incomes"
,"earnings"
→"Income"
Amount Normalization
- Removes currency symbols:
"$29.99"
→29.99
- Handles different decimal separators:
"29,99"
→29.99
- Converts negative to positive values
Date Normalization
- Various formats supported:
"2025-06-15"
,"2025/06/15"
,"2025.06.15"
- Automatically converts to ISO 8601 format
- Adds timezone if missing
AI Fallback with Protection
If automatic normalization fails, the system uses AI to:
- Analyze the problematic data while preserving original context
- Attempt intelligent correction following strict validation rules
- Maintain duplicate protection even for AI-corrected data
- Return normalized data or clear error messages with suggestions
- Log AI corrections for monitoring and debugging
AI Model: GPT-4o with temperature 0.1 for consistent, reliable corrections
Error Handling
Common Error Codes
Status Code | Description |
---|---|
200 | Success |
400 | Bad Request (invalid data) |
401 | Unauthorized (invalid API key) |
403 | Forbidden (access denied to resource) |
409 | Conflict (duplicate request detected) |
429 | Rate Limited (too many requests) |
500 | Internal Server Error |
Error Response Format
{
"error": "Error description",
"attempted_ai_fix": true,
"details": "Additional error details"
}
Rate Limit Error (429)
{
"error": "Rate limit exceeded. Please wait before making more requests.",
"retry_after": 300,
"rate_limit_info": {
"remaining_requests": 0,
"reset_time": "2025-06-12T10:35:00.000Z"
}
}
Duplicate Request Error (409)
{
"error": "Duplicate request detected",
"message": "The same request was sent recently. Please wait before retrying.",
"last_request_id": "req_uuid_here",
"wait_seconds": 45
}
Testing & Support
Test Account
A dedicated test account with full API access is provided to Zapier's review team during the integration approval process. Test credentials are shared privately during submission.
Example Integration Flows
Zapier Trigger: New Transaction (Optimized)
GET /get-recent-transactions?api_key=&format=zapier
This automatically fetches only the last 1 hour of transactions to prevent duplicate triggers.
Zapier Action: Create Transaction
POST /create_multiple_transactions
Authorization: Bearer
Content-Type: application/json
{
"transactions": [
{
"folder_id": "",
"type": "",
"name": "",
"amount": "",
"planned_date": "",
"is_paid": ""
}
]
}
Zapier Action: Bulk Create (Protected)
POST /create_multiple_transactions
Authorization: Bearer
Content-Type: application/json
{
"transactions": []
}
Includes automatic duplicate detection and rate limiting to prevent automation loops.
Best Practices for Zapier Integrations
- Use the trigger efficiently: 15-30 minute intervals are sufficient due to 1-hour time window
- Single vs Multiple transactions: Use array format even for single transactions
- Check for duplicates in response: Monitor
duplicate_count
in operations - Handle flexible data formats: API normalizes amounts, dates, and types automatically
- Set reasonable timeouts: AI processing may take 3-5 seconds for complex corrections
- Use both auth methods: Header for triggers, query parameter as fallback
Changelog
Version 1.1 (Current - June 2025)
- 🔒 Enhanced Protection: Advanced duplicate detection with 24-hour time windows
- 🚦 Rate Limiting: 20 requests per 5 minutes for create_multiple_transactions
- 🔄 Trigger Optimization: 1-hour time window for get-recent-transactions endpoint
- 🤖 Improved AI: Better error recovery with GPT-4o integration
- 📊 Enhanced Monitoring: Detailed response headers and request tracking
- ⚡ Zapier Format: Dedicated response format for optimal Zapier integration
- 📝 Unified Endpoint: Single create_multiple_transactions endpoint for all operations
- 🔐 Flexible Auth: Support for both header and query parameter authentication
Version 1.0 (January 2025)
- Initial API release
- Basic CRUD operations for transactions
- Folder management
- AI-powered data normalization
- Zapier-optimized responses
Last Updated: June 12, 2025
API Version: 1.1 (Enhanced Protection)
Contact: hello@rewiser.io
Documentation: Real-time protection against automation loops and duplicate submissions