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

# Create an active OpenWork Cloud Automation

> Den schedules Automations and keeps durable run history. Automations created by Desktop run on the owner's connected desktop; Automations created by Web run in OpenWork Cloud. If no desktop runner is connected when a desktop occurrence is due, that occurrence is recorded as missed. Creation makes an Automation active immediately and uses the owner's current OpenWork Connect integrations. Deactivation stops future runs but does not cancel a run already in progress. This is the Web and Cloud Chat creation surface. Placement is fixed to OpenWork Cloud and the Automation can wake a stopped Cloud container without a desktop. Create only when the person explicitly asks to create or schedule it; there is no draft step.



## OpenAPI

````yaml /openapi.json post /v1/cloud-automations
openapi: 3.1.0
info:
  title: Den API
  description: >-
    OpenAPI spec for the Den control plane API.


    Authentication:

    - Use `Authorization: Bearer <session-token>` for user-authenticated routes
    that require a Den session.

    - Use `x-api-key: <den-api-key>` for API-key-authenticated routes that
    accept organization API keys.

    - Public routes like health and documentation do not require authentication.


    Swagger tip: use the security schemes in the Authorize dialog to set either
    `bearerAuth` or `denApiKey` before trying protected endpoints.
  version: dev
servers:
  - url: http://api.den.local
security: []
tags:
  - name: System
    description: Service health and operational routes.
  - name: Organizations
    description: Top-level organization creation and context routes.
  - name: Invitations
    description: Invitation preview, acceptance, creation, and cancellation routes.
  - name: API Keys
    description: Organization API key management routes.
  - name: SCIM
    description: Organization SCIM connector management routes.
  - name: SSO
    description: Organization single sign-on connector management routes.
  - name: Members
    description: Organization member management routes.
  - name: Roles
    description: Organization custom role management routes.
  - name: Teams
    description: Organization team management routes.
  - name: Templates
    description: Organization shared template routes.
  - name: LLM Providers
    description: Organization LLM provider catalog, configuration, and access routes.
  - name: Workers
    description: Worker lifecycle, billing, and runtime routes.
  - name: Worker Runtime
    description: Worker runtime inspection and upgrade routes.
  - name: Worker Activity
    description: Worker heartbeat and activity reporting routes.
  - name: Telemetry
    description: Telemetry event ingestion and adoption analytics.
  - name: Admin
    description: Administrative reporting routes.
  - name: Users
    description: Current user and membership routes.
  - name: Bootstrap
    description: Agent-first provisional workspace setup routes.
paths:
  /v1/cloud-automations:
    post:
      tags:
        - Automations
      summary: Create an active OpenWork Cloud Automation
      description: >-
        Den schedules Automations and keeps durable run history. Automations
        created by Desktop run on the owner's connected desktop; Automations
        created by Web run in OpenWork Cloud. If no desktop runner is connected
        when a desktop occurrence is due, that occurrence is recorded as missed.
        Creation makes an Automation active immediately and uses the owner's
        current OpenWork Connect integrations. Deactivation stops future runs
        but does not cancel a run already in progress. This is the Web and Cloud
        Chat creation surface. Placement is fixed to OpenWork Cloud and the
        Automation can wake a stopped Cloud container without a desktop. Create
        only when the person explicitly asks to create or schedule it; there is
        no draft step.
      operationId: createCloudAutomation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                schedule:
                  oneOf:
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: once
                        timezone:
                          type: string
                          minLength: 1
                          maxLength: 120
                        at:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                      required:
                        - kind
                        - timezone
                        - at
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: daily
                        timezone:
                          type: string
                          minLength: 1
                          maxLength: 120
                        hour:
                          type: integer
                          minimum: 0
                          maximum: 23
                        minute:
                          type: integer
                          minimum: 0
                          maximum: 59
                      required:
                        - kind
                        - timezone
                        - hour
                        - minute
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: weekly
                        timezone:
                          type: string
                          minLength: 1
                          maxLength: 120
                        daysOfWeek:
                          minItems: 1
                          maxItems: 7
                          type: array
                          items:
                            type: integer
                            minimum: 0
                            maximum: 6
                        hour:
                          type: integer
                          minimum: 0
                          maximum: 23
                        minute:
                          type: integer
                          minimum: 0
                          maximum: 59
                      required:
                        - kind
                        - timezone
                        - daysOfWeek
                        - hour
                        - minute
                action:
                  oneOf:
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: agent
                        instructions:
                          type: string
                          minLength: 1
                          maxLength: 100000
                        model:
                          type: object
                          properties:
                            providerId:
                              type: string
                              minLength: 1
                              maxLength: 160
                            modelId:
                              type: string
                              minLength: 1
                              maxLength: 160
                            variant:
                              anyOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 60
                                - type: 'null'
                          required:
                            - providerId
                            - modelId
                      required:
                        - kind
                        - instructions
                        - model
                      additionalProperties: false
                    - type: object
                      properties:
                        kind:
                          type: string
                          const: saved_script
                        script:
                          type: object
                          properties:
                            pluginId:
                              type: string
                              minLength: 1
                              maxLength: 160
                            configObjectId:
                              type: string
                              minLength: 1
                              maxLength: 160
                            configObjectVersionId:
                              type: string
                              minLength: 1
                              maxLength: 160
                          required:
                            - pluginId
                            - configObjectId
                            - configObjectVersionId
                          additionalProperties: false
                        input: {}
                      required:
                        - kind
                        - script
                      additionalProperties: false
              required:
                - name
                - schedule
                - action
              additionalProperties: false
      responses:
        '201':
          description: Active Cloud Automation created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  automation:
                    type: object
                    properties:
                      id:
                        type: string
                        minLength: 1
                        maxLength: 160
                      organizationId:
                        type: string
                        minLength: 1
                        maxLength: 160
                      ownerMemberId:
                        type: string
                        minLength: 1
                        maxLength: 160
                      name:
                        type: string
                        minLength: 1
                        maxLength: 120
                      state:
                        type: string
                        enum:
                          - active
                          - inactive
                          - needs_attention
                          - archived
                      currentRevisionId:
                        type: string
                        minLength: 1
                        maxLength: 160
                      nextDueAt:
                        anyOf:
                          - type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                      latestRunAt:
                        anyOf:
                          - type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                      latestSuccessfulRunId:
                        anyOf:
                          - type: string
                            minLength: 1
                            maxLength: 160
                          - type: 'null'
                      latestSuccessfulResult: {}
                      needsAttentionReason:
                        anyOf:
                          - type: object
                            properties:
                              code:
                                type: string
                                enum:
                                  - owner_membership_lost
                                  - model_access_lost
                                  - provider_unavailable
                                  - connect_access_unavailable
                                  - execution_runtime_unavailable
                              message:
                                type: string
                                minLength: 1
                                maxLength: 2000
                              occurredAt:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                            required:
                              - code
                              - message
                              - occurredAt
                          - type: 'null'
                      createdAt:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      updatedAt:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      archivedAt:
                        anyOf:
                          - type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          - type: 'null'
                    required:
                      - id
                      - organizationId
                      - ownerMemberId
                      - name
                      - state
                      - currentRevisionId
                      - nextDueAt
                      - latestRunAt
                      - needsAttentionReason
                      - createdAt
                      - updatedAt
                      - archivedAt
                  revision:
                    type: object
                    properties:
                      id:
                        type: string
                        minLength: 1
                        maxLength: 160
                      automationId:
                        type: string
                        minLength: 1
                        maxLength: 160
                      version:
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 9007199254740991
                      instructions:
                        type: string
                        minLength: 1
                        maxLength: 100000
                      schedule:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: once
                              timezone:
                                type: string
                                minLength: 1
                                maxLength: 120
                              at:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                            required:
                              - kind
                              - timezone
                              - at
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: daily
                              timezone:
                                type: string
                                minLength: 1
                                maxLength: 120
                              hour:
                                type: integer
                                minimum: 0
                                maximum: 23
                              minute:
                                type: integer
                                minimum: 0
                                maximum: 59
                            required:
                              - kind
                              - timezone
                              - hour
                              - minute
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: weekly
                              timezone:
                                type: string
                                minLength: 1
                                maxLength: 120
                              daysOfWeek:
                                minItems: 1
                                maxItems: 7
                                type: array
                                items:
                                  type: integer
                                  minimum: 0
                                  maximum: 6
                              hour:
                                type: integer
                                minimum: 0
                                maximum: 23
                              minute:
                                type: integer
                                minimum: 0
                                maximum: 59
                            required:
                              - kind
                              - timezone
                              - daysOfWeek
                              - hour
                              - minute
                      model:
                        type: object
                        properties:
                          providerId:
                            type: string
                            minLength: 1
                            maxLength: 160
                          modelId:
                            type: string
                            minLength: 1
                            maxLength: 160
                          variant:
                            anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 60
                              - type: 'null'
                        required:
                          - providerId
                          - modelId
                      action:
                        oneOf:
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: agent
                              instructions:
                                type: string
                                minLength: 1
                                maxLength: 100000
                              model:
                                type: object
                                properties:
                                  providerId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  modelId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  variant:
                                    anyOf:
                                      - type: string
                                        minLength: 1
                                        maxLength: 60
                                      - type: 'null'
                                required:
                                  - providerId
                                  - modelId
                            required:
                              - kind
                              - instructions
                              - model
                            additionalProperties: false
                          - type: object
                            properties:
                              kind:
                                type: string
                                const: saved_script
                              script:
                                type: object
                                properties:
                                  pluginId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  configObjectId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  configObjectVersionId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                required:
                                  - pluginId
                                  - configObjectId
                                  - configObjectVersionId
                                additionalProperties: false
                              input: {}
                            required:
                              - kind
                              - script
                            additionalProperties: false
                      executionTarget:
                        type: string
                        enum:
                          - desktop
                          - cloud
                      maximumRuntimeMs:
                        type: integer
                        minimum: 10000
                        maximum: 3600000
                      digest:
                        type: string
                        minLength: 16
                        maxLength: 128
                      createdAt:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                    required:
                      - id
                      - automationId
                      - version
                      - instructions
                      - schedule
                      - model
                      - maximumRuntimeMs
                      - digest
                      - createdAt
                  latestRun:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                            maxLength: 160
                          automationId:
                            type: string
                            minLength: 1
                            maxLength: 160
                          revisionId:
                            type: string
                            minLength: 1
                            maxLength: 160
                          trigger:
                            type: string
                            enum:
                              - scheduled
                              - recovery
                              - manual
                          scheduledFor:
                            anyOf:
                              - type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              - type: 'null'
                          idempotencyKey:
                            type: string
                            minLength: 1
                            maxLength: 512
                          status:
                            type: string
                            enum:
                              - queued
                              - claimed
                              - running
                              - succeeded
                              - failed
                              - cancelled
                              - skipped
                          leaseOwner:
                            anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 240
                              - type: 'null'
                          leaseExpiresAt:
                            anyOf:
                              - type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              - type: 'null'
                          heartbeatAt:
                            anyOf:
                              - type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              - type: 'null'
                          attemptCount:
                            type: integer
                            minimum: 0
                            maximum: 2
                          executionTarget:
                            type: string
                            enum:
                              - desktop
                              - cloud
                          executionThread:
                            anyOf:
                              - type: object
                                properties:
                                  id:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  threadKind:
                                    type: string
                                    const: automation
                                  executionLocation:
                                    type: string
                                    enum:
                                      - desktop
                                      - cloud
                                  automationId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  automationRunId:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  engineKind:
                                    type: string
                                    minLength: 1
                                    maxLength: 160
                                  nativeThreadId:
                                    anyOf:
                                      - type: string
                                        minLength: 1
                                        maxLength: 160
                                      - type: 'null'
                                  workspaceId:
                                    anyOf:
                                      - type: string
                                        minLength: 1
                                        maxLength: 160
                                      - type: 'null'
                                required:
                                  - id
                                  - threadKind
                                  - executionLocation
                                  - automationId
                                  - automationRunId
                                  - engineKind
                              - type: 'null'
                          providerId:
                            type: string
                            minLength: 1
                            maxLength: 160
                          modelId:
                            type: string
                            minLength: 1
                            maxLength: 160
                          modelVariant:
                            default: null
                            anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 60
                              - type: 'null'
                          startedAt:
                            anyOf:
                              - type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              - type: 'null'
                          finishedAt:
                            anyOf:
                              - type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              - type: 'null'
                          error:
                            anyOf:
                              - type: object
                                properties:
                                  code:
                                    type: string
                                    enum:
                                      - owner_membership_lost
                                      - model_access_lost
                                      - provider_unavailable
                                      - connect_access_unavailable
                                      - execution_runtime_unavailable
                                      - execution_failed
                                      - execution_timed_out
                                      - runner_unavailable
                                      - cancelled
                                      - lease_lost
                                      - internal_error
                                  message:
                                    type: string
                                    minLength: 1
                                    maxLength: 2000
                                  retryable:
                                    type: boolean
                                required:
                                  - code
                                  - message
                                  - retryable
                              - type: 'null'
                          resultSummary:
                            anyOf:
                              - type: string
                                maxLength: 20000
                              - type: 'null'
                          codemodeReceiptId:
                            anyOf:
                              - type: string
                                minLength: 1
                                maxLength: 160
                              - type: 'null'
                          validatedResult: {}
                          usage:
                            type: object
                            properties:
                              inputTokens:
                                anyOf:
                                  - type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  - type: 'null'
                              outputTokens:
                                anyOf:
                                  - type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  - type: 'null'
                              costMicros:
                                anyOf:
                                  - type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  - type: 'null'
                            required:
                              - inputTokens
                              - outputTokens
                              - costMicros
                          createdAt:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          updatedAt:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                        required:
                          - id
                          - automationId
                          - revisionId
                          - trigger
                          - scheduledFor
                          - idempotencyKey
                          - status
                          - leaseOwner
                          - leaseExpiresAt
                          - heartbeatAt
                          - attemptCount
                          - executionTarget
                          - executionThread
                          - providerId
                          - modelId
                          - startedAt
                          - finishedAt
                          - error
                          - resultSummary
                          - usage
                          - createdAt
                          - updatedAt
                      - type: 'null'
                required:
                  - automation
                  - revision
                  - latestRun
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestError'
        '401':
          description: Sign-in required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '409':
          description: Cloud runtime or model access is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestError'
components:
  schemas:
    InvalidRequestError:
      type: object
      properties:
        error:
          type: string
          const: invalid_request
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
            required:
              - message
            additionalProperties: {}
      required:
        - error
        - details
    UnauthorizedError:
      type: object
      properties:
        error:
          type: string
          const: unauthorized
      required:
        - error

````