Skip to main content

Command Palette

Search for a command to run...

intermediate10 minutes

Authentication

Learn how to authenticate with the Tenders-SA API

Overview

The Tenders-SA API uses API keys for authentication. This guide explains how to obtain and use API keys to access our endpoints.

Getting Your API Key


1
Log in to your Tenders-SA account
2
Go to Settings > API Access
3
Click "Enable API Access"
4
Select your subscription plan (Professional or Enterprise required)
1
Click "Generate New API Key"
2
Give your key a descriptive name (e.g., "Production API")
3
Select permissions: Read tenders, Submit applications, View company profile
4
Click "Generate Key"
5
Copy and securely store your API key
1
Treat API keys like passwords
2
Never expose keys in client-side code
3
Use environment variables in production
4
Rotate keys regularly

Authentication Methods


Bearer Token (Recommended)
Include your API key in the Authorization header:

Bearer Token Authentication

http

API Key in Header
Alternative method using X-API-Key header:

X-API-Key Authentication

http

API Key Permissions


Read Permissions
- tenders:read - Access tender listings
- companies:read - View company profile
- applications:read - View application status

Write Permissions
- applications:write - Submit applications
- companies:write - Update company profile
- documents:write - Upload documents

Admin Permissions
- users:read - View user information (Enterprise only)
- analytics:read - Access analytics (Enterprise only)

Rate Limits

API requests are rate limited based on your plan:

Professional Plan
- 1,000 requests per hour
- 10,000 requests per day

Enterprise Plan
- 5,000 requests per hour
- 50,000 requests per day

Rate limit headers are included in responses:

Rate Limit Headers

http

Error Handling


401 Unauthorized
Invalid or missing API key:

401 Error Response

json

403 Forbidden
Insufficient permissions:

403 Error Response

json

429 Too Many Requests
Rate limit exceeded:

429 Error Response

json

Example Requests


Using curl

cURL Example

bash

Using JavaScript (fetch)

JavaScript Example

javascript

Using Python (requests)

Python Example

python

Webhook Authentication

For webhooks, we use HMAC signatures:

Verifying Webhook Signatures

Webhook Signature Verification

python

Best Practices


1. Secure Storage
- Store API keys in environment variables
- Use secret management services (AWS Secrets Manager, etc.)
- Never commit keys to version control

2. Error Handling
- Implement exponential backoff for rate limits
- Cache responses where appropriate
- Handle authentication errors gracefully

3. Monitoring
- Track API usage and rate limits
- Monitor for unusual activity
- Set up alerts for authentication failures

Troubleshooting


Common Issues

"Invalid API key"
- Verify the key is copied correctly
- Check for extra spaces or characters
- Ensure the key is active

"Rate limit exceeded"
- Implement request throttling
- Use caching to reduce requests
- Consider upgrading your plan

"Insufficient permissions"
- Check your subscription plan
- Verify key permissions in dashboard
- Contact support for additional access

Testing Your API Key
Use our test endpoint to verify your key:

Test API Key

bash

Support

For API authentication issues:
- Documentation: docs.tenders-sa.org
- Email: api-support@tenders-sa.org
- Status Page: status.tenders-sa.org