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

# Update order draft

> Sets the fields present in the body and keeps the others; the fields can be set in any order. Only a `draft` before `expires_at` changes (410 after). A new Workspace is created at once.



## OpenAPI

````yaml /openapi-public.json patch /order_drafts/{id}
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Manage installs and their asynchronous operations. Authenticate with a
    session bearer token and select a Workspace using Akua-Context.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://docs.akua.dev/
servers:
  - url: https://api.akua.dev/v1
security: []
tags:
  - name: operations
  - name: installs
  - name: Organizations
  - name: Billing accounts
  - name: workspaces
  - name: regions
  - name: Dashboard Overview
  - name: products
  - name: offers
  - name: Order Drafts
  - name: packages
  - name: Auth
  - name: API Tokens
  - name: Quota adjustments
  - name: Workspace services
  - name: Vault connections
  - name: clusters
  - name: Node pools
  - name: Nodes
  - name: machines
  - name: Sandboxes
  - name: OpenCode Servers
  - name: vaults
  - name: vaultSecrets
paths:
  /order_drafts/{id}:
    patch:
      tags:
        - Order Drafts
      summary: Update order draft
      description: >-
        Sets the fields present in the body and keeps the others; the fields can
        be set in any order. Only a `draft` before `expires_at` changes (410
        after). A new Workspace is created at once.
      operationId: orderDrafts.update
      parameters:
        - name: id
          in: path
          schema:
            type: string
            description: Order draft ID
            examples:
              - odft_j572abc...
            minLength: 1
            maxLength: 55
          required: true
        - name: if-match
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 256
            description: >-
              The `etag` of the resource version the client last read. Required
              on writes when the resource exposes an `etag` field. Mismatch
              returns 409 `ABORTED` with the current etag in the error metadata.
            examples:
              - '42'
          required: true
        - name: idempotency-key
          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.
            examples:
              - create-prod-2026-05-07
          required: false
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderDraftBody'
        required: true
      responses:
        '200':
          description: Order draft updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDraft'
        '400':
          description: The request is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequest'
        '401':
          description: Missing, invalid or expired credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorized'
        '403':
          description: The credential may not act in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbidden'
        '404':
          description: The resource was not found in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiNotFound'
        '409':
          description: >-
            The request conflicts with existing resource state or immutable
            intent. | The resource changed since the etag the client sent; the
            current etag is in the metadata. | The idempotency key was already
            used for a different request.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ApiConflict'
                  - $ref: '#/components/schemas/ApiPreconditionFailed'
                  - $ref: '#/components/schemas/ApiIdempotencyConflict'
        '410':
          description: The resource is permanently unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGone'
        '422':
          description: The request is well-formed but cannot be processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnprocessable'
        '429':
          description: The caller is over its per-minute budget.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTooManyRequests'
        '500':
          description: The server failed to handle the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInternalServerError'
        '503':
          description: The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiServiceUnavailable'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateOrderDraftBody:
      type: object
      properties:
        workspace:
          $ref: '#/components/schemas/OrderDraftWorkspace'
        cluster_id:
          anyOf:
            - type: string
              minLength: 1
              maxLength: 55
            - type: 'null'
          description: >-
            A Cluster in the Workspace; `null` clears it. To use a new hosted
            Cluster, create it (and its server) through /v1/clusters first.
        values:
          type: object
          description: >-
            Replaces the configuration values as a whole. Sensitive fields
            (`x-ui.sensitive`) are refused here; send them with `:redeem`.
      additionalProperties: false
    OrderDraft:
      type: object
      properties:
        id:
          type: string
          description: Order draft ID
          examples:
            - odft_j572abc...
          minLength: 1
          maxLength: 55
        offer_id:
          type: string
          description: The Offer this draft redeems
        status:
          $ref: '#/components/schemas/OrderDraftStatus'
        workspace_id:
          anyOf:
            - type: string
            - type: 'null'
        cluster_id:
          anyOf:
            - type: string
            - type: 'null'
        values:
          type: object
          description: >-
            The customer's configuration values, without the Offer's values and
            without sensitive values.
        missing:
          type: array
          items:
            $ref: '#/components/schemas/OrderDraftMissing'
        problems:
          type: array
          items:
            $ref: '#/components/schemas/OrderDraftProblem'
        install_id:
          anyOf:
            - type: string
            - type: 'null'
        operation_id:
          anyOf:
            - type: string
              description: The Install's create Operation; poll /v1/operations
            - type: 'null'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
          maxItems: 32
          description: >-
            What needs attention now; empty when nothing does. Reasons:

            - `install-failed` (error): the Offer was redeemed but the Install
            could not be created; the draft is `failed`.
        redeemed_at:
          anyOf:
            - type: integer
              minimum: 0
              description: Unix timestamp (seconds)
            - type: 'null'
        created_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds)
        updated_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds)
        expires_at:
          type: integer
          description: Unix timestamp (seconds)
          allOf:
            - minimum: 0
              description: After this time a `draft` can no longer change or redeem.
        etag:
          type: string
      required:
        - id
        - offer_id
        - status
        - workspace_id
        - cluster_id
        - values
        - missing
        - problems
        - install_id
        - operation_id
        - conditions
        - redeemed_at
        - created_at
        - updated_at
        - expires_at
        - etag
      additionalProperties: false
    ApiBadRequest:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Validation
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiUnauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unauthorized
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiForbidden:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Forbidden
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiNotFound:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - NotFound
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiConflict:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Conflict
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiPreconditionFailed:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - PreconditionFailed
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - type: object
              properties:
                code:
                  type: number
                  enum:
                    - 7006
                message:
                  type: string
                metadata:
                  type: object
                  properties:
                    current_etag:
                      type: string
                  required:
                    - current_etag
                  allOf:
                    - type: object
                      additionalProperties:
                        type: string
              required:
                - code
                - message
                - metadata
              additionalProperties: false
          maxItems: 1
          minItems: 1
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiIdempotencyConflict:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - IdempotencyConflict
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiGone:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Gone
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiUnprocessable:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unprocessable
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiTooManyRequests:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - TooManyRequests
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiInternalServerError:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - InternalServerError
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - type: object
              properties:
                code:
                  type: number
                  enum:
                    - 7009
                message:
                  type: string
                  enum:
                    - Internal server error
              required:
                - code
                - message
              additionalProperties: false
          maxItems: 1
          minItems: 1
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiServiceUnavailable:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - ServiceUnavailable
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    OrderDraftWorkspace:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - existing
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
          required:
            - kind
            - workspace_id
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - new
            name:
              type: string
              minLength: 1
              maxLength: 100
              pattern: ^(?=.*\S)[^\p{Cc}\p{Zl}\p{Zp}]+$
            organization:
              type: string
              minLength: 1
              maxLength: 54
              description: >-
                The Organization the new Workspace is created in; the customer
                must be its owner or admin. There is no default.
          required:
            - kind
            - name
            - organization
          additionalProperties: false
      description: >-
        An existing Workspace of the customer, or a new one in a named
        Organization of the customer, created at once and owned by the customer.
        Setting the same new name again on this draft answers the same
        Workspace.
    OrderDraftStatus:
      type: string
      enum:
        - draft
        - redeeming
        - installing
        - cancelled
        - failed
      description: >-
        `draft`: editable. `redeeming`: fields frozen while the Offer is
        redeemed and the Install created; `:redeem` again resumes it.
        `installing`: the Install exists (`install_id`, `operation_id`).
        `failed`: the Offer redeemed but the Install could not be created
        (condition `install-failed`). `cancelled`: ended by the customer.
    OrderDraftMissing:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - workspace
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - cluster
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - value
            pointer:
              type: string
              description: >-
                JSON pointer into the configuration values, such as
                `/auth/password`
              examples:
                - /replicas
              minLength: 1
              maxLength: 512
            sensitive:
              type: boolean
              description: >-
                A sensitive value is sent only with `:redeem` and never stored
                on the draft; it stays missing until then.
          required:
            - kind
            - pointer
            - sensitive
          additionalProperties: false
      description: Something `:redeem` still needs.
    OrderDraftProblem:
      oneOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - offer
            reason:
              type: string
              enum:
                - not_found
                - not_for_you
                - unavailable
                - exhausted
            message:
              type: string
              description: Why, for the customer to read
          required:
            - kind
            - reason
            - message
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - workspace
            workspace_id:
              type: string
            reason:
              type: string
              enum:
                - not_allowed
                - deleting
            message:
              type: string
              description: Why, for the customer to read
          required:
            - kind
            - workspace_id
            - reason
            - message
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - cluster
            cluster_id:
              type: string
            reason:
              type: string
              enum:
                - not_found
                - other_workspace
                - not_ready
                - access_unreported
                - namespaces_not_allowed
            message:
              type: string
              description: Why, for the customer to read
          required:
            - kind
            - cluster_id
            - reason
            - message
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - value
            pointer:
              type: string
              description: >-
                JSON pointer into the configuration values, such as
                `/auth/password`
              examples:
                - /replicas
              minLength: 1
              maxLength: 512
            reason:
              type: string
              enum:
                - invalid
                - locked
            message:
              type: string
              description: Why, for the customer to read
          required:
            - kind
            - pointer
            - reason
            - message
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - expired
            message:
              type: string
              description: Why, for the customer to read
          required:
            - kind
            - message
          additionalProperties: false
      description: Something wrong now; `:redeem` refuses while any is present.
    Condition:
      type: object
      properties:
        reason:
          type: string
          maxLength: 64
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: Kebab-case reason; the resource documents the reasons it reports.
          examples:
            - agent-offline
        severity:
          type: string
          enum:
            - error
            - warning
            - info
          description: >-
            `error`: the resource failed; the condition says why. `warning`: it
            is limited or held until the person acts or it recovers. `info`:
            worth knowing, nothing to do.
        message:
          type: string
          maxLength: 512
          description: Safe to show the person as is.
        remedy:
          anyOf:
            - $ref: '#/components/schemas/FailureRemedy'
            - type: 'null'
          description: What the person can do; null when nothing they do helps.
        last_transition_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds) when this condition last changed.
      required:
        - reason
        - severity
        - message
        - remedy
        - last_transition_at
      additionalProperties: false
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Machine-readable error code
          examples:
            - 7002
        message:
          type: string
          description: Human-readable error message
          examples:
            - Resource not found
        path:
          type: array
          items:
            type: string
          description: Field path that caused the error, when applicable
          examples:
            - - body
              - name
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
      additionalProperties: false
    FailureRemedy:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              enum:
                - free-capacity
            metric:
              type: string
              enum:
                - kaas/clusters
                - compute/machines
                - compute/cpu
                - compute/memory
                - compute/machines_concurrency
                - compute/managed_vm_trial
                - agents/turns_concurrency
                - agents/sandboxes
                - agents/sandboxes_running
                - agents/retained_filesystem_lifetime
                - codemode/executions
                - api/secrets_access
                - api/secrets_write
                - domain_routing/preview_hostnames
                - domain_routing/custom_domains
                - source_control/repositories
            limit:
              type: integer
            usage:
              type: integer
            hint:
              type: string
              maxLength: 256
          required:
            - kind
            - metric
            - limit
            - usage
            - hint
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - upgrade-plan
            metric:
              type: string
              enum:
                - kaas/clusters
                - compute/machines
                - compute/cpu
                - compute/memory
                - compute/machines_concurrency
                - compute/managed_vm_trial
                - agents/turns_concurrency
                - agents/sandboxes
                - agents/sandboxes_running
                - agents/retained_filesystem_lifetime
                - codemode/executions
                - api/secrets_access
                - api/secrets_write
                - domain_routing/preview_hostnames
                - domain_routing/custom_domains
                - source_control/repositories
          required:
            - kind
            - metric
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - grant-access
            namespace:
              anyOf:
                - type: string
                  maxLength: 63
                - type: 'null'
            permissions:
              type: array
              prefixItems:
                - type: string
                  maxLength: 256
              minItems: 1
              items:
                type: string
                maxLength: 256
              maxItems: 64
          required:
            - kind
            - namespace
            - permissions
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - reconnect
            what:
              type: string
              enum:
                - cluster-agent
                - connection
          required:
            - kind
            - what
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - add-machine
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - add-billing
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - change-input
            path:
              type: array
              items:
                type: string
                maxLength: 128
              maxItems: 32
          required:
            - kind
            - path
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - retry
            after_seconds:
              anyOf:
                - type: integer
                - type: 'null'
          required:
            - kind
            - after_seconds
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - run-agent-install
              description: >-
                Run the command from `POST /v1/clusters/{id}/connector_install`
                again; it re-applies the ClusterConnector and its updater at one
                release.
          required:
            - kind
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              enum:
                - customer-upgrade
              description: >-
                The change needs rights the agent was not granted. Run `command`
                (a `helm upgrade`, no secret) with an identity that holds
                `permissions`, or grant them to the agent.
            permissions:
              type: array
              prefixItems:
                - type: string
                  maxLength: 256
              minItems: 1
              items:
                type: string
                maxLength: 256
              maxItems: 64
            command:
              type: string
              minLength: 1
              maxLength: 8192
          required:
            - kind
            - permissions
            - command
          additionalProperties: false
  securitySchemes:
    BearerAuth:
      description: Bearer token for the authenticated caller.
      type: http
      scheme: bearer

````

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