Skip to main content

Error Handling

The Heify API uses standard HTTP status codes to indicate the success or failure of requests. This guide explains how to handle errors effectively.

HTTP Status Codes

Status CodeMeaningDescription
200 OKSuccessRequest completed successfully
201 CreatedResource CreatedNew resource created successfully (e.g., configuration)
400 Bad RequestClient ErrorInvalid request format or parameters
403 ForbiddenAuthentication FailedInvalid or missing API key
404 Not FoundResource Not FoundRequested resource doesn’t exist
429 Too Many RequestsRate Limit ExceededToo many requests in a short period
500 Internal Server ErrorServer ErrorUnexpected error on Heify servers

Error Response Format

All error responses follow a consistent JSON structure:
{
  "message": "Descriptive error message explaining what went wrong"
}

Example Error Response

{
  "message": "Configuration not found or does not belong to your account"
}

Common Errors by Status Code

400 Bad Request

The most common error type. Occurs when the request is malformed or contains invalid parameters.

Common Causes

Error: "Missing required field: configuration_id"Solution: Ensure all required parameters are included in the request body.
{
  "configuration_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}
Error: "Invalid JSON format"Solution: Validate your JSON before sending. Common issues:
  • Missing commas between fields
  • Trailing commas
  • Unescaped quotes in strings
Use a JSON validator or library to ensure correctness.
Error: "Configuration not found"Solution: Verify the resource ID exists and belongs to your account:
curl -X POST https://api.heify.com/get-configurations \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{}'
Error: "Unsupported audio format"Solution: Ensure your audio file is in a supported format:
  • Supported: aac, aiff, amr, asf, flac, mp3, ogg, wav, webm, m4a, mp4
  • Max size: 200 MB
  • Max duration: 2 hours (7200 seconds)
Error: "Invalid group value"Solution: Use only allowed group values:
  • PENDING_REVIEW
  • UNDER_REVIEW
  • ARCHIVED
  • "" (empty string to remove group)
Error: "Maximum of 20 configurations per client exceeded"Solution: Delete unused configurations before creating new ones:
curl -X POST https://api.heify.com/delete-configuration \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "configuration_id": "old-config-id"
  }'

Solutions

1

Verify account status

Check your account status and available resources in your Heify Dashboard
2

Contact support

If you believe this is an error, contact Heify support for assistance

403 Forbidden

Authentication failed. Your API key is invalid, missing, or inactive.

Common Causes

CauseSolution
Missing x-api-key headerAdd the header to your request
Invalid API keyVerify the key in your dashboard
Deactivated API keyGenerate a new key
Wrong header nameUse x-api-key, not Authorization

Example Fix

curl -X POST https://api.heify.com/details \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"  # Wrong header

404 Not Found

The requested resource doesn’t exist or the endpoint URL is incorrect.

Error Example

{
  "message": "Endpoint not found"
}

Common Causes

  • Typo in endpoint URL
  • Using GET instead of POST
  • Incorrect base URL

Solution

Verify the endpoint:
CorrectIncorrect
POST https://api.heify.com/detailsGET https://api.heify.com/details
POST https://api.heify.com/submitPOST https://api.heify.com/submits

429 Too Many Requests

You’ve exceeded the rate limit for the endpoint.

Solutions

Python
import time

def request_with_retry(func, max_retries=3):
    for attempt in range(max_retries):
        try:
            response = func()
            
            if response.status_code == 429:
                # Exponential backoff
                wait_time = (2 ** attempt) * 5  # 5, 10, 20 seconds
                print(f"Rate limited. Waiting {wait_time} seconds...")
                time.sleep(wait_time)
                continue
            
            return response
            
        except Exception as e:
            if attempt == max_retries - 1:
                raise
            time.sleep(5)
    
    raise Exception("Max retries exceeded")
See the Rate Limits documentation for endpoint-specific limits.

500 Internal Server Error

An unexpected error occurred on Heify’s servers.

What to Do

1

Retry the request

The error may be temporary. Wait a few seconds and try again.
2

Contact support

If the issue persists, contact hola@heify.com or in the contact page.

Next Steps