# Jobs API

Source: https://frameleaf.app/docs/api/reference/jobs/

Use your own server and its scoped API keys.

## Retrieve queue counts and status

GET /api/jobs

Retrieve the counts of the current queue, as well as the current status.

```json
{
  "deprecated": true,
  "description": "Retrieve the counts of the current queue, as well as the current status.",
  "operationId": "getQueuesLegacy",
  "parameters": [],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/QueuesResponseLegacyDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Retrieve queue counts and status",
  "tags": [
    "Jobs",
    "Deprecated"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "job.read"
}
```

## Create a manual job

POST /api/jobs

Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.

```json
{
  "description": "Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.",
  "operationId": "createJob",
  "parameters": [],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/JobCreateDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "204": {
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Create a manual job",
  "tags": [
    "Jobs"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "job.create"
}
```

## List durable job runs

GET /api/jobs/runs



```json
{
  "operationId": "getJobRuns",
  "parameters": [
    {
      "name": "skip",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 0,
        "maximum": 9007199254740991,
        "default": 0,
        "type": "integer"
      }
    },
    {
      "name": "take",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 1,
        "maximum": 100,
        "default": 25,
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/JobRunPageDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "List durable job runs",
  "tags": [
    "Jobs"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "job.read"
}
```

## Inspect selected job run items

GET /api/jobs/runs/{id}/items



```json
{
  "operationId": "getJobRunItems",
  "parameters": [
    {
      "name": "id",
      "required": true,
      "in": "path",
      "schema": {
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
        "type": "string"
      }
    },
    {
      "name": "skip",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 0,
        "maximum": 9007199254740991,
        "default": 0,
        "type": "integer"
      }
    },
    {
      "name": "take",
      "required": false,
      "in": "query",
      "schema": {
        "minimum": 1,
        "maximum": 100,
        "default": 25,
        "type": "integer"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/JobRunItemPageDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Inspect selected job run items",
  "tags": [
    "Jobs"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "job.read"
}
```

## Run jobs

PUT /api/jobs/{name}

Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.

```json
{
  "deprecated": true,
  "description": "Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.",
  "operationId": "runQueueCommandLegacy",
  "parameters": [
    {
      "name": "name",
      "required": true,
      "in": "path",
      "schema": {
        "$ref": "#/components/schemas/QueueName"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/QueueCommandDto"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/QueueResponseLegacyDto"
          }
        }
      },
      "description": ""
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "summary": "Run jobs",
  "tags": [
    "Jobs",
    "Deprecated"
  ],
  "x-frameleaf-admin-only": true,
  "x-frameleaf-permission": "job.create"
}
```
