Base URL
All API requests should be made to:your-domain.com with your Sure instance URL.
Versioning
The API is versioned through the URL path. The current version isv1.
All endpoints are prefixed with /api/v1/. Breaking changes will result in a new API version.
Authentication
The Sure API supports two authentication methods:- API Key Authentication (recommended for server-to-server integrations)
- OAuth 2.0 (recommended for user-facing applications)
Rate Limiting
API requests are rate limited based on your API key tier. Rate limits are calculated on an hourly basis:| Tier | Requests per Hour |
|---|---|
| Standard | 100 |
| Premium | 1,000 |
| Enterprise | 10,000 |
Self-hosted instances have rate limiting disabled by default.
Rate Limit Headers
Every API response includes rate limit information in the headers:X-RateLimit-Limit: Maximum requests allowed in the current windowX-RateLimit-Remaining: Number of requests remaining in the current windowX-RateLimit-Reset: Seconds until the rate limit resets
Rate Limit Exceeded
When you exceed your rate limit, you’ll receive a429 Too Many Requests response:
Response Format
All API responses are returned in JSON format with appropriate HTTP status codes.Successful Responses
Successful responses return data with a2xx status code:
Pagination
List endpoints support pagination with the following query parameters:Page number to retrieve
Number of items per page (1-100)
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of requests.Status Codes
| Code | Description |
|---|---|
200 | OK - Request succeeded |
201 | Created - Resource created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Authentication failed or missing |
403 | Forbidden - Insufficient permissions or scope |
404 | Not Found - Resource not found |
422 | Unprocessable Entity - Validation failed |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error occurred |
Error Response Format
Error responses follow a consistent structure:Common Error Codes
unauthorized
unauthorized
insufficient_scope
insufficient_scope
Your authentication credentials don’t have the required permissions.
record_not_found / not_found
record_not_found / not_found
The requested resource doesn’t exist or you don’t have access to it.
validation_failed
validation_failed
The request data failed validation. Check the
errors array for details.forbidden
forbidden
Access denied to the requested resource (usually due to family-level access control).
bad_request
bad_request
Required parameters are missing or invalid.
feature_disabled
feature_disabled
The requested feature (e.g., AI) is not enabled for your account.
Quick Start Example
Here’s a complete example of making an API request:Available Resources
The Sure API provides access to the following resources:Accounts
List accounts and view balances
Transactions
Create, read, update, and delete transactions
Categories
Manage transaction categories
Merchants
View and manage merchants
Tags
Organize transactions with tags
Holdings
Access investment holdings data
Trades
Manage investment trades
Valuations
Create and update asset valuations
Imports
Import transactions from CSV
Sync
Trigger account synchronization
Chats
Interact with AI assistant
Usage
Monitor API usage statistics
User Management
Sure’s API also provides endpoints for managing your user account:Reset Account
Reset all account data while keeping the user
Delete Account
Permanently delete your user account
Best Practices
Use API Keys for Server-to-Server
For backend integrations and scripts, use API key authentication. It’s simpler and more secure for non-interactive use cases.
Implement Exponential Backoff
When you hit rate limits or encounter server errors, implement exponential backoff before retrying.
Handle Errors Gracefully
Always check the error code in responses and handle different error types appropriately.
Use Pagination
For large datasets, use pagination parameters to limit response size and improve performance.
Secure Your Credentials
Never commit API keys or access tokens to version control. Use environment variables or secure credential storage.
Support
For API support, please:- Check the API Reference for detailed endpoint documentation
- Review the Authentication guide
- Contact your instance administrator for self-hosted deployments