Skip to main content
You can check the status of any task by querying the task API:
The workspace gateway also provides GET /api/v1/task/{workspaceId}/{taskId} with a Beam bearer token. Obtain the workspace ID from /api/v1/workspace/current. The workspace and api.beam.cloud/v2 responses are different representations; do not assume their fields are interchangeable. See workspace REST.

Getting the Task ID

  • Task queues return the ID when you submit a task, as {"task_id": "edbcf7ff-e8ce-4199-8661-8e15ed880481"}. See Running Tasks.
  • Endpoints and ASGI apps return it in the X-Task-Id response header.
  • beam task list shows the IDs of recent tasks, and inside your handler the ID is available as context.task_id.

Task Statuses

Your payload will return the status of the task. These are the possible statuses for a task:

Request

Response

The response to /task returns the following data: Here’s what the response payload looks like as JSON:
The per-task cost shown in the dashboard isn’t returned by this API. See Task Cost for how to estimate it.

Waiting for a Task to Finish

Poll the API until the status is no longer PENDING, RUNNING, or RETRY:
With the Python SDK, Client.get_task_by_id() returns a task object that can wait for the result:
To get notified instead of polling, set a callback URL, and Beam will send a POST request to your server when the task finishes.

Cancelling Tasks

Tasks can be cancelled through the api.beam.cloud/v2/task/cancel/ endpoint.

Request

This API accepts a list of tasks, which can be passed in like this:

Response

200