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

> ## Agent Instructions
> Use the documentation index to find relevant pages, then read the linked Markdown before answering and cite the source URL.
> Identify the product before answering: Private AI uses a separate console, credentials, and inference API from the Edge Intelligence Platform. Do not apply instructions from one product to the other.
> Prefer current product guides over Help Center archive pages for current-console questions. Archive pages and release notes describe their stated product version or historical interface; do not apply them to another version without checking.
> Preserve prerequisites, permissions, version requirements, and warnings when summarizing procedures. Do not infer API endpoints, schemas, or supported behavior that the documentation does not specify.

# Update patch envelope

> PUT /api/v1/patch-envelope/id/{id}. Edge applications API reference.

Sign in to try this endpointExplore the parameters, examples, and responses below. Connect your ZedCloud session when you’re ready to send a request.

> [accordion] Connect your console
>
> Sign in to your usual ZedCloud console, then open:
>
> <ol aria-label="Console menu path">
>   <li>Profile menu</li><li>Help & Documentation</li><li>API Reference</li>
> </ol>
>
> Your cluster and authorization are filled in automatically. No token to copy.
> [More about signing in ](https://zededa.mintlify.site/api-reference/authentication.md#sign-in-to-the-api-reference)

&#x20;Modifying requests stay off until you enable them.

[Authentication](https://zededa.mintlify.site/api-reference/authentication.md) · [API availability](https://zededa.mintlify.site/api-reference/clusters.md) · [Download OpenAPI](https://zededa.mintlify.site/openapi/services/edge-application.json)

> [!WARNING]
>
> This operation can change resources or access. After signing in, open **API request settings** and select **Enable modifying requests**, then **Apply settings**, to use its playground. Check the request body and destination before selecting **Send**. Your existing API permissions still apply.

A successful response.
Unauthorized. The API gateway did not process the request because it lacks valid authentication credentials for the target resource. The request header has either no authorization details or an authorization that has been refused.
Forbidden. The API gateway did not process the request because the requestor does not have application level access permission for the operation or does not have access scope to the project.
Not Found. The API gateway did not process the request because the requested resource could not be found.
Internal Server Error. The API gateway experienced an unexpected condition. Specific error condition is indicated in error codes.
Gateway Timeout. The API gateway did not receive a timely response from an upstream microservice it needed to communicate with in order to complete the request.
An unexpected error response.


## OpenAPI

````yaml openapi/services/edge-application.json PUT /v1/patch-envelope/id/{id}
openapi: 3.0.0
info:
  title: ZEDEDA Edge Application Service
  description: >-
    The ZEDEDA Edge Application Service is part of ZEDEDA Edge Orchestration
    Platform. This service enables customers to define their edge applications
    on ZEDEDA platform and to deploy/upgrade/restarti/monitor them to edge
    node(s) remotely. You can use the ZEDEDA Edge Application Service to
    provision and manage ilifecycle of thousands of edge applications to
    millions of edge nodes distributed in different geographical locations in a
    secure and scalable manner.
  termsOfService: https://www.zededa.com/terms
  version: '1.0'
  contact:
    name: ZEDEDA API Support
    url: https://www.zededa.com/support
    email: support@zededa.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://{apiHost}/api
    variables:
      apiHost:
        default: invalid.invalid
        description: Connect from ZedUI to supply your verified API destination.
security:
  - BearerToken: []
tags:
  - name: EdgeApplicationConfiguration
  - name: EdgeApplicationInstanceConfiguration
  - name: PatchEnvelopeConfiguration
  - name: EdgeApplicationInstanceStatus
externalDocs:
  description: ZEDEDA Product Documentation
  url: https://docs.zededa.com/-M-8m8d8KqdLpfOgY_jo/edge-apps
paths:
  /v1/patch-envelope/id/{id}:
    put:
      tags:
        - PatchEnvelopeConfiguration
      summary: Update patch envelope
      description: >-
        Update apatch envelope record. The usual pattern to update a patch
        envelope bundle record is to retrieve the record and update with the
        modified values in a new body.
      operationId: PatchEnvelopeConfiguration_UpdatePatchEnvelope
      parameters:
        - name: id
          description: System defined universally unique Id of the patch envelope.
          in: path
          required: true
          schema:
            type: string
        - name: X-Request-Id
          in: header
          required: false
          description: User-Agent specified id to track a request
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: >-
                    User defined name of the patch envelope, unique across the
                    enterprise. Once patch envelope is created, name can’t be
                    changed.
                  maxLength: 256
                  minLength: 3
                  pattern: '[a-zA-Z0-9][a-zA-Z0-9_.-]+'
                  x-zededa-source-issues:
                    - code: inapplicable-constraint
                      pointer: >-
                        #/paths/~1v1~1patch-envelope~1id~1{id}/put/parameters/1/schema/properties/name
                      keyword: uniqueItems
                      sourceValue: true
                title:
                  type: string
                  description: >-
                    User defined title of the patch envelope. Title can be
                    changed at any time.
                  maxLength: 256
                  minLength: 3
                  pattern: '[a-zA-Z0-9]+[a-zA-Z0-9!-~ ]+'
                description:
                  type: string
                  description: Detailed description of the patch envelope.
                  maxLength: 256
                revision:
                  description: system defined info
                  readOnly: true
                  allOf:
                    - $ref: '#/components/schemas/ObjectRevision'
                userDefinedVersion:
                  type: string
                  description: User defined version for the given patch envelope
                  title: optional - arbitrary version string if any by user
                action:
                  description: >-
                    Flag to represent whether device needs to present it to app
                    instance
                  title: |-
                    if activate is false, device should only download
                    images and not present them to app instance
                  allOf:
                    - $ref: '#/components/schemas/PatchEnvelopeAction'
                artifacts:
                  type: array
                  items:
                    $ref: '#/components/schemas/BinaryArtifact'
                  description: Patch envelope artifacts
                projectId:
                  type: string
                  description: project id
                deviceCount:
                  type: number
                  format: int64
                  description: number of devices referencing this patch envelope
                projectName:
                  type: string
                  description: project name
              description: >-
                PatchEnvelope is a proto that should be used by user-agents to
                create/update opaque data for application instances.
              title: Opaque data for application instances
              required:
                - name
                - title
                - action
                - artifacts
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZsrvResponse'
        '401':
          description: >-
            Unauthorized. The API gateway did not process the request because it
            lacks valid authentication credentials for the target resource. The
            request header has either no authorization details or an
            authorization that has been refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZsrvResponse'
        '403':
          description: >-
            Forbidden. The API gateway did not process the request because the
            requestor does not have application level access permission for the
            operation or does not have access scope to the project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZsrvResponse'
        '404':
          description: >-
            Not Found. The API gateway did not process the request because the
            requested resource could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZsrvResponse'
        '500':
          description: >-
            Internal Server Error. The API gateway experienced an unexpected
            condition. Specific error condition is indicated in error codes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZsrvResponse'
        '504':
          description: >-
            Gateway Timeout. The API gateway did not receive a timely response
            from an upstream microservice it needed to communicate with in order
            to complete the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ZsrvResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googlerpcStatus'
components:
  schemas:
    ObjectRevision:
      type: object
      properties:
        prev:
          type: string
          description: Previous
        curr:
          type: string
          description: Current Database version of the record
        createdAt:
          type: object
          format: date-time
          description: >-
            The time, in milliseconds since the epoch, when the record was
            created.
        createdBy:
          type: string
          description: 'User data: Created By'
        updatedAt:
          type: object
          format: date-time
          description: >-
            The time, in milliseconds since the epoch, when the record was last
            updated.
        updatedBy:
          type: string
          description: 'User data: Updated By'
      description: >-
        ObjectRevision store the user details, who has doent the necessary
        operation like Create Operation or update operation
      title: ObjectRevision is used to store the user information.
      required:
        - curr
        - createdAt
        - createdBy
        - updatedAt
        - updatedBy
    PatchEnvelopeAction:
      type: string
      enum:
        - PATCH_ENVELOPE_ACTION_UNSPECIFIED
        - PATCH_ENVELOPE_ACTION_STORE
        - PATCH_ENVELOPE_ACTION_ACTIVATE
      default: PATCH_ENVELOPE_ACTION_UNSPECIFIED
    BinaryArtifact:
      type: object
      properties:
        format:
          title: base64 or binary blob only - secret type is invalid
          allOf:
            - $ref: '#/components/schemas/OpaqueObjectCategory'
        base64Artifact:
          $ref: '#/components/schemas/InlineOpaqueBase64Data'
        binaryArtifact:
          $ref: '#/components/schemas/ExternalOpaqueBinaryBlob'
        artifactMetaData:
          type: string
          title: >-
            optional - any arbitrary metadata about/for artifact encoded to
            base64 string
        id:
          type: string
          description: System defined universally unique Id of the artifact.
          title: artifact id
          readOnly: true
          pattern: >-
            [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
          x-zededa-source-issues:
            - code: inapplicable-constraint
              pointer: '#/definitions/BinaryArtifact/properties/id'
              keyword: uniqueItems
              sourceValue: true
    ZsrvResponse:
      type: object
      properties:
        operationType:
          title: |-
            Describes one of the operations type : possible values
                                    Read/Delete/Create/Update/List
          allOf:
            - $ref: '#/components/schemas/ZcOpsType'
        operationStatus:
          title: if this is log running job
          allOf:
            - $ref: '#/components/schemas/ZcOpsStatus'
        objectKind:
          type: string
          title: zedcloud object kind on which the operation was performed
        objectId:
          type: string
          title: Unique value identifies the object that was operated on
        objectName:
          type: string
          title: name of the object
        objectRevision:
          type: string
          title: |-
            object revision post the operation, note Read operation
            doesn't change the revision
        objectType:
          $ref: '#/components/schemas/ObjectType'
        operationTime:
          type: string
          title: time of operation
        startTime:
          type: string
          title: total time taken by operations
        endTime:
          type: string
        user:
          type: string
          title: the operation is performed on behalf of this user
        httpStatusCode:
          type: integer
          format: int32
          title: http response
        httpStatusMsg:
          type: string
          title: summary of the error in text format
        jobId:
          type: string
          title: for tracking asynchronous tasks
        error:
          type: array
          items:
            $ref: '#/components/schemas/ZsrvError'
          title: |-
            one or more errors will be set if the operation failed
            i.e. httpStatusCode != 2xx
    googlerpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    OpaqueObjectCategory:
      type: string
      enum:
        - OpaqueObjectCategoryUnknown
        - OpaqueObjectCategoryInline
        - OpaqueObjectCategoryExternalBinary
      default: OpaqueObjectCategoryUnknown
    InlineOpaqueBase64Data:
      type: object
      properties:
        base64Data:
          type: string
          title: base64 encoded
        fileNameToUse:
          type: string
          title: |-
            file name to be used for storing this data in EVE.
            the same file name shall be advertised to application agent
        base64MetaData:
          type: string
          title: optional - any arbitrary metadata encoded to base64 string
    ExternalOpaqueBinaryBlob:
      type: object
      properties:
        imageName:
          type: string
          title: Name of the image uploaded into data store
        fileNameToUse:
          type: string
          title: |-
            optional - file name to be used for storing this data in EVE.
            the same file name shall be advertised to application agent
        blobMetaData:
          type: string
          description: >-
            Eve shall use the image name when fileNameToUse is empty

            optional - this can be image type or size etc encoded into a single
            string.

            only the application instance agents will interpret this.
        imageId:
          type: string
    ZcOpsType:
      type: string
      enum:
        - OPS_TYPE_UNSPECIFIED
        - OPS_TYPE_READ
        - OPS_TYPE_DELETE
        - OPS_TYPE_CREATE
        - OPS_TYPE_UPDATE
        - OPS_TYPE_LIST
      default: OPS_TYPE_UNSPECIFIED
      title: ZedCloud internal operation type
    ZcOpsStatus:
      type: string
      enum:
        - OPS_STATUS_UNSPECIFIED
        - OPS_STATUS_PENDING
        - OPS_STATUS_ONGOING
        - OPS_STATUS_COMPLETE
      default: OPS_STATUS_UNSPECIFIED
      description: >-
        - OPS_STATUS_PENDING: In rare cases, system may not start operation when
        it was requested. Client will be notified that operation is PENDING
         - OPS_STATUS_ONGOING: system will start the operation, but at the time response was generated, operation is still ONGOING.
         - OPS_STATUS_COMPLETE: Even if the result of the operations may result in failure, but the OpsStatus will marked COMPLETE for almost all cases.
      title: ZedCloud internal operation status
    ObjectType:
      type: string
      enum:
        - OBJECT_TYPE_UNSPECIFIED
        - OBJECT_TYPE_USER
        - OBJECT_TYPE_EDGE_NODE
        - OBJECT_TYPE_EDGE_APP
        - OBJECT_TYPE_IMAGE
        - OBJECT_TYPE_EDGE_APP_INSTANCE
        - OBJECT_TYPE_PROJECT
        - OBJECT_TYPE_NETWORK
        - OBJECT_TYPE_DATASTORE
        - OBJECT_TYPE_SERVICE
        - OBJECT_TYPE_SERVICE_INSTANCE
        - OBJECT_TYPE_ENTERPRISE
        - OBJECT_TYPE_ROLE
        - OBJECT_TYPE_CREDENTIAL
        - OBJECT_TYPE_NETWORK_INSTANCE
        - OBJECT_TYPE_VOLUME_INSTANCE
        - OBJECT_TYPE_REALM
        - OBJECT_TYPE_AUTHPROFILE
        - OBJECT_TYPE_POLICY
        - OBJECT_TYPE_APP_POLICY
        - OBJECT_TYPE_CLUSTER_INSTANCE
        - OBJECT_TYPE_PLUGIN
        - OBJECT_TYPE_DOC_POLICY
        - OBJECT_TYPE_ORCHESTRATOR_CLUSTER
        - OBJECT_TYPE_TAGS
        - OBJECT_TYPE_EDGE_NODE_INTERFACE
        - OBJECT_TYPE_DEPLOYMENT
        - OBJECT_TYPE_ENTITLEMENTS
        - OBJECT_TYPE_DATA_STREAM
        - OBJECT_TYPE_API_USAGE
        - OBJECT_TYPE_APP_INSTANCE_SNAPSHOT
        - OBJECT_TYPE_PATCH_ENVELOPE
        - OBJECT_TYPE_RESOURCE_USAGE_TRACK
        - OBJECT_TYPE_PATCH_ENVELOPE_REFERENCE
        - OBJECT_TYPE_DEV_PASSTHROUGH
        - OBJECT_TYPE_EDGE_NODE_CLUSTER
        - OBJECT_TYPE_ASSET_GROUP
        - OBJECT_TYPE_APP_PROFILE
        - OBJECT_TYPE_PROFILE_DEPLOYMENT
        - OBJECT_TYPE_ZKS_INSTANCE
        - OBJECT_TYPE_CLUSTER_GROUP
      default: OBJECT_TYPE_UNSPECIFIED
    ZsrvError:
      type: object
      properties:
        ec:
          title: |-
            Enumrated error code, describes more granular numerical
            value than just httpStatus
          allOf:
            - $ref: '#/components/schemas/ZsrvErrorCode'
        location:
          type: string
          title: 'Ignore: Internal field only'
        details:
          type: string
          title: Field captures string description of details
    protobufAny:
      type: object
      properties:
        typeUrl:
          type: string
        value:
          type: string
          format: byte
    ZsrvErrorCode:
      type: string
      enum:
        - zMsgErrorNone
        - zMsgSucess
        - NotFound
        - AlreadyExists
        - VersionMismatch
        - RangeError
        - LargeResult
        - IncompleteData
        - InvalidData
        - FunctionUnsupported
        - NoMemory
        - SendFailure
        - Timeout
        - BadReqBody
        - BadReqParam
        - InvalidFieldFormat
        - UrlNotFound
        - ApiVersionNotSupported
        - Unauthorized
        - Forbidden
        - Conflict
        - NotModified
        - DependencyConflict
        - JsonFmtError
        - ProtoFmtError
        - CertError
        - DataBaseConnection
        - DBError
        - zMsgAccepted
        - zMsgCreated
        - PreConditionFailed
        - InternalServerError
      default: zMsgErrorNone
      description: |-
        - zMsgErrorNone: common validation errors
         - IncompleteData: message had fields that weren't filled in
         - InvalidData: message contained the field that wasn't expected
         - FunctionUnsupported: this feature unavailable on this version of device
         - InvalidFieldFormat: message contained the field that wasn't correctly formatted
         - JsonFmtError: Marshal / Unmarshal errors
         - DataBaseConnection: generic DB error
      title: ZedCould internal error code
  securitySchemes:
    BearerToken:
      type: http
      description: Bearer token for user session
      scheme: bearer

````