> ## 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 trigger

> Supply expectedUpdatedAt from GET for atomic optimistic concurrency. Stale edits return 409 stale_trigger. Omission uses last-writer-wins updates. Event identity is preserved.

Requires the triggers:write scope.

Accepts a scoped bearer token, vendor-verified run identity, or interactive owner session.



## OpenAPI

````yaml /openapi.yaml put /api/v1/triggers/{triggerId}
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/triggers/{triggerId}:
    put:
      tags:
        - triggers
      summary: Replace trigger
      description: >-
        Supply expectedUpdatedAt from GET for atomic optimistic concurrency.
        Stale edits return 409 stale_trigger. Omission uses last-writer-wins
        updates. Event identity is preserved.


        Requires the triggers:write scope.


        Accepts a scoped bearer token, vendor-verified run identity, or
        interactive owner session.
      operationId: put_api_v1_triggers_triggerId
      parameters:
        - name: triggerId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  pattern: ^(?=.{1,64}$)[a-z0-9]+(?:-[a-z0-9]+)*$
                executionType:
                  type: string
                  enum:
                    - agent
                    - code
                requiresVm:
                  type: boolean
                prompt:
                  default: ''
                  type: string
                  maxLength: 50000
                script:
                  description: >-
                    Retired: new script runs are rejected. Historical reads
                    remain supported.
                  deprecated: true
                  type: string
                  maxLength: 50000
                runNameTemplate:
                  type: string
                  maxLength: 500
                concurrencyLimit:
                  type: integer
                  minimum: 0
                  maximum: 50
                runScopes:
                  description: >-
                    Factorize API scopes for new trigger runs. Omission uses
                    existing scopes on update or read/invoke defaults on create;
                    an empty array grants no application scopes. triggers:write
                    permits configuring triggers and their future run scopes.
                  maxItems: 13
                  type: array
                  items:
                    type: string
                    enum:
                      - team:read
                      - team:write
                      - triggers:read
                      - triggers:write
                      - runs:read
                      - runs:invoke
                      - runs:start
                      - runs:cancel
                      - runs:write
                      - integrations:read
                      - integrations:write
                      - skills:read
                      - skills:write
                executionConfigId:
                  type: string
                  minLength: 1
                tags:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
                vmImage:
                  type: string
                  maxLength: 512
                  pattern: >-
                    ^(?:(?:(?:[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*\/)?[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*(?:\/[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?))?$
                model:
                  type: string
                  maxLength: 120
                effort:
                  type: string
                  enum:
                    - ''
                    - minimal
                    - low
                    - medium
                    - high
                    - xhigh
                events:
                  default: []
                  maxItems: 50
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^[a-z][a-z0-9_-]{0,63}$
                          kind:
                            type: string
                            const: manual
                          template:
                            type: string
                            maxLength: 50000
                          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: ^[a-z][a-z0-9_-]{0,63}$
                          kind:
                            type: string
                            const: schedule
                          template:
                            type: string
                            maxLength: 50000
                          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: ^[a-z][a-z0-9_-]{0,63}$
                          kind:
                            type: string
                            const: webhook
                          template:
                            type: string
                            maxLength: 50000
                          enabled:
                            default: true
                            type: boolean
                          config:
                            oneOf:
                              - type: object
                                properties:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  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:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  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:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  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:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  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: ^[a-z][a-z0-9_-]{0,63}$
                          kind:
                            type: string
                            const: triggerLifecycle
                          template:
                            type: string
                            maxLength: 50000
                          enabled:
                            default: true
                            type: boolean
                          config:
                            type: object
                            properties:
                              sourceTriggerIds:
                                minItems: 1
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                              states:
                                minItems: 1
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - succeeded
                                    - failed
                                    - stopped
                                    - edited
                            required:
                              - sourceTriggerIds
                              - states
                            additionalProperties: false
                        required:
                          - kind
                          - config
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^[a-z][a-z0-9_-]{0,63}$
                          kind:
                            type: string
                            const: triggerIdle
                          template:
                            type: string
                            maxLength: 50000
                          enabled:
                            default: true
                            type: boolean
                          config:
                            type: object
                            properties:
                              sourceTriggerIds:
                                minItems: 1
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                            required:
                              - sourceTriggerIds
                            additionalProperties: false
                        required:
                          - kind
                          - config
                        additionalProperties: false
                skillId:
                  anyOf:
                    - type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    - type: 'null'
                portableIntegrationIds:
                  maxItems: 100
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                modelAccountId:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                githubInstallationIds:
                  maxItems: 100
                  type: array
                  items:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                linearConnectionId:
                  anyOf:
                    - type: string
                      const: linear
                    - type: 'null'
                xConnectionIds:
                  maxItems: 100
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                expectedUpdatedAt:
                  type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
              required:
                - name
              additionalProperties: false
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  enabled:
                    type: boolean
                  requiresVm:
                    type: boolean
                  executionType:
                    type: string
                    enum:
                      - agent
                      - code
                  prompt:
                    type: string
                  script:
                    type: string
                  runNameTemplate:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  model:
                    type: string
                  effort:
                    type: string
                  executionConfig:
                    type: object
                    properties:
                      connectionId:
                        type: string
                      requiresVm:
                        type: boolean
                      workspace:
                        type: string
                      cwd:
                        type: string
                      agentKind:
                        type: string
                      image:
                        type: string
                      region:
                        type: string
                      size:
                        type: string
                      executionType:
                        type: string
                        enum:
                          - agent
                          - code
                      script:
                        type: string
                    required:
                      - connectionId
                      - agentKind
                    additionalProperties: false
                  runScopes:
                    type: array
                    items:
                      type: string
                      enum:
                        - team:read
                        - team:write
                        - triggers:read
                        - triggers:write
                        - runs:read
                        - runs:invoke
                        - runs:start
                        - runs:cancel
                        - runs:write
                        - integrations:read
                        - integrations:write
                        - skills:read
                        - skills:write
                  portableIntegrationIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  modelAccountId:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  githubInstallationIds:
                    type: array
                    items:
                      type: integer
                      exclusiveMinimum: 0
                      maximum: 9007199254740991
                  linearConnectionId:
                    anyOf:
                      - type: string
                        const: linear
                      - type: 'null'
                  xConnectionIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                      pattern: >-
                        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  skillId:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      - type: 'null'
                  executionConfigId:
                    type: string
                  agentKind:
                    type: string
                  concurrencyLimit:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  runningCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  currentRuns:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  maxConcurrency:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  lastRunState:
                    anyOf:
                      - type: string
                        enum:
                          - queued
                          - reserved
                          - starting
                          - running
                          - blocked
                          - stopping
                          - succeeded
                          - failed
                          - stopped
                          - done
                          - ignored
                      - type: 'null'
                  events:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: manual
                            template:
                              type: string
                              maxLength: 50000
                            enabled:
                              default: true
                              type: boolean
                            config:
                              default: {}
                              type: object
                              properties: {}
                              additionalProperties: false
                            triggerId:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - triggerId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: schedule
                            template:
                              type: string
                              maxLength: 50000
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                cron:
                                  type: string
                                  minLength: 1
                                timezone:
                                  type: string
                                  minLength: 1
                              required:
                                - cron
                                - timezone
                              additionalProperties: false
                            triggerId:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - triggerId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: webhook
                            template:
                              type: string
                              maxLength: 50000
                            enabled:
                              default: true
                              type: boolean
                            config:
                              oneOf:
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    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
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - projectId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    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
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - listId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    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
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - installationId
                                    - repositoryId
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: cloudflareTail
                                    integrationId:
                                      type: string
                                      minLength: 1
                                    destination:
                                      type: string
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - integrationId
                                  additionalProperties: false
                            triggerId:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - triggerId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: triggerLifecycle
                            template:
                              type: string
                              maxLength: 50000
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceTriggerIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                states:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - succeeded
                                      - failed
                                      - stopped
                                      - edited
                              required:
                                - sourceTriggerIds
                                - states
                              additionalProperties: false
                            triggerId:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - triggerId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: triggerIdle
                            template:
                              type: string
                              maxLength: 50000
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceTriggerIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                              required:
                                - sourceTriggerIds
                              additionalProperties: false
                            triggerId:
                              type: string
                              format: uuid
                              pattern: >-
                                ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - triggerId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                  skill:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                          key:
                            type: string
                          revision:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                        required:
                          - id
                          - key
                          - revision
                        additionalProperties: false
                      - type: 'null'
                  contextReviewRequired:
                    type: boolean
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - name
                  - enabled
                  - requiresVm
                  - prompt
                  - runNameTemplate
                  - model
                  - executionConfig
                  - runScopes
                  - executionConfigId
                  - agentKind
                  - concurrencyLimit
                  - runningCount
                  - currentRuns
                  - maxConcurrency
                  - lastRunState
                  - events
                  - createdAt
                  - updatedAt
                additionalProperties: false
        '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'
          description: 'stale_trigger: reload and reconcile before retrying'
        '415':
          $ref: '#/components/responses/Error415'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '503':
          $ref: '#/components/responses/Error503'
      security:
        - bearerAuth: []
        - vendorRunIdentity: []
          runIdentityHeader: []
        - cookieAuth: []
components:
  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'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth2
    vendorRunIdentity:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Fresh vendor-signed exe.dev WIF or Fly Machine OIDC token matching the
        provisioned active run. Must be combined with X-Factorize-Run-Id; a
        vendor token alone grants no access.
    runIdentityHeader:
      type: apiKey
      in: header
      name: X-Factorize-Run-Id
      description: >-
        Provisioned run UUID. Used only to locate the immutable vendor/VM
        binding; this header is not a credential. Scopes and tenant come from
        the server-side run snapshot.
    cookieAuth:
      type: apiKey
      in: cookie
      name: factorize_session

````

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