π Authentication & Rate Limits
To work with the FlexPay API, youβll need to authenticate every request using a secure, token-based method. FlexPay uses Bearer tokens tied to your organizationβs credentials. These tokens are created and managed within the Developer β API Keys section of the FlexPay Admin Dashboard. Each token is associated with specific scopes β such as read:employees or write:payroll β which control what the token can access or modify. You must include this token in the Authorization header of every API request. Tokens offer fine-grained access control, meaning they can be tailored to limit the surface area of exposure when integrating with payroll automations, employee management tools, or time-tracking systems.
All FlexPay API endpoints require secure HTTPS connections. Any requests made over insecure channels (HTTP) will be automatically rejected to ensure data integrity and protect sensitive employee data such as compensation, pay groups, and banking details. Before making your first request, itβs important to understand how both authentication and rate limiting work β especially if your app will perform high-volume batch operations like onboarding hundreds of employees or submitting weekly payroll in real time.
π Base URL
arduinoCopyEdithttps://api.flexpay.dev/v1/π§ Getting Your Token
To create a token:
Log in to your FlexPay Admin Dashboard
Navigate to Developer β API Keys
Click Generate Token
Choose a scope: Read-only, Payroll Submitter, or Admin
Copy and store the token securely β tokens are only shown once

π Example Authenticated Request
π― Token Scopes
Each token can have one or more of the following scopes:
read:employeesβ View employee datawrite:payrollβ Submit or modify payroll runsread:paystubsβ Retrieve paystub data
Use minimum scope tokens whenever possible. This protects you in case tokens are compromised and allows easier debugging when permission errors occur.
π¦ Rate Limits
FlexPay applies tiered rate limiting to maintain service reliability. Each token has limits based on:
Burst capacity (how many requests you can send quickly)
Sustained rate (how many requests you can send over time)
Endpoint type and scope
If a limit is exceeded, youβll receive a structured error response like:
Headers to watch:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset

π Security Best Practices
Never commit your token to GitHub or public repositories
Store tokens in secure environment variables or vaults
Rotate tokens every 30β60 days
Use scoped tokens for every external integration
Audit access with the Developer β Logs section
π§Ύ Summary
Authentication is the secure backbone of the FlexPay API experience. It starts with creating your own Bearer token inside the Developer β API Keys section. This token defines what your app can do, how fast it can operate, and how long it can stay active. Tokens that include green-labeled scopes like read:paystubs or write:payroll act as passports to sensitive employee and payroll data. If a token is malformed, expired, or missing required scopes, requests will fail with clear error messages to help you debug quickly.
By default, most tokens have rate caps to prevent misuse β typically 300 requests/minute for reads, and 100 writes/minute for payroll. Enterprise partners can request upgrades. FlexPay uses burst and sustain windows to smooth out traffic spikes while maintaining consistent performance for everyone. Understanding your limits upfront helps you design systems that retry or throttle gracefully.
We recommend using Postman or similar tools to test your first authenticated request, then gradually build automation flows. Every call you make must include the Authorization: Bearer header, or it will be rejected. If you see 401 Unauthorized or 403 Forbidden, your token is likely missing required scopes.
βοΈ Whatβs Next?
Now that you know how authentication and rate limiting work in FlexPay, you're ready to make your first authenticated call: onboarding a new employee. In the next section β β Add Employee (POST /employees) β you'll see how authentication combines with properly scoped tokens and previously configured green pay groups and employment types to create new employee records programmatically.
Weβll walk through:
Crafting the request body using the correct data schema
How your pay schedule affects the new employee setup
What to expect in the response β including
employee_idError handling when a required field is missing
Testing the flow in Postman or curl
How onboarding employees via API ties into payroll submission
This is the moment when your token becomes a tool, not just a string. Letβs move to the next section and start building real automation flows with FlexPay.
Last updated
Was this helpful?