Simple Integration Guide
This guide shows you how to integrate HITL.sh into your applications to get human input when your automated systems need help making decisions.Perfect for developers who want to add human oversight to AI systems, content moderation, quality checks, and approval workflows.
What You’ll Learn
1
Basic Setup
Get your API key and understand the core concepts
2
Common Patterns
Learn the most useful integration patterns with copy-paste examples
3
Handle Responses
Process human responses in your application code
4
Best Practices
Tips for reliable production integration
Prerequisites
Get Your API Key
Get Your API Key
- Sign up at app.hitl.sh
- Create a new API key in your dashboard
- Set up a loop with team members who will review requests
Install Required Libraries
Install Required Libraries
Integration Pattern #1: Content Moderation
Perfect for reviewing user-generated content, AI outputs, or flagged posts.Integration Pattern #2: AI Output Quality Check
Perfect for reviewing AI-generated content, translations, or automated responses before sending them to users.Integration Pattern #3: Document Approval Workflow
Great for reviewing contracts, proposals, marketing materials, or any documents that need human approval.Using Webhooks (Recommended for Production)
Instead of polling for responses, set up webhooks to get notified instantly when reviews complete:Production Best Practices
🔒 Security & Authentication
🔒 Security & Authentication
- Store your API key securely (environment variables, secret managers)
- Use HTTPS for all webhook endpoints
- Validate webhook signatures if available
- Implement rate limiting on your webhook endpoints
⚡ Performance & Reliability
⚡ Performance & Reliability
- Use webhooks instead of polling in production
- Implement retry logic with exponential backoff
- Set appropriate timeouts for different request types
- Cache frequently used loop IDs and configurations
📊 Monitoring & Logging
📊 Monitoring & Logging
- Log all HITL requests with unique identifiers
- Monitor response times and success rates
- Set up alerts for timeout rates above acceptable thresholds
- Track reviewer performance and availability
🎯 Response Quality
🎯 Response Quality
- Provide clear, specific instructions to reviewers
- Use appropriate default responses for timeout scenarios
- Test different response types to find what works best
- Regularly review and update your request templates
Next Steps
Set Up Webhooks
Configure real-time notifications for production use
API Reference
Explore all available options and configurations
Response Types Guide
Learn about advanced response configurations
Best Practices
Advanced tips for optimizing your integration
Common Issues & Solutions
❌ Request Creation Fails
❌ Request Creation Fails
Common causes:
- Invalid API key or loop ID
- Missing required fields
- Invalid response configuration
⏰ High Timeout Rates
⏰ High Timeout Rates
Common causes:
- Timeout too short for request complexity
- Reviewers not available or not notified
- Unclear instructions leading to hesitation
📱 Mobile App Not Receiving Notifications
📱 Mobile App Not Receiving Notifications
Common causes:
- Loop members haven’t installed the mobile app
- Notification permissions disabled
- Device tokens expired
- Ensure all reviewers have installed the HITL mobile app
- Test notifications in your loop settings
- Verify reviewers have enabled push notifications
- Consider SMS or email fallback notifications