API introduction
Get started with the 2perks API. Learn about authentication and basic endpoints to manage perks and categories for your business.
Get started with the 2perks API. Learn about authentication and basic endpoints to manage perks and categories for your business.
Welcome to the 2perks API! Our simple REST API allows you to manage perks and categories for your business programmatically.
All API requests should be made to:
https://api.2perks.com/api/v1
The API uses API keys for authentication. Generate your API key from your dashboard.
Include your API key in the X-2PERKS-API-KEY header:
curl -H "X-2PERKS-API-KEY: YOUR_API_KEY" \
https://api.2perks.com/api/v1/categories
⚠️ Important: Keep your API key secure and never expose it in client-side code.
Content-Type: application/json header for POST/PUT requests| Code | Description |
|---|---|
UNAUTHORIZED |
Invalid or missing API key |
FORBIDDEN |
Insufficient permissions |
NOT_FOUND |
Resource not found |
VALIDATION_ERROR |
Request validation failed |
INTERNAL_ERROR |
Internal server error |
{
"success": false,
"message": "Access denied. No API key provided. Include your API key in the 'X-2PERKS-API-KEY' header."
}
{
"success": false,
"message": "Invalid API key"
}
The API has rate limits to ensure service quality. When you exceed the limit, you'll get a 429 Too Many Requests response.
Ready to start? Get your API key and explore your first categories!