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

# Create package

> Creates a package from one OCI Helm source as a long-running operation.



## OpenAPI

````yaml /openapi-public.json post /packages
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Public API for managing Akua workspaces, clusters, products, and installs.


    Authenticate with a workspace API token via the `Authorization: Bearer
    sk_akua_...` header.


    A workspace-owned token implies its workspace. Broad tokens select the
    active workspace via the optional `Akua-Context` header.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://akua.dev/docs
servers:
  - url: https://api.akua.dev/v1
    description: Production
security: []
tags:
  - name: Auth
    description: Authentication and token management.
  - name: Agents
    description: Agent identities and configuration.
  - name: Agent sessions
    description: Durable agent conversations and tasks.
  - name: Agent turns
    description: Submitted agent work and event emission.
  - name: Agent events
    description: Normalized agent event history and streams.
  - name: Custom domains
    description: Workspace custom domains and routing targets.
  - name: Cloudflare
    description: Cloudflare account credentials and gateway control.
  - name: Clusters
    description: Kubernetes clusters and cluster access operations.
  - name: ComputeConfigs
    description: Workspace compute provider configurations.
  - name: Entitlements
    description: Effective workspace capabilities and limits.
  - name: Dashboards
    description: Dashboard and widget resources.
  - name: Installs
    description: Installation and render operations.
  - name: Machines
    description: Compute machines and lifecycle events.
  - name: Notifications
    description: User notification state.
  - name: Offer Channels
    description: Private offer channels and policy versions.
  - name: Offers
    description: Marketplace offers and redemption tracking.
  - name: Operations
    description: Long-running operation status and controls.
  - name: Order Drafts
    description: Draft checkout orders and checkout sessions.
  - name: Organizations
    description: Organizations, memberships, and managed workspaces.
  - name: Packages
    description: Software packages, versions, and input schemas.
  - name: Products
    description: Marketplace product catalog resources.
  - name: Preview hostnames
    description: Install preview hostnames and routing state.
  - name: Quotas
    description: Workspace quota limits and usage.
  - name: Regions
    description: Available deployment regions.
  - name: Registry
    description: Container registry credentials and repositories.
  - name: Repository change requests
    description: Fork-backed repository change reviews and lifecycle actions.
  - name: Repositories
    description: Source repositories available to the workspace.
  - name: Secrets
    description: Workspace secrets and secret versions.
  - name: Snippets
    description: Reusable snippets and snippet runs.
  - name: Workspace subdomains
    description: Workspace subdomain identity.
  - name: Workspaces
    description: Workspace resources, members, and billing state.
paths:
  /packages:
    post:
      tags:
        - Packages
      summary: Create package
      description: Creates a package from one OCI Helm source as a long-running operation.
      operationId: packages.create
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 53
            description: >-
              Optional workspace/scope context for the request. Carries a single
              workspace wire id (`ws_…`) today. Only needed for broad tokens — a
              workspace-owned token implies its workspace.
            example: ws_j572abc123def456
          required: false
          description: >-
            Optional workspace/scope context for the request. Carries a single
            workspace wire id (`ws_…`) today. Only needed for broad tokens — a
            workspace-owned token implies its workspace.
          name: akua-context
          in: header
        - schema:
            type: string
            minLength: 1
            maxLength: 64
            description: >-
              Optional caller-supplied idempotency key. Any non-empty key up to
              64 characters is accepted. Endpoint-specific documentation
              describes how the key is used.
            example: create-prod-2026-05-07
          required: false
          description: >-
            Optional caller-supplied idempotency key. Any non-empty key up to 64
            characters is accepted. Endpoint-specific documentation describes
            how the key is used.
          name: idempotency-key
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePackageBody'
      responses:
        '202':
          description: Package creation accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PackageOperationEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CreatePackageBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        sources:
          type: array
          items:
            $ref: '#/components/schemas/CreatePackageHelmSource'
          minItems: 1
          maxItems: 1
      required:
        - name
        - sources
      additionalProperties: false
    PackageOperationEnvelope:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 53
        workspace_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 53
        organization_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 54
        owner_type:
          type: string
          enum:
            - install
            - repository_change_request
            - repository
            - workspace
            - machine
            - cluster
            - package
          description: Domain entity collection the operation acts on.
        owner_id:
          type: string
          description: >-
            Prefixed ID of the entity this operation acts on. Prefix matches
            `owner_type` (`ws_`, `mch_`, `clu_`, `pkg_`, `inst_`, `rcr_`,
            `repo_`).
        parent_operation_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 53
          description: ID of the chained parent operation, when present.
        state:
          type: string
          enum:
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELLED
          description: Lifecycle state. Past-participle terminal states per AIP-216.
        done:
          type: boolean
          description: True iff state is a terminal value.
        html_url:
          type: string
          maxLength: 2048
          format: uri
          description: Deep link to the dashboard view of this operation.
          example: https://akua.dev/packages/pkg_j572abc123def456?tab=operations
        metadata:
          $ref: '#/components/schemas/PackageOperationMetadata'
        response:
          $ref: '#/components/schemas/PackageOperationResponse'
        error:
          type:
            - object
            - 'null'
          properties:
            message:
              type: string
          required:
            - message
          description: Populated when `state` is `FAILED` or `CANCELLED`.
        last_error:
          type:
            - object
            - 'null'
          properties:
            message:
              type: string
            step_name:
              type: string
          required:
            - message
          description: >-
            Latest error from any failed step. Populated even mid-flight;
            cleared when the step succeeds on retry.
        started_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds)
        completed_at:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Unix timestamp (seconds)
        steps:
          type: array
          items:
            $ref: '#/components/schemas/PackageOperationStep'
      required:
        - id
        - workspace_id
        - organization_id
        - owner_type
        - owner_id
        - parent_operation_id
        - state
        - done
        - html_url
        - metadata
        - response
        - error
        - last_error
        - started_at
        - completed_at
    ApiErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          properties: {}
          description: Always empty for error responses
      required:
        - success
        - errors
        - result
    CreatePackageHelmSource:
      type: object
      properties:
        kind:
          type: string
          enum:
            - helm
        repo_url:
          type: string
          minLength: 1
          maxLength: 2048
          pattern: ^oci:\/\/
        chart:
          type: string
          maxLength: 255
        target_revision:
          type: string
          minLength: 1
          maxLength: 256
        path:
          type: string
          maxLength: 2048
        values:
          type: object
          additionalProperties: {}
      required:
        - kind
        - repo_url
        - target_revision
      additionalProperties: false
    PackageOperationMetadata:
      type: object
      properties:
        type:
          type: string
          enum:
            - package.create
        idempotency_key:
          type: string
        workspace_id:
          type: string
          minLength: 1
          maxLength: 53
        name:
          type: string
      required:
        - type
        - idempotency_key
        - workspace_id
        - name
    PackageOperationResponse:
      type:
        - object
        - 'null'
      properties:
        type:
          type: string
          enum:
            - package.create
        package_id:
          type: string
          minLength: 1
          maxLength: 54
        package_version_id:
          type: string
          minLength: 1
          maxLength: 55
        repository_id:
          type: string
          minLength: 1
          maxLength: 55
      required:
        - type
        - package_id
        - package_version_id
        - repository_id
      description: Populated only when `done && state === "SUCCEEDED"`.
    PackageOperationStep:
      type: object
      properties:
        name:
          type: string
          description: User-visible milestone name.
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - skipped
          description: Step lifecycle state.
        execution_type:
          type: string
          enum:
            - system
            - user
            - approval
            - skipped
          description: >-
            Step execution kind. `user`/`approval` mean the workflow is blocked
            on a human action. Internal bookkeeping steps are filtered from
            public responses.
        started_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds)
        completed_at:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Unix timestamp (seconds)
        error_message:
          type:
            - string
            - 'null'
        retryable:
          type: boolean
        skippable:
          type: boolean
      required:
        - name
        - status
        - execution_type
        - started_at
        - completed_at
        - error_message
        - retryable
        - skippable
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          example: 7002
          description: Machine-readable error code
        message:
          type: string
          example: Resource not found
          description: Human-readable error message
        path:
          type: array
          items:
            type: string
          example:
            - body
            - name
          description: Field path that caused the error, when applicable
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at
        https://akua.dev/developers/api-tokens

````