> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getgranite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Job

> Create and assign a new automation job.

The job will be queued and assigned to an available driver machine.

Args:
    job_type: Type of job (robocorp_package, pyautogui_command)
    payload: Job-specific payload
    priority: Job priority (higher = more important)

Returns:
    Created job details



## OpenAPI

````yaml post /api/jobs
openapi: 3.1.0
info:
  title: Axion Backend API
  description: Backend API for Axion platform with desktop automation capabilities
  version: 1.0.0
servers:
  - url: https://api.getgranite.ai
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security: []
tags:
  - name: Authentication
    description: User authentication and session management
  - name: Organizations
    description: Organization management and membership
  - name: Health
    description: API health and status monitoring
  - name: Automations
    description: Automation planning and execution
  - name: MIG
    description: Managed Instance Group operations
  - name: Agent
    description: Agent execution and streaming
  - name: Onboarding
    description: Organization onboarding flow
  - name: Organization Automations
    description: Organization automation endpoint management
  - name: Organization Endpoints
    description: Public endpoints for organization automations
  - name: Analytics
    description: Analytics and reporting endpoints
paths:
  /api/jobs:
    post:
      tags:
        - jobs
      summary: Create Job
      description: |-
        Create and assign a new automation job.

        The job will be queued and assigned to an available driver machine.

        Args:
            job_type: Type of job (robocorp_package, pyautogui_command)
            payload: Job-specific payload
            priority: Job priority (higher = more important)

        Returns:
            Created job details
      operationId: create_job_api_jobs_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobExecutionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    JobExecutionRequest:
      properties:
        job_type:
          type: string
          title: Job Type
          description: Job type (robocorp_package, pyautogui_command)
        payload:
          additionalProperties: true
          type: object
          title: Payload
          description: Job-specific payload
        priority:
          type: integer
          title: Priority
          description: Job priority (higher = more important)
          default: 0
      type: object
      required:
        - job_type
        - payload
      title: JobExecutionRequest
      description: Request to create a new job
    CreateJobResponse:
      properties:
        job_id:
          type: string
          title: Job Id
          description: Job ID
        status:
          type: string
          title: Status
          description: Initial status
        assigned_to_machine_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Assigned To Machine Id
          description: Assigned machine ID
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
      type: object
      required:
        - job_id
        - status
        - created_at
      title: CreateJobResponse
      description: Response from creating a job
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````