Daytona admin API

The admin API from Daytona — 15 operation(s) for admin.

OpenAPI Specification

daytona-admin-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Daytona admin API
  description: Daytona AI platform API Docs
  version: '1.0'
  contact:
    name: Daytona Platforms Inc.
    url: https://www.daytona.io
    email: support@daytona.com
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:3000
tags:
- name: admin
paths:
  /admin/runners:
    post:
      operationId: adminCreateRunner
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AdminCreateRunner'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateRunnerResponse'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Create runner
      tags:
      - admin
    get:
      operationId: adminListRunners
      parameters:
      - name: regionId
        required: false
        in: query
        description: Filter runners by region ID
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RunnerFull'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: List all runners
      tags:
      - admin
  /admin/runners/{id}:
    get:
      operationId: adminGetRunnerById
      parameters:
      - name: id
        required: true
        in: path
        description: Runner ID
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunnerFull'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Get runner by ID
      tags:
      - admin
    delete:
      operationId: adminDeleteRunner
      parameters:
      - name: id
        required: true
        in: path
        description: Runner ID
        schema:
          type: string
      responses:
        '204':
          description: ''
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Delete runner
      tags:
      - admin
  /admin/runners/{id}/scheduling:
    patch:
      operationId: adminUpdateRunnerScheduling
      parameters:
      - name: id
        required: true
        in: path
        schema:
          type: string
      responses:
        '204':
          description: ''
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Update runner scheduling status
      tags:
      - admin
  /admin/sandbox/{sandboxId}/recover:
    post:
      operationId: adminRecoverSandbox
      parameters:
      - name: sandboxId
        required: true
        in: path
        description: ID of the sandbox
        schema:
          type: string
      responses:
        '200':
          description: Recovery initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sandbox'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Recover sandbox from error state as an admin
      tags:
      - admin
  /admin/users:
    post:
      operationId: adminCreateUser
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUser'
      responses:
        '201':
          description: ''
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Create user
      tags:
      - admin
    get:
      operationId: adminListUsers
      parameters: []
      responses:
        '200':
          description: ''
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: List all users
      tags:
      - admin
  /admin/users/{id}/regenerate-key-pair:
    post:
      operationId: adminRegenerateKeyPair
      parameters:
      - name: id
        required: true
        in: path
        schema:
          type: string
      responses:
        '201':
          description: ''
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Regenerate user key pair
      tags:
      - admin
  /admin/users/{id}:
    get:
      operationId: adminGetUser
      parameters:
      - name: id
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Get user by ID
      tags:
      - admin
  /admin/webhooks/organizations/{organizationId}/send:
    post:
      operationId: adminSendWebhook
      parameters:
      - name: organizationId
        required: true
        in: path
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendWebhookDto'
      responses:
        '200':
          description: Webhook message sent successfully
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Send a webhook message to an organization
      tags:
      - admin
  /admin/webhooks/organizations/{organizationId}/messages/{messageId}/attempts:
    get:
      operationId: adminGetMessageAttempts
      parameters:
      - name: organizationId
        required: true
        in: path
        schema:
          type: string
      - name: messageId
        required: true
        in: path
        schema:
          type: string
      responses:
        '200':
          description: List of delivery attempts
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Get delivery attempts for a webhook message
      tags:
      - admin
  /admin/webhooks/status:
    get:
      operationId: adminGetWebhookStatus
      parameters: []
      responses:
        '200':
          description: Webhook service status
          content:
            application/json:
              schema:
                type: object
                properties:
                  enabled:
                    type: boolean
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Get webhook service status
      tags:
      - admin
  /admin/webhooks/organizations/{organizationId}/initialize:
    post:
      operationId: adminInitializeWebhooks
      parameters:
      - name: organizationId
        required: true
        in: path
        schema:
          type: string
      responses:
        '201':
          description: Webhooks initialized successfully
        '404':
          description: Organization not found
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Initialize webhooks for an organization
      tags:
      - admin
  /admin/docker-registry/{id}/set-default:
    post:
      operationId: adminSetDefaultRegistry
      parameters:
      - name: id
        required: true
        in: path
        description: ID of the docker registry
        schema:
          type: string
      responses:
        '200':
          description: The docker registry has been set as default.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DockerRegistry'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Set default registry
      tags:
      - admin
  /admin/snapshots/can-cleanup-image:
    get:
      operationId: adminCanCleanupImage
      parameters:
      - name: imageName
        required: true
        in: query
        description: Image name with tag to check
        schema:
          type: string
      responses:
        '200':
          description: Boolean indicating if image can be cleaned up
          content:
            application/json:
              schema:
                type: boolean
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Check if an image can be cleaned up
      tags:
      - admin
  /admin/snapshots/{id}/general:
    patch:
      operationId: adminSetSnapshotGeneralStatus
      parameters:
      - name: id
        required: true
        in: path
        description: Snapshot ID
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetSnapshotGeneralStatusDto'
      responses:
        '200':
          description: Snapshot general status has been set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnapshotDto'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Set snapshot general status
      tags:
      - admin
  /admin/audit:
    get:
      operationId: adminGetAllAuditLogs
      parameters:
      - name: page
        required: false
        in: query
        description: Page number of the results
        schema:
          minimum: 1
          default: 1
          type: number
      - name: limit
        required: false
        in: query
        description: Number of results per page
        schema:
          minimum: 1
          maximum: 200
          default: 100
          type: number
      - name: from
        required: false
        in: query
        description: From date (ISO 8601 format)
        schema:
          format: date-time
          type: string
      - name: to
        required: false
        in: query
        description: To date (ISO 8601 format)
        schema:
          format: date-time
          type: string
      - name: nextToken
        required: false
        in: query
        description: Token for cursor-based pagination. When provided, takes precedence over page parameter.
        schema:
          type: string
      responses:
        '200':
          description: Paginated list of all audit logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedAuditLogs'
      security:
      - bearer: []
      - oauth2:
        - openid
        - profile
        - email
      summary: Get all audit logs
      tags:
      - admin
components:
  schemas:
    RunnerClass:
      type: string
      enum:
      - container
      - vm
      description: The class of the runner
    AdminCreateRunner:
      type: object
      properties:
        regionId:
          type: string
        name:
          type: string
        tags:
          description: Tags to associate with the runner
          example:
          - gpu
          - us-east
          type: array
          items:
            type: string
        apiKey:
          type: string
        apiVersion:
          type: string
          description: The api version of the runner to create
          pattern: ^(0|2)$
          example: '2'
        domain:
          type: string
          description: The domain of the runner
          example: runner1.example.com
        apiUrl:
          type: string
          description: The API URL of the runner
          example: https://api.runner1.example.com
        proxyUrl:
          type: string
          description: The proxy URL of the runner
          example: https://proxy.runner1.example.com
        cpu:
          type: number
          description: The CPU capacity of the runner
          example: 8
        memoryGiB:
          type: number
          description: The memory capacity of the runner in GiB
          example: 16
        diskGiB:
          type: number
          description: The disk capacity of the runner in GiB
          example: 100
      required:
      - regionId
      - name
      - apiKey
      - apiVersion
    RegionType:
      type: string
      enum:
      - shared
      - dedicated
      - custom
      description: The type of the region
    SandboxClass:
      type: string
      enum:
      - small
      - medium
      - large
      description: The class of the runner
    PaginatedAuditLogs:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AuditLog'
        total:
          type: number
        page:
          type: number
        totalPages:
          type: number
        nextToken:
          type: string
          description: Token for next page in cursor-based pagination
      required:
      - items
      - total
      - page
      - totalPages
    RunnerState:
      type: string
      enum:
      - initializing
      - ready
      - disabled
      - decommissioned
      - unresponsive
      description: The state of the runner
    DockerRegistry:
      type: object
      properties:
        id:
          type: string
          description: Registry ID
          example: 123e4567-e89b-12d3-a456-426614174000
        name:
          type: string
          description: Registry name
          example: My Docker Hub
        url:
          type: string
          description: Registry URL
          example: https://registry.hub.docker.com
        username:
          type: string
          description: Registry username
          example: username
        project:
          type: string
          description: Registry project
          example: my-project
        registryType:
          type: string
          description: Registry type
          enum:
          - internal
          - organization
          - transient
          - backup
          example: internal
        createdAt:
          format: date-time
          type: string
          description: Creation timestamp
          example: '2024-01-31T12:00:00Z'
        updatedAt:
          format: date-time
          type: string
          description: Last update timestamp
          example: '2024-01-31T12:00:00Z'
      required:
      - id
      - name
      - url
      - username
      - project
      - registryType
      - createdAt
      - updatedAt
    SnapshotState:
      type: string
      enum:
      - building
      - pending
      - pulling
      - active
      - inactive
      - error
      - build_failed
      - removing
    RunnerFull:
      type: object
      properties:
        id:
          type: string
          description: The ID of the runner
          example: runner123
        domain:
          type: string
          description: The domain of the runner
          example: runner1.example.com
        apiUrl:
          type: string
          description: The API URL of the runner
          example: https://api.runner1.example.com
        proxyUrl:
          type: string
          description: The proxy URL of the runner
          example: https://proxy.runner1.example.com
        cpu:
          type: number
          description: The CPU capacity of the runner
          example: 8
        memory:
          type: number
          description: The memory capacity of the runner in GiB
          example: 16
        disk:
          type: number
          description: The disk capacity of the runner in GiB
          example: 100
        gpu:
          type: number
          description: The GPU capacity of the runner
          example: 1
        gpuType:
          type: string
          description: The type of GPU
        class:
          description: The class of the runner
          example: small
          allOf:
          - $ref: '#/components/schemas/SandboxClass'
        currentCpuUsagePercentage:
          type: number
          description: Current CPU usage percentage
          example: 45.6
        currentMemoryUsagePercentage:
          type: number
          description: Current RAM usage percentage
          example: 68.2
        currentDiskUsagePercentage:
          type: number
          description: Current disk usage percentage
          example: 33.8
        currentAllocatedCpu:
          type: number
          description: Current allocated CPU
          example: 4000
        currentAllocatedMemoryGiB:
          type: number
          description: Current allocated memory in GiB
          example: 8000
        currentAllocatedDiskGiB:
          type: number
          description: Current allocated disk in GiB
          example: 50000
        currentSnapshotCount:
          type: number
          description: Current snapshot count
          example: 12
        currentStartedSandboxes:
          type: number
          description: Current number of started sandboxes
          example: 5
        availabilityScore:
          type: number
          description: Runner availability score
          example: 85
        region:
          type: string
          description: The region of the runner
          example: us
        name:
          type: string
          description: The name of the runner
          example: runner1
        state:
          description: The state of the runner
          example: initializing
          allOf:
          - $ref: '#/components/schemas/RunnerState'
        lastChecked:
          type: string
          description: The last time the runner was checked
          example: '2024-10-01T12:00:00Z'
        unschedulable:
          type: boolean
          description: Whether the runner is unschedulable
          example: false
        tags:
          description: Tags associated with the runner
          example:
          - gpu
          - us-east
          type: array
          items:
            type: string
        createdAt:
          type: string
          description: The creation timestamp of the runner
          example: '2023-10-01T12:00:00Z'
        updatedAt:
          type: string
          description: The last update timestamp of the runner
          example: '2023-10-01T12:00:00Z'
        version:
          type: string
          description: The version of the runner (deprecated in favor of apiVersion)
          example: '0'
          deprecated: true
        apiVersion:
          type: string
          description: The api version of the runner
          example: '0'
          deprecated: true
        runnerClass:
          description: The class of the runner
          example: container
          allOf:
          - $ref: '#/components/schemas/RunnerClass'
        appVersion:
          type: string
          description: The app version of the runner
          example: v0.0.0-dev
          deprecated: true
        apiKey:
          type: string
          description: The API key for the runner
          example: dtn_1234567890
        regionType:
          description: The region type of the runner
          example: shared
          allOf:
          - $ref: '#/components/schemas/RegionType'
      required:
      - id
      - cpu
      - memory
      - disk
      - class
      - region
      - name
      - state
      - unschedulable
      - tags
      - createdAt
      - updatedAt
      - version
      - apiVersion
      - runnerClass
      - apiKey
    SandboxDesiredState:
      type: string
      enum:
      - destroyed
      - started
      - stopped
      - resized
      - archived
      description: The desired state of the sandbox
    SandboxState:
      type: string
      enum:
      - creating
      - restoring
      - destroyed
      - destroying
      - started
      - stopped
      - starting
      - stopping
      - error
      - build_failed
      - pending_build
      - building_snapshot
      - unknown
      - pulling_snapshot
      - archived
      - archiving
      - resizing
      - snapshotting
      - forking
      description: The state of the sandbox
    Sandbox:
      type: object
      properties:
        id:
          type: string
          description: The ID of the sandbox
          example: sandbox123
        organizationId:
          type: string
          description: The organization ID of the sandbox
          example: organization123
        name:
          type: string
          description: The name of the sandbox
          example: MySandbox
        snapshot:
          type: string
          description: The snapshot used for the sandbox
          example: daytonaio/sandbox:latest
        user:
          type: string
          description: The user associated with the project
          example: daytona
        env:
          type: object
          description: Environment variables for the sandbox
          additionalProperties:
            type: string
          example:
            NODE_ENV: production
        labels:
          type: object
          description: Labels for the sandbox
          additionalProperties:
            type: string
          example:
            daytona.io/public: 'true'
        public:
          type: boolean
          description: Whether the sandbox http preview is public
          example: false
        networkBlockAll:
          type: boolean
          description: Whether to block all network access for the sandbox
          example: false
        networkAllowList:
          type: string
          description: Comma-separated list of allowed CIDR network addresses for the sandbox
          example: 192.168.1.0/16,10.0.0.0/24
        target:
          type: string
          description: The target environment for the sandbox
          example: local
        cpu:
          type: number
          description: The CPU quota for the sandbox
          example: 2
        gpu:
          type: number
          description: The GPU quota for the sandbox
          example: 0
        memory:
          type: number
          description: The memory quota for the sandbox
          example: 4
        disk:
          type: number
          description: The disk quota for the sandbox
          example: 10
        state:
          description: The state of the sandbox
          example: creating
          allOf:
          - $ref: '#/components/schemas/SandboxState'
        desiredState:
          description: The desired state of the sandbox
          example: destroyed
          allOf:
          - $ref: '#/components/schemas/SandboxDesiredState'
        errorReason:
          type: string
          description: The error reason of the sandbox
          example: The sandbox is not running
        recoverable:
          type: boolean
          description: Whether the sandbox error is recoverable.
          example: true
        backupState:
          type: string
          description: The state of the backup
          enum:
          - None
          - Pending
          - InProgress
          - Completed
          - Error
          example: None
        backupCreatedAt:
          type: string
          description: The creation timestamp of the last backup
          example: '2024-10-01T12:00:00Z'
        autoStopInterval:
          type: number
          description: Auto-stop interval in minutes (0 means disabled)
          example: 30
        autoArchiveInterval:
          type: number
          description: Auto-archive interval in minutes
          example: 10080
        autoDeleteInterval:
          type: number
          description: Auto-delete interval in minutes (negative value means disabled, 0 means delete immediately upon stopping)
          example: 30
        volumes:
          description: Array of volumes attached to the sandbox
          type: array
          items:
            $ref: '#/components/schemas/SandboxVolume'
        buildInfo:
          description: Build information for the sandbox
          allOf:
          - $ref: '#/components/schemas/BuildInfo'
        createdAt:
          type: string
          description: The creation timestamp of the sandbox
          example: '2024-10-01T12:00:00Z'
        updatedAt:
          type: string
          description: The last update timestamp of the sandbox
          example: '2024-10-01T12:00:00Z'
        lastActivityAt:
          type: string
          description: The last activity timestamp of the sandbox
          example: '2024-10-01T12:00:00Z'
        class:
          type: string
          description: The class of the sandbox
          enum:
          - small
          - medium
          - large
          example: small
          deprecated: true
        daemonVersion:
          type: string
          description: The version of the daemon running in the sandbox
          example: 1.0.0
        runnerId:
          type: string
          description: The runner ID of the sandbox
          example: runner123
        toolboxProxyUrl:
          type: string
          description: The toolbox proxy URL for the sandbox
          example: https://proxy.app.daytona.io/toolbox
      required:
      - id
      - organizationId
      - name
      - user
      - env
      - labels
      - public
      - networkBlockAll
      - target
      - cpu
      - gpu
      - memory
      - disk
      - toolboxProxyUrl
    SandboxVolume:
      type: object
      properties:
        volumeId:
          type: string
          description: The ID of the volume
          example: volume123
        mountPath:
          type: string
          description: The mount path for the volume
          example: /data
        subpath:
          type: string
          description: Optional subpath within the volume to mount. When specified, only this S3 prefix will be accessible. When omitted, the entire volume is mounted.
          example: users/alice
      required:
      - volumeId
      - mountPath
    CreateOrganizationQuota:
      type: object
      properties:
        totalCpuQuota:
          type: number
        totalMemoryQuota:
          type: number
        totalDiskQuota:
          type: number
        maxCpuPerSandbox:
          type: number
        maxMemoryPerSandbox:
          type: number
        maxDiskPerSandbox:
          type: number
        snapshotQuota:
          type: number
        maxSnapshotSize:
          type: number
        volumeQuota:
          type: number
    BuildInfo:
      type: object
      properties:
        dockerfileContent:
          type: string
          description: The Dockerfile content used for the build
          example: 'FROM node:14

            WORKDIR /app

            COPY . .

            RUN npm install

            CMD ["npm", "start"]'
        contextHashes:
          description: The context hashes used for the build
          example:
          - hash1
          - hash2
          type: array
          items:
            type: string
        createdAt:
          format: date-time
          type: string
          description: The creation timestamp
        updatedAt:
          format: date-time
          type: string
          description: The last update timestamp
        snapshotRef:
          type: string
          description: The snapshot reference
          example: daytonaio/sandbox:latest
      required:
      - createdAt
      - updatedAt
      - snapshotRef
    CreateRunnerResponse:
      type: object
      properties:
        id:
          type: string
          description: The ID of the runner
          example: runner123
        apiKey:
          type: string
          description: The API key for the runner
          example: dtn_1234567890
      required:
      - id
      - apiKey
    SendWebhookDto:
      type: object
      properties:
        eventType:
          description: The type of event being sent
          example: sandbox.created
          allOf:
          - $ref: '#/components/schemas/WebhookEvent'
        payload:
          type: object
          description: The payload data to send
          example:
            id: sandbox-123
            name: My Sandbox
        eventId:
          type: string
          description: Optional event ID for idempotency
          example: evt_1234567890abcdef
      required:
      - eventType
      - payload
    AuditLog:
      type: object
      properties:
        id:
          type: string
        actorId:
          type: string
        actorEmail:
          type: string
        actorApiKeyPrefix:
          type: string
        actorApiKeySuffix:
          type: string
        organizationId:
          type: string
        action:
          type: string
        targetType:
          type: string
        targetId:
          type: string
        statusCode:
          type: number
        errorMessage:
          type: string
        ipAddress:
          type: string
        userAgent:
          type: string
        source:
          type: string
        metadata:
          type: object
          additionalProperties: true
        createdAt:
          format: date-time
          type: string
      required:
      - id
      - actorId
      - actorEmail
      - action
      - createdAt
    SnapshotDto:
      type: object
      properties:
        id:
          type: string
        organizationId:
          type: string
        general:
          type: boolean
        name:
          type: string
        imageName:
          type: string
        state:
          allOf:
          - $ref: '#/components/schemas/SnapshotState'
        size:
          type: number
          nullable: true
        entrypoint:
          nullable: true
          type: array
          items:
            type: string
        cpu:
          type: number
        gpu:
          type: number
        mem:
          type: number
        disk:
          type: number
        errorReason:
          type: string
          nullable: true
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        lastUsedAt:
          format: date-time
          type: string
          nullable: true
        buildInfo:
          description: Build information for the snapshot
          allOf:
          - $ref: '#/components/schemas/BuildInfo'
        regionIds:
          description: IDs of regions where the snapshot is available
          type: array
          items:
            type: string
        initialRunnerId:
          type: string
          description: The initial runner ID of the snapshot
          example: runner123
        ref:
          type: string
          description: The snapshot reference
          example: daytonaio/sandbox:latest
      required:
      - id
      - general
      - name
      - state
      - size
      - entrypoint
      - cpu
      - gpu
      - mem
      - disk
      - errorReason
      - createdAt
      - updatedAt
      - lastUsedAt
    UserPublicKey:
      type: object
      properties:
        key:
          type: string
          description: Public key
        name:
          type: string
          description: Key name
      required:
      - key
      - name
    WebhookEvent:
      type: string
      enum:
      - sandbox.created
      - sandbox.state.updated
      - snapshot.created
      - snapshot.state.updated
      - snapshot.removed
      - volume.created
      - volume.state.updated
      description: The type of event being sent
    SetSnapshotGeneralStatusDto:
      type: object
      properties:
        general:
          type: boolean
          description: Whether the snapshot is general
          example: true
      required:
      - general
    User:
      type: object
      properties:
        id:
          type: string
          description: User ID
        name:
          type: string
          description: User name
        email:
          type: string
          description: User email
        publicKeys:
          description: User public keys
          type: array
          items:
            $ref: '#/components/schemas/UserPub

# --- truncated at 32 KB (32 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/daytona/refs/heads/main/openapi/daytona-admin-api-openapi.yml