---
title: "Wait for jobs"
description: "The long poll. Wait for 1 to 12 jobs to finish in one call. The call reads the jobs every 2 to 5 seconds. It returns when all the jobs are completed, failed or canceled, or when `timeout_seconds` is over. Each item of `jobs` is the same object that `GET /v1/jobs/{id}/status` returns, in the order of `ids`. A job ID that is not in this workspace gives `{ id, error: { code: job_not_found } }` in its place. When `all_terminal` is false, send the call again with the IDs that are not finished. This call is free."
url: https://docs.roasos.com/api-reference/jobs/waitForJobs
---

# Wait for jobs

The long poll. Wait for 1 to 12 jobs to finish in one call. The call reads the jobs every 2 to 5 seconds. It returns when all the jobs are completed, failed or canceled, or when `timeout_seconds` is over. Each item of `jobs` is the same object that `GET /v1/jobs/{id}/status` returns, in the order of `ids`. A job ID that is not in this workspace gives `{ id, error: { code: job_not_found } }` in its place. When `all_terminal` is false, send the call again with the IDs that are not finished. This call is free.

## `GET /v1/jobs/wait`

Endpoint: `GET https://api.roasos.com/v1/jobs/wait`

Wait for jobs

The long poll. Wait for 1 to 12 jobs to finish in one call. The call reads the jobs every 2 to 5 seconds. It returns when all the jobs are completed, failed or canceled, or when `timeout_seconds` is over. Each item of `jobs` is the same object that `GET /v1/jobs/{id}/status` returns, in the order of `ids`. A job ID that is not in this workspace gives `{ id, error: { code: job_not_found } }` in its place. When `all_terminal` is false, send the call again with the IDs that are not finished. This call is free.

### Parameters

- `ids` (query) — required: 1 to 12 different job IDs, separated by commas. Repeated `ids` keys are also accepted.
- `timeout_seconds` (query): The maximum time to wait, in seconds. The call returns before this time is over.

### Responses

- `200`: The status of each job, and whether all of them are terminal
- `400`: validation_error: ids or timeout_seconds is not valid

Read the full reference at https://docs.roasos.com/api-reference/jobs/waitForJobs.
