Quick Start
Include your API key in theAuthorization header of every request:
Getting Your API Key
1
Log into Dashboard
Sign in to your Givebutter Dashboard
2
Navigate to API Settings
Go to Settings > Integrations > API Keys
3
Generate API Key
Click Create New API Key and give it a descriptive name (e.g., “Production CRM Integration”)
4
Copy & Store Securely
Copy your API key immediately - you won’t be able to see it again. Store it securely in your password manager or environment variables.
API Key Types
Givebutter provides different types of API keys for different environments:Test Keys
Test API keys allow you to build and test your integration without affecting production data.- Prefix:
test_ - Use Case: Development, testing, staging environments
- Data Access: Test mode data only
- Safety: Transactions won’t affect real donors or bank accounts
Live Keys
Live API keys access your production Givebutter account and real fundraising data.- Prefix:
live_ - Use Case: Production applications
- Data Access: Real campaigns, donors, and transactions
- Safety: Use with caution - affects real data
Authentication Flow
1
Include API Key in Header
Add the
Authorization header with Bearer YOUR_API_KEY to your request2
API Validates Key
Givebutter validates your API key and checks permissions
3
Request Processed
If valid, your request is processed and a response is returned
4
Error if Invalid
If invalid, you receive a
401 Unauthorized error responseTesting Your Authentication
Verify your API key is working correctly with a simple test request:Security Best Practices
Never Expose API Keys in Client-Side Code
Never Expose API Keys in Client-Side Code
Don’t do this:Do this instead:Your backend should securely store the Givebutter API key and make requests on behalf of users.
Use Environment Variables
Use Environment Variables
Store API keys in environment variables, never in code:Then access them in your code:
.env
Add .env to .gitignore
Add .env to .gitignore
Prevent accidentally committing secrets to version control:
.gitignore
Rotate API Keys Regularly
Rotate API Keys Regularly
Best practice is to rotate API keys every 90 days:
- Generate a new API key in your Dashboard
- Update your production environment variables
- Deploy the change
- Verify everything works
- Delete the old API key
Use Separate Keys for Each Environment
Use Separate Keys for Each Environment
Create different API keys for each environment:
- Development:
dev_integration - Staging:
staging_integration - Production:
prod_integration
Implement Key Management
Implement Key Management
For enterprise applications, use a secrets manager:
- AWS Secrets Manager
- HashiCorp Vault
- Azure Key Vault
- Google Secret Manager
- Automatic rotation
- Access logging
- Encryption at rest
- Fine-grained access control
Monitor API Key Usage
Monitor API Key Usage
Regularly review API logs in your Givebutter Dashboard:
- Check for unusual request patterns
- Monitor failed authentication attempts
- Track API usage by key
- Set up alerts for suspicious activity
Authentication Errors
401 Unauthorized
Your API key is missing, invalid, or revoked.- API key is missing from the request
- API key is incorrect or has typos
- API key has been revoked
- Using
Authorization: YOUR_API_KEYinstead ofAuthorization: Bearer YOUR_API_KEY
- Verify your API key is correct
- Ensure you’re using the
Bearerprefix - Check if the key was revoked in your Dashboard
- Generate a new API key if needed
403 Forbidden
Your API key is valid but lacks permission for this resource.- API key has restricted permissions
- Trying to access another organization’s data
- Resource has been archived or deleted
- Check API key permissions in Dashboard
- Verify you’re accessing the correct organization’s resources
- Ensure the resource exists and is active
HTTPS Requirement
The Givebutter API rejects all non-HTTPS requests to protect your API keys and data in transit.API Key Management
Viewing Active Keys
In your Dashboard under Settings > API Keys, you can:- View all active API keys
- See when each key was created
- See when each key was last used
- View the key name and description
For security, only the first few and last few characters of each key are visible.
Revoking Keys
If an API key is compromised or no longer needed:- Go to Settings > API Keys
- Find the key you want to revoke
- Click Revoke or Delete
- Confirm the action
Key Naming Best Practices
Give your API keys descriptive names:- ✅ “Production Salesforce Integration”
- ✅ “Staging Environment - Testing”
- ✅ “Mobile App v2.0”
- ❌ “Key 1”
- ❌ “test”
- Identify which keys are used where
- Decide which keys to rotate
- Track down issues faster
Common Authentication Patterns
Server-to-Server
Most secure: API calls from your backend server.Webhook Handlers
Authenticate incoming webhooks from Givebutter:Background Jobs
For scheduled tasks and batch processing:Troubleshooting
Getting 401 errors despite correct key
Getting 401 errors despite correct key
Check for these common issues:
- Extra spaces before or after the API key
- Missing “Bearer ” prefix
- Incorrect header name (should be
Authorization) - API key from wrong environment (test vs live)
- Key was revoked in Dashboard
Works in curl but not in code
Works in curl but not in code
Common causes:
- HTTP client not sending headers correctly
- Headers being stripped by middleware
- CORS issues (if calling from browser)
- API key not loaded from environment variables
Intermittent authentication failures
Intermittent authentication failures
Possible causes:
- Using multiple API keys and one is invalid
- Load balancer not forwarding headers
- API key rotation in progress
- Connection being intercepted by proxy
Next Steps
Make Your First Request
Try fetching your campaigns
Error Handling
Learn about error codes
Rate Limits
Understand rate limiting
Pagination
Work with paginated results
Need Help?
If you’re having trouble with authentication:- Double-check your API key is correct
- Verify you’re using the
Bearerprefix - Test with curl to isolate the issue
- Check the API Status Page
- Contact [email protected] with:
- The first/last 4 characters of your API key
- Example request that’s failing
- Error messages you’re receiving
- Programming language and HTTP library used