Skip to main content

Error Handling

HITL.sh APIs use conventional HTTP status codes and provide detailed error messages to help you debug issues quickly. All errors follow a consistent format for easy parsing and handling.

Error Response Format

All API errors return a JSON response with the following structure:

Error Response Fields

boolean
Always true for error responses
string
Human-readable error message describing what went wrong
object
Additional error context, validation details, or debugging information (optional)

HTTP Status Codes

2xx Success

Request succeeded. Response contains the requested data.
Resource was created successfully.

4xx Client Errors

Request data is invalid or malformed.Common causes:
  • Missing required fields
  • Invalid field values
  • Malformed JSON
  • Validation failures
Invalid request body:
Invalid ID format:
Missing required fields:
Invalid configuration:
State validation errors:
Authentication is missing or invalid.Common causes:
  • Missing API key
  • Invalid API key
  • Malformed authorization header
  • Inactive API key
Missing Authorization header:
Invalid header format:
Empty API key:
Invalid API key:
Inactive API key:
API key required:
Authentication is valid but access is denied.Common causes:
  • Not the resource owner (loop creator)
  • Not a member of the loop
  • Insufficient permissions for the operation
Access denied to loop:
Access denied to request:
Creator-only operations:Only loop creators can create requests:
Only loop creator can update:
Only loop creator can delete:
Only loop creator can remove members:
Loop creator cannot remove themselves:
The requested resource doesn’t exist.Common causes:
  • Invalid resource ID
  • Resource was deleted
  • Typo in endpoint URL
  • Resource doesn’t belong to your account
Loop not found:
Request not found:
User is not a member:
Rate limit has been exceeded. Limits reset at the top of each hour.Rate limit exceeded:
API key usage limit exceeded:
Response headers (included in all responses):
The X-RateLimit-Reset header contains a Unix timestamp indicating when the rate limit will reset (top of the next hour).

5xx Server Errors

An unexpected error occurred on our servers.Common server errors:Database errors:
User information errors:
What to do:
  • Retry the request after a short delay
  • Check our status page at status.hitl.sh
  • Contact support if the issue persists
Gateway or proxy error, usually temporary.
Service is temporarily unavailable, usually due to maintenance.

Common Error Scenarios

Validation Errors

Request Text Too Long:
Invalid Response Configuration:
Invalid Enum Value:

Resource Access Errors

Loop Not Found:
Request Already Cancelled:
No Active Members:

Authentication Errors

Missing API Key:
Invalid API Key Format:
Expired Session:

Error Handling Best Practices

1. Implement Retry Logic

Use exponential backoff for transient errors:

2. Handle Rate Limits Gracefully

3. Validate Requests Client-Side

Implement client-side validation to catch errors early:

4. Log Errors for Debugging

Implement comprehensive error logging:

Debugging Guide

Common Issues and Solutions

Symptoms: Getting 401 Unauthorized errorsDebugging steps:
  1. Verify API key is correct (no extra spaces)
  2. Check header format: Authorization: Bearer your_key_here
  3. Ensure key hasn’t been revoked in dashboard
  4. Try generating a new API key
Symptoms: Getting 400 Bad Request with validation errorsDebugging steps:
  1. Check required fields are present
  2. Verify enum values are correct
  3. Validate field types and formats
  4. Check field length constraints
Symptoms: Getting 429 Too Many RequestsDebugging steps:
  1. Check rate limit headers in response
  2. Implement exponential backoff
  3. Consider upgrading API tier
  4. Cache responses where possible
Symptoms: Requests timing out or 504 errorsDebugging steps:
  1. Check our status page: status.hitl.sh
  2. Increase request timeout in your client
  3. Try the request again after a delay
  4. Contact support if issue persists

Request/Response Debugging

Enable verbose logging to see full HTTP requests and responses:

Getting Help

Self-Service Resources

API Status

Check if there are any ongoing service issues.

Community Forum

Ask questions and get help from the community.

Documentation

Review API documentation and examples.

GitHub Issues

Report bugs or request new features.

Contacting Support

When contacting support, please include:
  1. Request ID (if available from response headers)
  2. Timestamp of when the error occurred
  3. Full error response including status code and message
  4. Request details (endpoint, method, payload)
  5. Your API key ID (not the actual key)

Contact Support

Email us at support@hitl.sh with your issue details.

Next Steps

Authentication Guide

Learn about API keys and security best practices.

Webhooks

Use callback URLs to receive notifications when requests complete.