Skip to main content
Check the status and progress of a template build job.

Endpoint

GET /v1/templates/build/{build_id}/status

Request

Headers

Authorization: Bearer your_api_key_here

Path Parameters

ParameterTypeRequiredDescription
build_idstring✅ YesBuild job ID returned from build request

Response

Status Code: 200 OK
{
  "build_id": "489",
  "template_id": "489",
  "status": "building",
  "progress": 75,
  "current_step": "Creating memory snapshot",
  "started_at": "2025-11-05T22:00:03Z",
  "completed_at": null,
  "error_message": null
}
Response Fields:
FieldTypeDescription
build_idstringBuild job ID
template_idstringTemplate ID
statusstringBuild status (see below)
progressintegerBuild progress percentage (0-100)
current_stepstringCurrent build step description
started_atstringBuild start timestamp (ISO 8601)
completed_atstringBuild completion timestamp (ISO 8601, null if not completed)
error_messagestringError message if build failed (null otherwise)

Status Values

StatusDescription
buildingBuild in progress
activeBuild complete, template ready to use
failedBuild failed (check error_message)

Examples

  • cURL
  • Python
  • JavaScript
curl -H "Authorization: Bearer hopx_live_..." \
  https://api.hopx.dev/v1/templates/build/489/status

Polling Example

Poll the status until build completes:
import requests
import time

def wait_for_build(build_id, api_key, timeout=3600):
    """Poll build status until complete"""
    start_time = time.time()
    
    while True:
        response = requests.get(
            f"https://api.hopx.dev/v1/templates/build/{build_id}/status",
            headers={"Authorization": f"Bearer {api_key}"}
        )
        status = response.json()
        
        if status['status'] == 'active':
            print("✅ Build complete!")
            return status
        elif status['status'] == 'failed':
            raise Exception(f"Build failed: {status.get('error_message')}")
        
        # Check timeout
        if time.time() - start_time > timeout:
            raise TimeoutError("Build timeout")
        
        # Poll every 5 seconds
        print(f"Building... {status['progress']}% - {status['current_step']}")
        time.sleep(5)

# Usage
status = wait_for_build("489", api_key)
print(f"Template ID: {status['template_id']}")

Error Responses

404 Not Found - Build ID not found
{
  "error": "Build not found",
  "message": "Build ID '489' does not exist"
}
401 Unauthorized - Invalid API key
{
  "error": "Unauthorized",
  "message": "Invalid API key"
}

Next Steps