---
title: "Create a job"
method: POST
path: "/orgs/{orgName}/jobs"
tags: ["Jobs"]
---

# Create a job

`POST /orgs/{orgName}/jobs`

## Request

- Base URL: `https://api.signadot.com/api/v2`
- URL: `https://api.signadot.com/api/v2/orgs/{orgName}/jobs`
- Auth: API key in header `signadot-api-key`

Creates a job with the provided parameters.

## Path parameters

- `orgName` string, required

## Request body

- Job
  - `createdAt` string
  - `deletedAt` string
  - `name` string
  - `spec` JobSpec
    - `command` string[]
    - `env` JobEnvItem[]
      - `name` string
      - `value` string
    - `labels` object
    - `namePrefix` string
    - `routingContext` JobRoutingContext
      - `routegroup` string
      - `sandbox` string
    - `runnerGroup` string
    - `script` string
    - `trafficManager` JobTrafficManager
      - `enabled` boolean: Explicitly enable traffic manager in runner pods for this job.
      - `injectRoutingKey` 'disabled' | 'auto': InjectRoutingKey indicates if the system should perform automatic injection of routing key headers or not. It may be the empty string, "auto" or "disabled". The empty string defaults to meaning "disabled". The "auto" value will overwrite the value of the Enabled field, setting it to true.
    - `uploadArtifact` JobUploadArtifact[]
      - `meta` object
      - `path` string
  - `status` JobsStatus
    - `attempts` JobsAttempt[]
      - `createdAt` string
      - `executionCount` integer
      - `finishedAt` string
      - `id` integer
      - `phase` 'queued' | 'running' | 'failed' | 'succeeded' | 'canceled'
      - `startedAt` string
      - `state` JobsState
        - `canceled` JobsCanceledState
          - `canceledAt` string
          - `canceledBy` 'timeout' | 'apiRequest' | 'internal'
          - `inCluster` boolean
          - `message` string
        - `failed` JobsFailedState
          - `exitCode` integer, nullable
          - `message` string
          - `retryAttempt` boolean
        - `queued` JobsQueuedState
          - `lastMessage` string
          - `message` string
        - `running` JobsRunningState
          - `podName` string
          - `podNamespace` string
        - `succeeded` JobsSucceededState
          - `exitCode` integer
    - `routingKey` string
    - `runnerGroupDeletionCompletedAt` string

## Response `200`

OK

- Job
  - `createdAt` string
  - `deletedAt` string
  - `name` string
  - `spec` JobSpec
    - `command` string[]
    - `env` JobEnvItem[]
      - `name` string
      - `value` string
    - `labels` object
    - `namePrefix` string
    - `routingContext` JobRoutingContext
      - `routegroup` string
      - `sandbox` string
    - `runnerGroup` string
    - `script` string
    - `trafficManager` JobTrafficManager
      - `enabled` boolean: Explicitly enable traffic manager in runner pods for this job.
      - `injectRoutingKey` 'disabled' | 'auto': InjectRoutingKey indicates if the system should perform automatic injection of routing key headers or not. It may be the empty string, "auto" or "disabled". The empty string defaults to meaning "disabled". The "auto" value will overwrite the value of the Enabled field, setting it to true.
    - `uploadArtifact` JobUploadArtifact[]
      - `meta` object
      - `path` string
  - `status` JobsStatus
    - `attempts` JobsAttempt[]
      - `createdAt` string
      - `executionCount` integer
      - `finishedAt` string
      - `id` integer
      - `phase` 'queued' | 'running' | 'failed' | 'succeeded' | 'canceled'
      - `startedAt` string
      - `state` JobsState
        - `canceled` JobsCanceledState
          - `canceledAt` string
          - `canceledBy` 'timeout' | 'apiRequest' | 'internal'
          - `inCluster` boolean
          - `message` string
        - `failed` JobsFailedState
          - `exitCode` integer, nullable
          - `message` string
          - `retryAttempt` boolean
        - `queued` JobsQueuedState
          - `lastMessage` string
          - `message` string
        - `running` JobsRunningState
          - `podName` string
          - `podNamespace` string
        - `succeeded` JobsSucceededState
          - `exitCode` integer
    - `routingKey` string
    - `runnerGroupDeletionCompletedAt` string

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `502`: Bad Gateway

## Changes

- **2024-05-22** `60a6cefcf87c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/signadot/apis/signadot-api/changes/orgs/:orgName/jobs/post.md)

---

[API](https://skmtc.dev/signadot/apis/signadot-api.md) - [All operations](https://skmtc.dev/signadot/apis/signadot-api/llms.txt) - [OpenAPI document](https://skmtc.dev/signadot/apis/signadot-api/revisions/5e80b0f9c718?raw)
