HITL.sh API Reference
The HITL.sh API provides a RESTful interface for integrating human supervision into your AI workflows. Create loops, manage requests, and route decisions to human reviewers with our comprehensive API.Base URL
Authentication
Use API keys for machine-to-machine integration. Include your API key in the header:- 100 requests per hour per API key
- Rate limit headers included in responses:
Response Format
All API responses follow a consistent JSON format: Success Response:HTTP Status Codes
- 200 OK: Request successful
- 201 Created: Resource created successfully
- 400 Bad Request: Invalid request data or validation error
- 401 Unauthorized: Invalid or missing authentication
- 403 Forbidden: Access denied to resource
- 404 Not Found: Resource not found
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server error
Core Resources
Loops
Loops are human review workflows that route requests to team members:- POST
/api/loops
- Create a new loop - GET
/api/loops
- Get your loops - GET
/api/loops/{id}
- Get specific loop - PUT
/api/loops/{id}
- Update loop - DELETE
/api/loops/{id}
- Delete loop - GET
/api/loops/{id}/members
- Get loop members - DELETE
/api/loops/{id}/members/{userId}
- Remove member
Requests
Requests are human review tasks sent to loop members:- POST
/api/loops/{loopId}/requests
- Create request in loop - GET
/api/requests
- Get your requests - GET
/api/requests/{id}
- Get specific request - DELETE
/api/requests/{id}
- Cancel request - POST
/api/requests/{id}/feedback
- Add feedback - GET
/api/loops/{loopId}/requests
- Get loop requests
Quick Start Example
1. Create a Loop
2. Create a Request
3. Poll for Response
Request Types and Response Configuration
Response Types
Single Select
User chooses one option from a list.
Multi Select
User chooses multiple options from a list.
Rating
User provides a numerical rating within a range.
Text
User provides free-form text response.
Number
User provides a numerical value.
Processing Types
Time-Sensitive
Requires immediate attention with specified timeout.
timeout_seconds
required.Deferred
Can be processed within a longer timeframe (default: 30 days).
Webhook Integration
Set up webhooks to receive real-time notifications when requests are completed:Error Handling
Common Error Scenarios
Rate limit exceeded:Best Practices
API Usage
- Use HTTPS: Always use secure connections
- Store keys securely: Never commit API keys to version control
- Implement retries: Use exponential backoff for failed requests
- Monitor rate limits: Track your API usage to avoid limits
- Handle errors gracefully: Implement proper error handling
Request Management
- Set appropriate timeouts: Balance urgency with reviewer availability
- Use webhooks: More efficient than polling for status updates
- Provide context: Include relevant metadata to help reviewers
- Choose response types carefully: Match response type to your use case
SDKs and Integration
Official Libraries
- Python:
pip install hitl-python
(coming soon) - Node.js:
npm install @hitl/node
(coming soon) - Go:
go get github.com/hitl-sh/go-client
(coming soon)
No-Code Integrations
- n8n: Available in the n8n community library
- Zapier: Connect HITL.sh to 5000+ apps
- Make: Visual workflow automation
Support and Resources
API Status
Check real-time API health and uptime.
Community
Join our Discord community for support.
GitHub
Explore our open source projects.
Support
Get help from our support team.
Next Steps
Authentication Guide
Learn about API keys and security best practices.
Create Your First Loop
Start by creating a loop to organize your human reviewers.
Set Up Webhooks
Receive real-time notifications when requests are completed.