Overview
All requests to the VoxFi Public API require authentication using an API key. Your API key identifies you to the API and grants access to your account resources.Getting Your API Key
To create an API key:- Log in to your VoxFi account at https://voxfi.com.br/profile
- Navigate to Profile → Security
- Click on Create API Key or Create New API Key
- Configure your API key settings:
- Name (required): Give your API key a descriptive name (e.g., “Mobile App”, “Production Server”)
- Expiration Date (required): Set when the API key should expire
- Permissions (optional): Select specific permissions for the key. If none are selected, all permissions will be granted:
- Read orders
- Create orders
- Cancel orders
- Read positions
- Read wallet
- Allowed IPs (optional): Specify IP addresses allowed to use this key (comma-separated). If empty, all IPs will be allowed
- Click Create to generate your API key
- Copy your API key immediately - it will be automatically generated and displayed only once
- Store it securely using the best practices outlined below
Using Your API Key
Include your API key in every request using theX-Api-Key header:
Example Request
Security Best Practices
✅ Do’s
1. Store API Keys Securely Never hardcode API keys in your source code. Use environment variables or secure secret management:- AWS Secrets Manager / AWS Parameter Store
- Google Cloud Secret Manager
- Azure Key Vault
- HashiCorp Vault
- 1Password Secrets Automation
- GitHub Secrets (for CI/CD)
- Generate new API keys periodically
- Revoke old keys that are no longer in use
- Use different keys for different environments (development, staging, production)
- Name: Use descriptive names to identify the purpose of each key
- IP Whitelisting: Restrict API key usage to specific IP addresses (comma-separated)
- Permissions: Select only the permissions your application needs (read orders, create orders, cancel orders, read positions, read wallet)
- Expiration: Set expiration dates for temporary access
- Regularly review API key usage logs
- Set up alerts for unusual activity
- Monitor for unauthorized access attempts
❌ Don’ts
1. Never Commit API Keys to Version Control.env files and any files containing API keys to .gitignore:
- Never post API keys in forums, chat rooms, or public repositories
- Don’t include keys in screenshots or documentation examples
- Avoid sending keys via email or unencrypted messages
- Browser JavaScript
- Mobile app code that can be decompiled
- Public repositories
- Client-side configuration files
- Use separate keys for different applications
- Use separate keys for different environments
- Rotate keys when team members leave
Environment-Specific Storage
Development
Use environment variables or local configuration files:Production
Use cloud secret management:CI/CD Pipelines
Store keys as encrypted secrets in your CI/CD platform: GitHub Actions:Key Rotation
If your API key is compromised or you need to rotate it:- Create a new API key in Profile → Security with the same or updated settings
- Copy the new automatically generated API key
- Update all applications using the old key
- Revoke the old API key
- Verify all applications are working with the new key
- Monitor for any unauthorized access attempts
IP Whitelisting
For enhanced security, configure IP whitelisting when creating your API key:- Go to Profile → Security
- When creating your API key, enter allowed IP addresses in the “Allowed IPs” field (comma-separated, e.g.,
192.168.1.1, 10.0.0.1) - Only requests from whitelisted IPs will be accepted
- If left empty, all IPs will be allowed
- To update IPs for an existing key, you’ll need to create a new key with updated IPs and revoke the old one
IP whitelisting is optional but highly recommended for production applications.
Troubleshooting
”unauthorized” Error
If you receive anunauthorized error:
- Verify your API key is correct
- Check that the
X-Api-Keyheader is included in your request - Ensure your API key hasn’t expired
- Verify your API key is enabled
- Check if IP whitelisting is blocking your request
”ip not allowed” Error
If you receive anip not allowed error:
- Check your current IP address
- Verify your IP is in the whitelist for your API key
- Update the whitelist in Profile → Security if needed
Additional Resources
- Quickstart Guide - Get started with your first API request
- API Reference - Complete endpoint documentation
- Error Handling - Understand API error responses