---
title: "Queues a Background Job"
method: POST
path: "/v1/admin/background_job/queue"
tags: ["Background Jobs"]
---

# Queues a Background Job

`POST /v1/admin/background_job/queue`

Queue a Background Job

## Request body

- BackgroundJobQueueRequest
  - `executor` 'AI' | 'AI_AGENT' | 'AI_BG' | 'BROKER' | 'COMPLIANCE' | 'COST' | 'COST_BG' | 'COST_BG_CLOUD_BILLING' | 'COST_BG_K8S_BILLING' | 'FEATURE_FLAGS' | 'GOVERNANCE' | 'HEATSTACK' | 'HEATSTACK_BG' | 'IDENTITY' | 'IDENTITY_BG' | 'OPERATIONS' | 'REPORT_GENERATION' | 'RESOURCE_INVENTORY' | 'RESOURCE_INVENTORY_BG' | 'SECURITY' — Target Executor for the job
  - `payload` BackgroundJobPayloadBase
    - `identifier` string — Optional sub-key for payload.
    - `resume_target` string
    - `resume_args` string[]
    - `__type` string, required — Concrete type used for polymorphic deserialization (discriminator)
  - `priority` integer — Priority of the Background Job
  - `next_activation` string, date-time — When the Background Job will execute
  - `synchronize_federation` boolean — Ensure all the federation updates are sent
  - `check_for_queued_job` boolean — Only queue if no other job is already queued. Queue if other job is already running
  - `check_for_running_job` boolean — Only queue if no matching job is found
  - `queue_after_running_job` boolean — Queue to run after any matching job
  - `auto_retries` integer — Number of auto retries left for this Background Job
  - `auto_retry_delay` number — Number of seconds to wait before a retry for this Background Job
  - `waiting_on` RecordIdentity[] — Background Jobs this job is dependent for
    - `sysId` string — Unique Identifier of the tracked item
    - `lastUpdate` string, date-time — Last update of the tracked item
    - `table` string — Context of the tracked item

## Response `200`

Queue outcome

- BackgroundJobQueueResponse
  - `created` RecordIdentity
    - `sysId` string — Unique Identifier of the tracked item
    - `lastUpdate` string, date-time — Last update of the tracked item
    - `table` string — Context of the tracked item
  - `existing` RecordIdentity
    - `sysId` string — Unique Identifier of the tracked item
    - `lastUpdate` string, date-time — Last update of the tracked item
    - `table` string — Context of the tracked item

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/corestack/apis/corestack-external-api.md) · [All operations](https://skmtc.net/corestack/apis/corestack-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/corestack/corestack-external-api/versions/bf2cdf20826d/schema)
