# at.happyproto.admin.listJobs

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.admin.listJobs)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.admin.listJobs/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.admin.listJobs/examples)

## Definitions

### `at.happyproto.admin.listJobs#adminJob`

**Type**: `object`

A background job as staff see it. Never carries its input or session fields.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `completedAt` | `string` (datetime) | No |  |
| `createdAt` | `string` (datetime) | Yes |  |
| `createdBy` | `string` (did) | Yes | Who started it. |
| `error` | `string` | No | Why the job failed, as the job reported it. |
| `id` | `string` | Yes | A UUID. |
| `jobType` | `string` | Yes |  |
| `progress` | `unknown` | No | The job's last progress report. |
| `result` | `unknown` | No | What the job returned, once completed. |
| `startedAt` | `string` (datetime) | No |  |
| `status` | `string` | Yes |  |

### `at.happyproto.admin.listJobs`

**Type**: `query`

Background jobs across every user, newest first. Staff only.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `jobType` | `string` | No | Only jobs of this type. |
| `limit` | `integer` | No |  |
| `status` | `string` | No | Comma-separated statuses to include. Defaults to pending,running,pausing,cancelling. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `jobs` | `array` | Yes |  |

#### Errors

- **AuthRequired**: This endpoint requires an authenticated caller.
- **Forbidden**: The caller is not HappyProto staff.
- **InvalidRequest**: status names an unknown status, or limit is not a whole number from 1 to 200.
- **Upstream**: The jobs could not be read.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "adminJob": {
      "description": "A background job as staff see it. Never carries its input or session fields.",
      "properties": {
        "completedAt": {
          "format": "datetime",
          "type": "string"
        },
        "createdAt": {
          "format": "datetime",
          "type": "string"
        },
        "createdBy": {
          "description": "Who started it.",
          "format": "did",
          "type": "string"
        },
        "error": {
          "description": "Why the job failed, as the job reported it.",
          "type": "string"
        },
        "id": {
          "description": "A UUID.",
          "type": "string"
        },
        "jobType": {
          "type": "string"
        },
        "progress": {
          "description": "The job's last progress report.",
          "type": "unknown"
        },
        "result": {
          "description": "What the job returned, once completed.",
          "type": "unknown"
        },
        "startedAt": {
          "format": "datetime",
          "type": "string"
        },
        "status": {
          "knownValues": [
            "pending",
            "running",
            "paused",
            "pausing",
            "cancelling",
            "completed",
            "failed",
            "cancelled"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "status",
        "jobType",
        "createdBy",
        "createdAt"
      ],
      "type": "object"
    },
    "main": {
      "description": "Background jobs across every user, newest first. Staff only.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not HappyProto staff.",
          "name": "Forbidden"
        },
        {
          "description": "status names an unknown status, or limit is not a whole number from 1 to 200.",
          "name": "InvalidRequest"
        },
        {
          "description": "The jobs could not be read.",
          "name": "Upstream"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "jobs": {
              "items": {
                "ref": "#adminJob",
                "type": "ref"
              },
              "type": "array"
            }
          },
          "required": [
            "jobs"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "jobType": {
            "description": "Only jobs of this type.",
            "type": "string"
          },
          "limit": {
            "default": 50,
            "maximum": 200,
            "minimum": 1,
            "type": "integer"
          },
          "status": {
            "description": "Comma-separated statuses to include. Defaults to pending,running,pausing,cancelling.",
            "type": "string"
          }
        },
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.admin.listJobs",
  "lexicon": 1
}
```
