API Documentation
Integrate Refinal.ai into your applications with our REST API
Overview
The Refinal.ai API provides programmatic access to your financial data. You can retrieve transactions, manage tags, run analytics queries, and more.
Base URL
https://api.refinal.ai/v1Rate Limits
- • Standard plans: 100 requests/minute
- • Pro plans: 500 requests/minute
- • Enterprise plans: Custom limits
Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header.
Getting your API Key
Generate an API key from your dashboard at Settings → API Keys. Keep your API key secure and never expose it in client-side code.
Example Request
curl -X GET "https://api.refinal.ai/v1/transactions" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json"Security Note: Never share your API key or commit it to version control. Use environment variables to store sensitive credentials.
Endpoints
Transactions
/api/v1/transactionsList all transactions with optional filtering
Parameters
| Name | Type | Description |
|---|---|---|
| page | integer | Page number (default: 1) |
| limit | integer | Items per page (default: 50, max: 200) |
| start_date | string | Filter from date (ISO 8601) |
| end_date | string | Filter to date (ISO 8601) |
| source | string | Filter by source (stripe, revolut, coingate) |
| min_amount | number | Minimum transaction amount |
| max_amount | number | Maximum transaction amount |
| tags | string | Comma-separated tag IDs |
| search | string | Search in description |
/api/v1/transactions/:idGet a single transaction by ID
/api/v1/transactions/:idUpdate transaction (tags, notes, category)
/api/v1/transactions/bulk-tagApply tags to multiple transactions
Tags
/api/v1/tagsList all tags
/api/v1/tagsCreate a new tag
/api/v1/tags/:idUpdate a tag
/api/v1/tags/:idDelete a tag
Analytics
/api/v1/analytics/summaryGet summary statistics for a date range
Parameters
| Name | Type | Description |
|---|---|---|
| start_date | string | Start date (required) |
| end_date | string | End date (required) |
| group_by | string | Group by: day, week, month, year |
/api/v1/analytics/breakdownGet breakdown by category, tag, or source
Parameters
| Name | Type | Description |
|---|---|---|
| start_date | string | Start date (required) |
| end_date | string | End date (required) |
| dimension | string | Dimension: category, tag, source, merchant |
/api/v1/analytics/queryRun a custom analytics query
/api/v1/analytics/projectionsGet AI-powered financial projections
Data Sources
/api/v1/sourcesList connected data sources
/api/v1/sources/:provider/syncTrigger a manual sync for a data source
/api/v1/sources/:provider/statusGet sync status for a data source
Example Response
{
"data": [
{
"id": "txn_abc123",
"amount": 1500.00,
"currency": "USD",
"description": "Stripe payout",
"source": "stripe",
"date": "2025-12-15T10:30:00Z",
"tags": ["revenue", "recurring"],
"category": "income"
}
],
"meta": {
"total": 1543,
"page": 1,
"limit": 50,
"total_pages": 31
}
}Error Handling
The API uses standard HTTP status codes to indicate success or failure. Error responses include a message explaining what went wrong.
Error Response Format
{
"error": {
"code": "invalid_parameter",
"message": "The 'start_date' parameter must be a valid ISO 8601 date",
"param": "start_date"
}
}HTTP Status Codes
| Code | Name | Description |
|---|---|---|
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server error, please retry |
SDKs & Libraries
We provide official SDKs to make integration easier:
Python
pip install refinalNode.js
npm install @refinal/sdkRuby
gem install refinalNeed Help?
Have questions about the API? Our developer support team is here to help.
Contact API Support