> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-hypeship-changelog-august-13.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a deployment

> Create a new deployment.



## OpenAPI

````yaml https://api.onkernel.com/spec.json post /deployments
openapi: 3.1.0
info:
  description: Developer tools and cloud infrastructure for AI agents to use web browsers
  title: Kernel API
  version: 0.1.0
servers:
  - description: API Server
    url: https://api.onkernel.com
security:
  - bearerAuth: []
tags:
  - description: Create and manage browser sessions.
    name: Browsers
  - description: Control mouse, keyboard, and screen on the browser instance.
    name: Browser Computer Controls
  - description: Execute Playwright code against the browser instance.
    name: Browser Playwright
  - description: Read, write, and manage files on the browser instance.
    name: Browser Filesystem
  - description: Execute and manage processes on the browser instance.
    name: Browser Processes
  - description: Record and manage browser session video replays.
    name: Browser Replays
  - description: Stream logs from the browser instance.
    name: Browser Logs
  - description: Stream live telemetry events from a browser session.
    name: Browser Telemetry
  - description: Create, list, retrieve, and delete browser profiles.
    name: Profiles
  - description: Create and manage proxy configurations for routing browser traffic.
    name: Proxies
  - description: Create, list, retrieve, and delete browser extensions.
    name: Extensions
  - description: Create and manage browser pools for acquiring and releasing browsers.
    name: Browser Pools
  - description: Inspect the identity and authorization context for the current request.
    name: Authentication
  - description: >-
      Create and manage auth connections for automated credential capture and
      login.
    name: Managed Auth
  - description: Create and manage credentials for authentication.
    name: Credentials
  - description: Configure external credential providers like 1Password.
    name: Credential Providers
  - description: List applications and versions.
    name: Apps
  - description: Create and manage app deployments and stream deployment events.
    name: Deployments
  - description: Invoke actions and stream or query invocation status and events.
    name: Invocations
  - description: Read and manage organization-level limits.
    name: Organization
  - description: |
      Create and manage projects for resource isolation within an organization.
      When projects are disabled for the organization, project operations return
      `404` with code `projects_disabled`.
    name: Projects
  - description: Create and manage API keys for organization and project-scoped access.
    name: API Keys
  - description: Read audit log records for the authenticated organization.
    name: Audit Logs
  - description: Resolve browser and proxy recommendations for bot-protected sites.
    name: Site Configs
paths:
  /deployments:
    post:
      tags:
        - Deployments
      summary: Create a deployment
      description: Create a new deployment.
      operationId: postDeployments
      requestBody:
        content:
          multipart/form-data:
            encoding:
              source:
                contentType: application/json
            examples:
              github_private:
                summary: Deploy from private GitHub repo
                value:
                  source:
                    auth:
                      method: github_token
                      token: ghs_***
                    entrypoint: index.ts
                    path: apps/service
                    ref: main
                    type: github
                    url: https://github.com/org/private-repo
                  version: latest
              github_public:
                summary: Deploy from GitHub source
                value:
                  env_vars:
                    FOO: bar
                  force: false
                  region: aws.us-east-1a
                  source:
                    entrypoint: src/index.ts
                    path: apps/api
                    ref: main
                    type: github
                    url: https://github.com/org/repo
                  version: 1.0.0
              upload_zip:
                summary: Upload a ZIP file
                value:
                  entrypoint_rel_path: src/app.py
                  env_vars:
                    FOO: bar
                  file: <binary>
                  force: false
                  region: aws.us-east-1a
                  version: 1.0.0
            schema:
              $ref: '#/components/schemas/DeploymentRequest'
        description: App deployment data
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
          description: Deployment created successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    DeploymentRequest:
      description: >-
        App deployment request. Provide either file+entrypoint_rel_path or
        source.
      oneOf:
        - required:
            - file
            - entrypoint_rel_path
        - required:
            - source
      properties:
        entrypoint_rel_path:
          description: Relative path to the entrypoint of the application
          example: src/app.py
          type: string
        env_vars:
          additionalProperties:
            type: string
          description: >-
            Map of environment variables to set for the deployed application.
            Each key-value pair represents an environment variable.
          type: object
        file:
          description: ZIP file containing the application source directory
          example: '@path/to/file.zip'
          format: binary
          type: string
        force:
          default: false
          description: Allow overwriting an existing app version
          example: false
          type: boolean
        region:
          const: aws.us-east-1a
          default: aws.us-east-1a
          description: Region for deployment. Currently we only support "aws.us-east-1a"
          example: aws.us-east-1a
          type: string
        source:
          $ref: '#/components/schemas/DeploymentSource'
        version:
          default: latest
          description: Version of the application. Can be any string.
          example: 1.0.0
          type: string
      type: object
    Deployment:
      description: Deployment record information.
      properties:
        created_at:
          description: Timestamp when the deployment was created
          format: date-time
          type: string
        entrypoint_rel_path:
          description: Relative path to the application entrypoint
          example: src/app.py
          type: string
        env_vars:
          additionalProperties:
            type: string
          description: >-
            Environment variables configured for this deployment. Values are
            redacted for API key, OAuth, and managed-auth callers, which receive
            every key with an empty string value. Only dashboard sessions
            receive the actual values.
          type: object
        id:
          description: Unique identifier for the deployment
          example: rr33xuugxj9h0bkf1rdt2bet
          type: string
        region:
          const: aws.us-east-1a
          description: Deployment region code
          example: aws.us-east-1a
          type: string
        source_checksum:
          description: >-
            Hex-encoded SHA-256 checksum of the source archive. For file
            uploads, this hashes the uploaded archive; for GitHub-sourced
            deployments, this hashes the GitHub archive downloaded by the API.
            Omitted for deployments created before this field was recorded.
          example: 3f4d0ea1bd2c5c1a1a1f0e9d8c7b6a5948372615049382716a5b4c3d2e1f0a9b
          type: string
        source_path:
          description: >-
            For GitHub-sourced deployments, the subpath within the repository
            that was used as the deploy root. Omitted when the repo root was
            used or for file uploads.
          example: apps/api
          type: string
        source_ref:
          description: >-
            For GitHub-sourced deployments, the git ref as requested at deploy
            time (branch, tag, or commit SHA — not resolved to a commit).
            Omitted for file uploads.
          example: main
          type: string
        source_type:
          description: >-
            Origin of the deployed source code. This is read-only response
            provenance; `file` indicates an uploaded archive and `github`
            indicates a repository fetched by the API.
          enum:
            - file
            - github
          example: github
          type: string
          x-go-type-name: DeploymentSourceOrigin
        source_url:
          description: >-
            For GitHub-sourced deployments, the repository URL that was fetched.
            Omitted for file uploads.
          example: https://github.com/org/repo
          type: string
        status:
          description: Current status of the deployment
          enum:
            - queued
            - in_progress
            - running
            - failed
            - stopped
          example: queued
          type: string
        status_reason:
          description: Status reason
          example: Deployment in progress
          type: string
        updated_at:
          description: Timestamp when the deployment was last updated
          format: date-time
          nullable: true
          type: string
      required:
        - id
        - status
        - region
        - created_at
      type: object
    DeploymentSource:
      description: Source from which to fetch application code.
      properties:
        auth:
          description: Authentication for private repositories.
          properties:
            method:
              description: Auth method
              enum:
                - github_token
              example: github_token
              type: string
            token:
              description: GitHub PAT or installation access token
              example: ghs_***
              format: password
              type: string
          required:
            - method
            - token
          type: object
        entrypoint:
          description: >-
            Relative path to the application entrypoint within the selected
            path.
          example: src/index.ts
          type: string
        path:
          description: Path within the repo to deploy (omit to use repo root).
          example: apps/api
          type: string
        ref:
          description: Git ref (branch, tag, or commit SHA) to fetch.
          example: main
          type: string
        type:
          description: Source type identifier.
          enum:
            - github
          example: github
          type: string
        url:
          description: Base repository URL (without blob/tree suffixes).
          example: https://github.com/org/repo
          type: string
      required:
        - type
        - url
        - ref
        - entrypoint
      type: object
    Error:
      properties:
        code:
          description: Application-specific error code (machine-readable)
          example: bad_request
          type: string
        details:
          description: Additional error details (for multiple errors)
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
        inner_error:
          $ref: '#/components/schemas/ErrorDetail'
        message:
          description: Human-readable error description for debugging
          example: 'Missing required field: app_name'
          type: string
      required:
        - code
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: Lower-level error code providing more specific detail
          example: invalid_input
          type: string
        message:
          description: Further detail about the error
          example: Provided version string is not semver compliant
          type: string
      type: object
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Bad Request – invalid input
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Resource not found
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      description: Internal Server Error
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````