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

# Replace job

> Requires the flows:write scope.

Accepts a scoped bearer token or interactive owner session.



## OpenAPI

````yaml /openapi.yaml put /api/v1/jobs/{jobId}
openapi: 3.1.0
info:
  title: Factorize API
  version: 1.0.0
  description: >-
    Versioned Factorize REST API. See the hosted docs for examples and OAuth
    discovery.
  x-dashboard-auth: >-
    Access-token and authorized-client management and trace replay operations
    require an interactive owner session; all other operations accept a suitably
    scoped bearer token or owner session.
servers:
  - url: https://app.factorize.sh
security:
  - bearerAuth: []
paths:
  /api/v1/jobs/{jobId}:
    put:
      tags:
        - jobs
      summary: Replace job
      description: |-
        Requires the flows:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: put_api_v1_jobs_jobId
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobInput'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '415':
          $ref: '#/components/responses/Error415'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '503':
          $ref: '#/components/responses/Error503'
      security:
        - bearerAuth: []
components:
  schemas:
    JobInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        slug:
          type: string
          pattern: ^[a-z][a-z0-9_-]{0,29}$
        promptTemplate:
          type: string
          minLength: 1
          maxLength: 50000
        runNameTemplate:
          type: string
          maxLength: 500
        concurrencyLimit:
          default: 1
          type: integer
          minimum: 1
          maximum: 50
        executionTargetId:
          type: string
          minLength: 1
        model:
          type: string
          maxLength: 120
        effort:
          type: string
          maxLength: 40
        triggers:
          default: []
          maxItems: 50
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: manual
                  enabled:
                    default: true
                    type: boolean
                  config:
                    default: {}
                    type: object
                    properties: {}
                    additionalProperties: false
                required:
                  - kind
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: schedule
                  enabled:
                    default: true
                    type: boolean
                  config:
                    type: object
                    properties:
                      cron:
                        type: string
                        minLength: 1
                      timezone:
                        type: string
                        minLength: 1
                    required:
                      - cron
                      - timezone
                    additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: webhook
                  enabled:
                    default: true
                    type: boolean
                  config:
                    oneOf:
                      - type: object
                        properties:
                          handlerCode:
                            type: string
                            maxLength: 16384
                          provider:
                            type: string
                            const: linear
                          projectId:
                            type: string
                            minLength: 1
                          matchRules:
                            minItems: 1
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - owner
                                    - creator
                                    - status
                                    - label
                                    - assignee
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - type
                                - targetId
                        required:
                          - provider
                          - projectId
                          - matchRules
                        additionalProperties: false
                      - type: object
                        properties:
                          handlerCode:
                            type: string
                            maxLength: 16384
                          provider:
                            type: string
                            const: clickup
                          listId:
                            type: string
                            minLength: 1
                          matchRules:
                            minItems: 1
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - owner
                                    - creator
                                    - status
                                    - label
                                    - assignee
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - type
                                - targetId
                        required:
                          - provider
                          - listId
                          - matchRules
                        additionalProperties: false
                      - type: object
                        properties:
                          handlerCode:
                            type: string
                            maxLength: 16384
                          provider:
                            type: string
                            const: github
                          installationId:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          repositoryId:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          event:
                            type: string
                            minLength: 1
                          action:
                            type: string
                            minLength: 1
                          matchRules:
                            minItems: 1
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - owner
                                    - creator
                                    - status
                                    - label
                                    - assignee
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - type
                                - targetId
                        required:
                          - provider
                          - installationId
                          - repositoryId
                        additionalProperties: false
                      - type: object
                        properties:
                          handlerCode:
                            type: string
                            maxLength: 16384
                          provider:
                            type: string
                            const: cloudflareTail
                          integrationId:
                            type: string
                            minLength: 1
                        required:
                          - provider
                          - integrationId
                        additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: jobLifecycle
                  enabled:
                    default: true
                    type: boolean
                  config:
                    type: object
                    properties:
                      sourceJobIds:
                        minItems: 1
                        type: array
                        items:
                          type: string
                          minLength: 1
                      states:
                        minItems: 1
                        type: array
                        items:
                          type: string
                          enum:
                            - succeeded
                            - failed
                            - stopped
                            - edited
                    required:
                      - sourceJobIds
                      - states
                    additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
      required:
        - name
        - slug
        - promptTemplate
        - executionTargetId
      additionalProperties: false
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    Error400:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error401:
      description: Invalid or revoked credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error403:
      description: Missing scope or required owner session
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error404:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error409:
      description: Operation conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error415:
      description: Unsupported media type; use application/json
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error429:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error500:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error503:
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth2

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.