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

# Run Job

> Creates and runs a new job. You must specify the cluster to run on and the package
whose workflow the job should perform. You can also pass static and dynamic variables.




## OpenAPI

````yaml /integrateio-openapi.yaml post /jobs
openapi: 3.0.3
info:
  title: Integrate.io (Xplenty) ETL API
  description: >
    The Integrate.io ETL API (formerly Xplenty) provides functions for
    controlling and monitoring

    clusters, jobs, packages, schedules, deliveries, connections, and account
    management.


    After defining a data processing package using the Integrate.io web
    application, you can call

    this API to create clusters, run jobs, monitor their progress, and terminate
    jobs and clusters.


    ## Authentication

    All API calls require your API key via HTTP Basic Authentication.

    Enter your API key as the **username** and leave the **password** blank.

    ```

    curl -u YOUR_API_KEY: https://api.xplenty.com/{account_id}/api/clusters

    ```


    ## API Versioning

    All requests must include the `Accept` header with the API version:

    ```

    Accept: application/vnd.xplenty+json; version=2

    ```

    Without this header, requests may be routed incorrectly and return `404`
    errors.


    ## Pagination

    Collection endpoints support `offset` and `limit` query parameters.

    Pagination info is provided via the `Link` header (RFC 5988).


    ## Rate Limits

    Each user is allocated 5,000 credits per hour. Most API calls cost 1 credit.

    Exceeding the limit returns a `429 Too Many Requests` response.
  version: '2.0'
  contact:
    name: Integrate.io Support
    url: https://www.integrate.io
  license:
    name: Proprietary
servers:
  - url: https://api.xplenty.com/{account_id}/api
    description: Production API
    variables:
      account_id:
        description: Your Integrate.io (Xplenty) account ID
        default: my-account
security:
  - apiKeyAuth: []
tags:
  - name: Clusters
    description: Create, manage, monitor, and terminate compute clusters
  - name: Jobs
    description: Run, monitor, and manage data processing jobs
  - name: Packages
    description: Manage data flow packages
  - name: Package Validations
    description: Validate package configurations
  - name: Schedules
    description: Create and manage recurring job schedules
  - name: Deliveries
    description: Manage data delivery blueprints
  - name: Connections
    description: Manage data source and destination connections
  - name: Accounts
    description: Manage Integrate.io accounts
  - name: Members
    description: Manage account members and roles
  - name: Users
    description: Manage authenticated user information
  - name: Public Keys
    description: Manage SSH public keys
  - name: Notifications
    description: View and manage user notifications
  - name: Hooks
    description: Manage webhooks for event notifications
  - name: System
    description: System information (regions, stacks, time zones, variables)
  - name: Billing
    description: Subscription, invoices, and payment methods
paths:
  /jobs:
    post:
      tags:
        - Jobs
      summary: Run Job
      description: >
        Creates and runs a new job. You must specify the cluster to run on and
        the package

        whose workflow the job should perform. You can also pass static and
        dynamic variables.
      operationId: runJob
      parameters:
        - $ref: '#/components/parameters/acceptHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobCreate'
            example:
              cluster_id: 167
              package_id: 103
              variables:
                MY_STATIC_VAR: some static variable
              dynamic_variables:
                current_time: CurrentTime()
                MY_CURRENT_TIME: $CURRENT_TIME_VAR
      responses:
        '201':
          description: Job created and started
          content:
            application/vnd.xplenty+json; version=2:
              schema:
                $ref: '#/components/schemas/Job'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  parameters:
    acceptHeader:
      name: Accept
      in: header
      required: true
      description: API version header — required on all requests
      schema:
        type: string
        default: application/vnd.xplenty+json; version=2
  schemas:
    JobCreate:
      type: object
      required:
        - cluster_id
        - package_id
      properties:
        cluster_id:
          type: integer
          description: ID of the cluster to run on
        package_id:
          type: integer
          description: ID of the package to execute
        variables:
          type: object
          additionalProperties:
            type: string
          description: Static variables for the job
        dynamic_variables:
          type: object
          additionalProperties:
            type: string
          description: Dynamic variables (evaluated at runtime)
    Job:
      type: object
      properties:
        id:
          type: integer
          example: 157
        status:
          type: string
          enum:
            - idle
            - pending
            - queued
            - running
            - completed
            - failed
            - pending_stoppage
            - stopping
            - stopped
          example: completed
        owner_id:
          type: integer
        progress:
          type: number
          format: double
          minimum: 0
          maximum: 1
          example: 1
        outputs_count:
          type: integer
          example: 2
        outputs:
          type: array
          items:
            $ref: '#/components/schemas/JobOutput'
        variables:
          type: object
          additionalProperties: true
        dynamic_variables:
          type: object
          additionalProperties: true
        started_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        failed_at:
          type: string
          format: date-time
          nullable: true
        updated_at:
          type: string
          format: date-time
        cluster_id:
          type: integer
          example: 52
        package_id:
          type: integer
          example: 434
        errors:
          type: string
        runtime_in_seconds:
          type: integer
        url:
          type: string
          format: uri
        html_url:
          type: string
          format: uri
        log_url:
          type: string
          format: uri
          nullable: true
        creator:
          type: object
          properties:
            type:
              type: string
            display_name:
              type: string
            id:
              type: integer
            url:
              type: string
              format: uri
        package:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            url:
              type: string
              format: uri
        cluster:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            url:
              type: string
              format: uri
    JobOutput:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          example: projected_results
        records_count:
          type: integer
          example: 10415234
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        url:
          type: string
          format: uri
        component:
          type: object
          properties:
            name:
              type: string
            type:
              type: string
            fields:
              type: array
              items:
                type: string
    Error:
      type: object
      properties:
        message:
          type: string
          example: Item not found.
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing credentials
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: Billing information required
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Invalid fields provided
      content:
        application/vnd.xplenty+json; version=2:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: basic
      description: |
        Enter your API key as the username. Leave the password field blank.
        Example: `curl -u YOUR_API_KEY: https://api.xplenty.com/...`

````