> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salad.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> For autonomous tasks, use live SaladCloud API responses for current state, availability, quotas, models, and other dynamic values. Use current OpenAPI specifications where provided for paths, schemas, required fields, and enums. Never invent endpoints, fields, prices, availability, quotas, models, or state. Prefer API workflows over Portal steps. Read before changing and never expose credentials, signed media URLs, prompts, or sensitive outputs. Retry only safe or idempotent operations with bounded backoff, honoring Retry-After. Verify every write with a read. Stop rather than repeat an uncertain non-idempotent or billable request. AI Gateway uses an organization-specific Bearer key and live /v1/models discovery. Do not delete, cancel, stop, or reduce capacity without explicit user intent. Bind shared operation IDs to the selected product path. Treat Container Engine instances as interruptible and local state as ephemeral. Install the SaladCloud skills (npx skills add https://docs.salad.com), start from the salad skill and /agents/overview; docs MCP: https://docs.salad.com/mcp.

# Using Queues

*Last Updated: October 6, 2026*

# Posting a Job

Jobs are created and added to the queue by sending a `POST` request to the Job Queue API at
`https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs`

> 📘 Using the SaladCloud API
>
> SaladCloud offers a full API to access all of the functionality of the Portal, as well as additional features (such as
> adding Jobs to the Job Queue!). You can learn more about authentication and how to use the SaladCloud API
> [here](https://docs.salad.com/reference/api-usage.md).

# Job Structure

### Input

The request should include an `"input": { ... }` which must be valid JSON. This is the information passed to your
application running in the container.

### Metadata (optional)

The response will include a unique call id generated by SaladCloud that can be used to retrieve your results. If you
wish to attach your own id to the job for tracking purposes, you may include it in an optional, arbitrary
`"metadata": { ... }` object. Note that `metadata` must be a valid JSON *object*, as opposed to the `input` which may be
any JSON format (string, object, number, etc.).

> 📘 JSON output
>
> The Queue Worker expects valid JSON input (that it will pass to your application), as well as valid JSON output
> (completed results that it sends up to the Job Queue). Please ensure that your application returns JSON-formatted
> results.

# Example Job

```json theme={null}
{
  "metadata": {
    "id": "my-custom-id-123"
  },
  "input": {
    "width": 640,
    "height": 480,
    "iterations": 10,
    "re_min": -2,
    "re_max": 1,
    "im_min": -1,
    "im_max": 1,
    "kind": "base64"
  }
}
```

# Example Response

```json theme={null}
{
  "id": "50150edd-e182-47b5-a754-2d2a04d6ee31",
  "input": {
    "width": 640,
    "height": 480,
    "iterations": 10,
    "re_min": -2,
    "re_max": 1,
    "im_min": -1,
    "im_max": 1,
    "kind": "base64"
  },
  "metadata": {
    "id": "my-custom-id-123"
  },
  "status": "pending",
  "events": [
    {
      "action": "created",
      "time": "2024-01-20T01:02:48.4787553+00:00"
    }
  ],
  "create_time": "2024-01-20T01:02:48.4787553+00:00",
  "update_time": "2024-01-20T01:02:48.4787553+00:00"
}
```

Note the Salad-generated `"id"` field. We will use this in the next step when we check the status of the job and
retrieve results.

# Getting the status of a Job

To check the status of a job, you will first need its `id`. The `id` is a string that is provided on the response object
when you created the job.

In our previous example, we saw the id returned on the response object was `50150edd-e182-47b5-a754-2d2a04d6ee31`

Check the status of a job by sending a `GET` request to
`https://api.salad.com/api/public/organizations/{organization_name}/projects/{project_name}/queues/{queue_name}/jobs/{id}`

# Interpreting the Job status

Here is an example response when checking the Job status for job `id` 50150edd-e182-47b5-a754-2d2a04d6ee31:

```json theme={null}
{
  "id": "50150edd-e182-47b5-a754-2d2a04d6ee31",
  "input": {
    "width": 640,
    "height": 480,
    "iterations": 10,
    "re_min": -2,
    "re_max": 1,
    "im_min": -1,
    "im_max": 1,
    "kind": "base64"
  },
  "metadata": {
    "id": "my-custom-id-123"
  },
  "webhook": "https://callback.example.com/result",
  "status": "pending",
  "events": [
    {
      "action": "created",
      "time": "2024-01-20T01:02:48.4787553+00:00"
    }
  ],
  "create_time": "2024-01-20T01:02:48.4787553+00:00",
  "update_time": "2024-01-20T01:02:48.4787553+00:00"
}
```

`"status"` of the job can be:

* `pending` - The job has been added to the queue and is waiting to be run
* `running` - The job has been popped from the queue and dispatched to a workload instance for processing.
* `succeeded` - The job has been run and the response has been received.
* `cancelled` - The job was cancelled. **Note: cancelling a job after it has been dispatched does not stop the work.**
  The request is accepted (`202`) and the job reads `cancelled`, and its output is discarded, but the instance runs the
  job to the end. Write your handlers to be idempotent.
* `failed` - The job was retried three times and failed to run to completion. **Note: once a job has reached a failed
  status, it will not be retried and instead must be resubmitted to the queue.**

## Job events

Each job's `events` list records what happened to it. Each entry has an `action` and a `time`. The `action` is one of
`created`, `started`, `succeeded`, `failed`, or `cancelled`. A retry shows as a `failed` event followed by another
`started` event; there is no separate retry event.

When you list jobs, they are not returned in creation order, and there is no sort parameter. Sort by `create_time` in
your own code if you need an order.

# Viewing results

Once the job has finished, the results will be available on this response object, and at the webhook URL (if provided).
For the payload SaladCloud sends to your webhook and how to verify it, see
[Validating Webhook Signatures](https://docs.salad.com/container-engine/how-to-guides/job-processing/webhook-signature.md#webhook-payload).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.