# at.happyproto.admin.listJobs

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

- Kind: query
- Authority: admin.happyproto.at
- Lexicon: 1
- Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.admin.listJobs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.admin.listJobs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.admin.listJobs/analytics)

## Query (`at.happyproto.admin.listJobs`)

Type: query · GET

### Parameters (query string)

- `jobType` (string): Only jobs of this type.
- `limit` (integer)
  - Constraints: minimum: 1, maximum: 200, default: 50
- `status` (string): Comma-separated statuses to include. Defaults to pending,running,pausing,cancelling.

### Output (application/json)

- `jobs` (array, required)
  - `items` (ref)
    - Reference: `#adminJob`

### 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.

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

Type: object

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

### Properties

- `completedAt` (string · datetime)
- `createdAt` (string · datetime, required)
- `createdBy` (string · did, required): Who started it.
- `error` (string): Why the job failed, as the job reported it.
- `id` (string, required): A UUID.
- `jobType` (string, required)
- `progress` (unknown): The job's last progress report.
- `result` (unknown): What the job returned, once completed.
- `startedAt` (string · datetime)
- `status` (string, required)
  - Constraints: knownValues: pending | running | paused | pausing | cancelling | completed | failed | cancelled

## 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
}
```
