Skip to content

The Background Task Management section of the InvenTree API schema is documented below.

InvenTree API 198

API for InvenTree - the intuitive open source inventory management system


License: MIT

Servers

Description URL
http://localhost:8000 http://localhost:8000

background-task


GET /api/background-task/

Description

Return information about the current status of the background task queue.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Response 200 OK


DELETE /api/background-task/failed/

Description

Perform a DELETE operation against this list endpoint.

We expect a list of primary-key (ID) values to be supplied as a JSON object, e.g. { items: [4, 8, 15, 16, 23, 42] }

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Response 204 No Content


GET /api/background-task/failed/

Description

Provides a read-only list of currently failed tasks.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
limit query integer No Number of results to return per page.
offset query integer No The initial index from which to return the results.
ordering query string No Which field to use when ordering the results.
search query string No A search term.

Response 200 OK

{
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
        {
            "args": "string",
            "attempt_count": 0,
            "func": "string",
            "kwargs": "string",
            "name": "string",
            "pk": "string",
            "result": "string",
            "started": "2022-04-13T15:42:05.901Z",
            "stopped": "2022-04-13T15:42:05.901Z"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "example": 123,
            "type": "integer"
        },
        "next": {
            "example": "http://api.example.org/accounts/?offset=400&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "previous": {
            "example": "http://api.example.org/accounts/?offset=200&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "results": {
            "items": {
                "$ref": "#/components/schemas/FailedTask"
            },
            "type": "array"
        }
    },
    "type": "object"
}

DELETE /api/background-task/pending/

Description

Perform a DELETE operation against this list endpoint.

We expect a list of primary-key (ID) values to be supplied as a JSON object, e.g. { items: [4, 8, 15, 16, 23, 42] }

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"

Response 204 No Content


GET /api/background-task/pending/

Description

Provides a read-only list of currently pending tasks.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
limit query integer No Number of results to return per page.
offset query integer No The initial index from which to return the results.

Response 200 OK

{
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
        {
            "args": "string",
            "func": "string",
            "key": "string",
            "kwargs": "string",
            "lock": "2022-04-13T15:42:05.901Z",
            "name": "string",
            "pk": 0,
            "task_id": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "example": 123,
            "type": "integer"
        },
        "next": {
            "example": "http://api.example.org/accounts/?offset=400&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "previous": {
            "example": "http://api.example.org/accounts/?offset=200&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "results": {
            "items": {
                "$ref": "#/components/schemas/PendingTask"
            },
            "type": "array"
        }
    },
    "type": "object"
}

GET /api/background-task/scheduled/

Description

Provides a read-only list of currently scheduled tasks.

Input parameters

Parameter In Type Default Nullable Description
cookieAuth cookie string N/A No API key
basicAuth header string N/A No Basic authentication
tokenAuth header string N/A No Token-based authentication with required prefix "Token"
limit query integer No Number of results to return per page.
offset query integer No The initial index from which to return the results.
ordering query string No Which field to use when ordering the results.
search query string No A search term.

Response 200 OK

{
    "count": 123,
    "next": "http://api.example.org/accounts/?offset=400&limit=100",
    "previous": "http://api.example.org/accounts/?offset=200&limit=100",
    "results": [
        {
            "args": "string",
            "func": "string",
            "kwargs": "string",
            "last_run": "2022-04-13T15:42:05.901Z",
            "name": "string",
            "next_run": "2022-04-13T15:42:05.901Z",
            "pk": 0,
            "repeats": 0,
            "schedule_type": "O",
            "success": true,
            "task": "string"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "count": {
            "example": 123,
            "type": "integer"
        },
        "next": {
            "example": "http://api.example.org/accounts/?offset=400&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "previous": {
            "example": "http://api.example.org/accounts/?offset=200&limit=100",
            "format": "uri",
            "nullable": true,
            "type": "string"
        },
        "results": {
            "items": {
                "$ref": "#/components/schemas/ScheduledTask"
            },
            "type": "array"
        }
    },
    "type": "object"
}

Schemas

FailedTask

Name Type
args string| null
attempt_count integer
func string
kwargs string| null
name string
pk string
result string
started string(date-time)
stopped string(date-time)

PaginatedFailedTaskList

Name Type
count integer
next string(uri)| null
previous string(uri)| null
results Array<FailedTask>

PaginatedPendingTaskList

Name Type
count integer
next string(uri)| null
previous string(uri)| null
results Array<PendingTask>

PaginatedScheduledTaskList

Name Type
count integer
next string(uri)| null
previous string(uri)| null
results Array<ScheduledTask>

PendingTask

Name Type
args string
func string
key string
kwargs string
lock string(date-time)
name string
pk integer
task_id string

ScheduledTask

Name Type
args string| null
func string
kwargs string| null
last_run string(date-time)
name string| null
next_run string(date-time)| null
pk integer
repeats integer
schedule_type ScheduleTypeEnum
success boolean
task string| null

ScheduleTypeEnum

Type: string

Security schemes

Name Type Scheme Description
basicAuth http basic
cookieAuth apiKey
tokenAuth apiKey Token-based authentication with required prefix "Token"

More documentation

More information about InvenTree in the official docs


For more information: https://docs.inventree.org