# List your jobs

`GET https://api.mailmasker.org/api/v1/jobs`

Your 50 most recent background jobs, newest first.

- Who can use it: Any signed-in account
- Area: Background jobs
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/job-list

A job's `state` is pending (waiting its turn), running, completed or failed. While it runs, `progress_current` of `progress_total` says how far it has got; a failed job says why in `error_message`. A finished job's file is `output_name`, `output_size_bytes` long.

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `all` | query | no | 1 for everyone's jobs, not only yours. Site admins only; anyone else gets 403. |  |
| `type` | query | no | Only jobs of this kind, such as zip. |  |
| `state` | query | no | Only jobs in this state, such as failed. |  |

## Good to know

- `started_at` moves on each time a running job makes progress, so it can be later than when the job really began.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/jobs' \
  -H "Authorization: Bearer $TOKEN"
```

Perl:

```perl
use Mojo::Base -strict;
use Mojo::UserAgent;

my $ua  = Mojo::UserAgent->new;
my $res = $ua->get('https://api.mailmasker.org/api/v1/jobs',
    { Authorization => "Bearer $ENV{TOKEN}" })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

```bash
homelab-cli jobs list
```

## Response

200 OK:

```json
[
  {
    "id": 42,
    "type": "zip",
    "state": "completed",
    "user_email": "you@example.com",
    "output_name": "photos.zip",
    "output_size_bytes": 5242880,
    "progress_current": 2,
    "progress_total": 2,
    "error_message": null,
    "created_at": "2026-11-03 21:42:10.123456-06",
    "started_at": "2026-11-03 21:42:19.004211-06",
    "completed_at": "2026-11-03 21:42:31.870442-06"
  }
]
```
