Skip to main content

Overview of Calling Modes

BizyAir offers three calling modes, switched via HTTP headers. No request body changes are needed:

Synchronous Blocking

The default mode. The HTTP connection stays open until the task completes. No special header is required.
The response contains the task result, including outputs[].object_url.
Synchronous mode requires a long-lived connection. Make sure your HTTP client’s read timeout is at least 60 seconds to prevent the client from disconnecting while the task is still running.

Async Polling

Enable by adding the X-BizyAir-Task-Async: enable header to your request.

Step 1: Submit an async task and get therequest_id

Returns 202 Accepted immediately:

Step 2: Poll the task status

Step 3: Retrieve results once the status is Success

Complete Python Example

Webhook Callback

Enable by adding the X-BizyAir-Task-WebHook-Url header to your request.

Step 1: Submit a task with a webhook

Returns 202 Accepted + request_Id immediately.

Step 2: Receive results at your callback endpoint

When the task completes, BizyAir sends a POST request to the URL you specified:
  • Method: POST
  • Headers: Content-Type: application/json, User-Agent: Go-http-client/1.1, along with your X-BizyAir-Task-Authorization and any other X-BizyAir-Task-* headers you set
  • Body: Contains the complete task result

Node.js Callback Server Example

Your callback endpoint must return HTTP 200 OK. If it returns a non-200 status, times out, or is unreachable, the platform will retry on a schedule (approximately every 6 seconds, up to 10 attempts). The per-request timeout is approximately 10 seconds.

Choosing a Calling Mode

Query Task Status

Get the current status and metadata of a task (queue info, runtime, etc.).
Response fields (inside data): Status enum:

Query Task Results

Retrieve the outputs (object_url, etc.) of a completed task.
Response example:
outputs[] field reference:

Cancel Task

Only works for tasks in the Queuing state; removes the task from the queue.
Cancellation is idempotent — repeated calls have no side effects. If the task is already running, use Interrupt instead.

Interrupt Task

Only works for tasks in the Running state; forces a stop.
Interrupting a running task still incurs charges for the portion already executed. Only tasks in the Queuing state can be cancelled at no charge.