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

# Create Job

> Create a new job.

Jobs can be triggered via:
- Cron schedule (requires cron_schedule parameter)
- Webhook (generates unique webhook URL)
- Manual API trigger

**Request Body:**
- name: Job name
- trigger_type: "cron", "webhook", or "manual"
- cron_schedule: Cron expression (required for cron trigger)
- planning_mode: "on_the_fly", "predefined_agent", "predefined_team", or "predefined_workflow"
- entity_id: Entity ID (required for predefined modes)
- prompt_template: Prompt template with {{variable}} placeholders
- executor_type: "auto", "specific_queue", or "environment"



## OpenAPI

````yaml https://control-plane.kubiya.ai/api/openapi.json post /api/v1/jobs
openapi: 3.1.0
info:
  title: Agent Control Plane API
  description: Multi-tenant agent orchestration with Temporal workflows
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: health
    description: 🏥 **Health & Status** - Check API health and availability
  - name: authentication
    description: 🔐 **Authentication** - Token validation and auth management
  - name: agents
    description: 🤖 **Agents** - Create and manage AI agents with custom capabilities
  - name: skills
    description: 🛠️ **Tool Sets** - Manage agent skills and tool configurations
  - name: integrations
    description: 🔌 **Integrations** - Connect to external services (Kubiya managed)
  - name: custom-integrations
    description: >-
      ⚙️ **Custom Integrations** - User-defined integration instances with env
      vars, secrets, and files
  - name: integration-templates
    description: >-
      📦 **Integration Templates** - Pre-configured templates for common
      services (PostgreSQL, Redis, MongoDB, etc.)
  - name: secrets
    description: 🔑 **Secrets** - Secure credential storage and retrieval
  - name: teams
    description: 👥 **Teams** - Team management and collaboration
  - name: workflows
    description: 📊 **Workflows** - Multi-step automation and orchestration
  - name: executions
    description: ▶️ **Executions** - Track and monitor workflow runs
  - name: jobs
    description: ⏰ **Jobs** - Scheduled and webhook-triggered tasks
  - name: policies
    description: 🛡️ **Policies** - Access control and security policies
  - name: analytics
    description: 📈 **Analytics** - Usage metrics and performance monitoring
  - name: projects
    description: 📁 **Projects** - Project organization and management
  - name: environments
    description: 🌍 **Environments** - Environment configuration (dev, staging, prod)
  - name: models
    description: 🧠 **Models** - LLM model configuration and management
  - name: runtimes
    description: ⚡ **Runtimes** - Agent execution runtime environments
  - name: workers
    description: 👷 **Workers** - Worker registration and heartbeat monitoring
  - name: storage
    description: 💾 **Storage** - File storage and cloud integration
  - name: context-graph
    description: 🕸️ **Context Graph** - Knowledge graph and context management
  - name: temporal-workflows
    description: >-
      ⚙️ **Temporal Workflows** - Background workflows for context graph
      ingestion, connector operations, and scheduled jobs
  - name: templates
    description: 📝 **Templates** - Reusable configuration templates
paths:
  /api/v1/jobs:
    post:
      summary: Create Job
      description: >-
        Create a new job.


        Jobs can be triggered via:

        - Cron schedule (requires cron_schedule parameter)

        - Webhook (generates unique webhook URL)

        - Manual API trigger


        **Request Body:**

        - name: Job name

        - trigger_type: "cron", "webhook", or "manual"

        - cron_schedule: Cron expression (required for cron trigger)

        - planning_mode: "on_the_fly", "predefined_agent", "predefined_team", or
        "predefined_workflow"

        - entity_id: Entity ID (required for predefined modes)

        - prompt_template: Prompt template with {{variable}} placeholders

        - executor_type: "auto", "specific_queue", or "environment"
      operationId: create_job_api_v1_jobs_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    JobCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Job name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Job description
        enabled:
          type: boolean
          title: Enabled
          description: Whether the job is enabled
          default: true
        trigger_type:
          type: string
          title: Trigger Type
          description: 'Trigger type: ''cron'', ''webhook'', or ''manual'''
        cron_schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Schedule
          description: Cron expression (e.g., '0 17 * * *' for daily at 5pm)
        cron_timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Timezone
          description: Timezone for cron schedule (e.g., 'America/New_York')
          default: UTC
        planning_mode:
          type: string
          title: Planning Mode
          description: >-
            Planning mode: 'on_the_fly', 'predefined_agent', 'predefined_team',
            or 'predefined_workflow'
          default: predefined_agent
        entity_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Type
          description: 'Entity type: ''agent'', ''team'', or ''workflow'''
        entity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Id
          description: Entity ID (agent_id, team_id, or workflow_id)
        prompt_template:
          type: string
          title: Prompt Template
          description: Prompt template (can include {{variables}} for dynamic params)
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
          description: Optional system prompt
        executor_type:
          type: string
          title: Executor Type
          description: 'Executor routing: ''auto'', ''specific_queue'', or ''environment'''
          default: auto
        worker_queue_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Worker Queue Name
          description: Worker queue name for 'specific_queue' executor type
        environment_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment Name
          description: Environment name for 'environment' executor type
        config:
          additionalProperties: true
          type: object
          title: Config
          description: Additional execution config (timeout, retry, etc.)
        execution_environment:
          anyOf:
            - $ref: >-
                #/components/schemas/control_plane_api__app__schemas__job_schemas__ExecutionEnvironment
            - type: 'null'
          description: 'Execution environment: env vars, secrets, integrations'
      type: object
      required:
        - name
        - trigger_type
        - prompt_template
      title: JobCreate
      description: Schema for creating a new job
    JobResponse:
      properties:
        id:
          type: string
          title: Id
        organization_id:
          type: string
          title: Organization Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        enabled:
          type: boolean
          title: Enabled
        status:
          type: string
          title: Status
        trigger_type:
          type: string
          title: Trigger Type
        cron_schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Schedule
        cron_timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Timezone
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
          description: Full webhook URL (generated from webhook_url_path)
        webhook_secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Secret
          description: Webhook HMAC secret for signature verification
        temporal_schedule_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Temporal Schedule Id
        planning_mode:
          type: string
          title: Planning Mode
        entity_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Type
        entity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Id
        entity_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Name
        prompt_template:
          type: string
          title: Prompt Template
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
        executor_type:
          type: string
          title: Executor Type
        worker_queue_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Worker Queue Name
        environment_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment Name
        config:
          additionalProperties: true
          type: object
          title: Config
        execution_environment:
          anyOf:
            - $ref: >-
                #/components/schemas/control_plane_api__app__schemas__job_schemas__ExecutionEnvironment
            - type: 'null'
        last_execution_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Execution Id
        last_execution_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Execution At
        next_execution_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Execution At
        total_executions:
          type: integer
          title: Total Executions
        successful_executions:
          type: integer
          title: Successful Executions
        failed_executions:
          type: integer
          title: Failed Executions
        execution_history:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Execution History
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        updated_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
          description: Email of the user who created the job (enriched)
        updated_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By Email
          description: Email of the user who last updated the job (enriched)
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        last_triggered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Triggered At
      type: object
      required:
        - id
        - organization_id
        - name
        - description
        - enabled
        - status
        - trigger_type
        - cron_schedule
        - cron_timezone
        - temporal_schedule_id
        - planning_mode
        - entity_type
        - entity_id
        - entity_name
        - prompt_template
        - system_prompt
        - executor_type
        - worker_queue_name
        - environment_name
        - config
        - execution_environment
        - last_execution_id
        - last_execution_at
        - next_execution_at
        - total_executions
        - successful_executions
        - failed_executions
        - execution_history
        - created_by
        - updated_by
        - created_at
        - updated_at
        - last_triggered_at
      title: JobResponse
      description: Schema for job response
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    control_plane_api__app__schemas__job_schemas__ExecutionEnvironment:
      properties:
        env_vars:
          additionalProperties:
            type: string
          type: object
          title: Env Vars
          description: Environment variables (key-value pairs)
        secrets:
          items:
            type: string
          type: array
          title: Secrets
          description: Secret names from Kubiya vault
        integration_ids:
          items:
            type: string
          type: array
          title: Integration Ids
          description: Integration UUIDs for delegated credentials
        mcp_servers:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Mcp Servers
          description: >-
            MCP (Model Context Protocol) server configurations. Supports stdio,
            HTTP, and SSE transports.
      type: object
      title: ExecutionEnvironment
      description: Execution environment configuration for jobs
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your Kubiya API token (format: Bearer <token>)'

````