Skip to main content

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

  1. Sign up at app.hitl.sh
  2. Create a new API key in your dashboard
  3. Set up a loop with team members who will review requests

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.
Instead of polling for responses, set up webhooks to get notified instantly when reviews complete. Add a callback_url field when creating your request:
Then set up an endpoint to receive the webhook notifications:

Production Best Practices

  • 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
  • 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
  • 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
  • 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

Common Issues & Solutions

Common causes:
  • Invalid API key or loop ID
  • Missing required fields
  • Invalid response configuration
Solution:
Common causes:
  • Timeout too short for request complexity
  • Reviewers not available or not notified
  • Unclear instructions leading to hesitation
Solution:
Common causes:
  • Loop members haven’t installed the mobile app
  • Notification permissions disabled
  • Device tokens expired
Solution:
  • 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