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

# Change whether a release is required, or its connecting code

> The firmware, archive, description and notes of a release are fixed once it's made.
Create a new release to send different firmware.




## OpenAPI

````yaml https://manage.nervescloud.com/api/openapi patch /api/orgs/{org_name}/products/{product_name}/deployments/{name}/releases/{number}
openapi: 3.0.0
info:
  description: >
    The NervesCloud API gives users full access to their

    Orgs, Products, and corresponding Device fleets.


    The API can be used to integrate with your own systems, providing full
    access to your Product and Device data.


    The API is documented using the OpenAPI 3.0 specification.
  title: NervesCloud API
  version: 2.0.0
servers:
  - url: https://manage.nervescloud.com
    variables: {}
security:
  - bearer_auth: []
tags:
  - description: Archive uploading and downloading
    name: Archives
  - description: User authentication and API token creation
    name: Auth
  - description: Organization Certificate Authority management
    name: CA Certificates
  - description: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices
  - description: Log lines Devices have sent over the logging extension
    name: Device Logs
  - description: Metric history Devices have reported over the health or metrics extension
    name: Device Metrics
  - description: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices (short URL)
  - description: Device Certificate management
    name: Device Certificates
  - description: Keys and secrets a Device can connect with instead of a certificate
    name: Device Shared Secrets
  - description: Identities a Device holds on networks NervesHub does not run
    name: Network Identities
  - description: Deployment Group and release management
    name: Deployment Groups
  - description: Firmware uploading and management
    name: Firmwares
  - description: Organization iroh endpoint id registration
    name: Iroh Endpoints
  - description: Organization management
    name: Organizations
  - description: Organization User membership management
    name: Organization Members
  - description: Product management
    name: Products
  - description: Organization Signing Key management
    name: Signing Keys
  - description: Product Support Script management
    name: Support Scripts
  - description: Endpoints an Organization sends its Products' Device events to
    name: Webhooks
  - description: Platform healthcheck
    name: Platform Status
paths:
  /api/orgs/{org_name}/products/{product_name}/deployments/{name}/releases/{number}:
    patch:
      tags:
        - Deployment Groups
      summary: Change whether a release is required, or its connecting code
      description: >
        The firmware, archive, description and notes of a release are fixed once
        it's made.

        Create a new release to send different firmware.
      operationId: NervesHubWeb.API.DeploymentReleaseController.update
      parameters:
        - description: Organization Name
          example: example_org
          in: path
          name: org_name
          required: true
          schema:
            type: string
        - description: Product Name
          example: example_product
          in: path
          name: product_name
          required: true
          schema:
            type: string
        - description: Deployment Group Name
          example: production
          in: path
          name: name
          required: true
          schema:
            type: string
        - description: Release number within the deployment group
          example: 3
          in: path
          name: number
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentReleaseUpdateRequest'
        description: Release update request body
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentReleaseResponse'
          description: Release response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangesetErrorResponse'
          description: Unprocessable Entity
      callbacks: {}
      security:
        - bearer_auth: []
components:
  schemas:
    DeploymentReleaseUpdateRequest:
      description: >-
        PATCH body for changing a release. Only these fields can change once a
        release is made; any left out keep their value.
      example:
        connecting_code: Logger.info("connected")
        connecting_code_mode: first
        required: true
      properties:
        connecting_code:
          description: >-
            Elixir run on a device when it connects, as long as this release is
            the one it is sent. Null or an empty string removes it.
          nullable: true
          type: string
        connecting_code_mode:
          description: >-
            Where the release's connecting code runs relative to the deployment
            group's: "first" (before it), "last" (after it) or "override"
            (instead of it)
          enum:
            - first
            - last
            - override
          type: string
        required:
          description: >-
            Devices that have not reached a required release are updated to it
            before any newer release
          type: boolean
      title: DeploymentReleaseUpdateRequest
      type: object
    DeploymentReleaseResponse:
      description: A single release
      properties:
        data:
          $ref: '#/components/schemas/DeploymentRelease'
      title: DeploymentReleaseResponse
      type: object
    ErrorResponse:
      description: Error response
      example:
        errors:
          detail: Resource Not Found or Authorization Insufficient
      properties:
        errors:
          properties:
            detail:
              type: string
          type: object
      title: ErrorResponse
      type: object
    ChangesetErrorResponse:
      description: Validation error response
      example:
        errors:
          identifier:
            - can't be blank
      properties:
        errors:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
      title: ChangesetErrorResponse
      type: object
    DeploymentRelease:
      example:
        archive_uuid: null
        connecting_code: null
        connecting_code_mode: last
        created_by:
          email: jane@example.com
          name: Jane Doe
          type: user
        delta_status: ready
        description: Fixes the Wi-Fi reconnect loop
        firmware:
          architecture: arm
          platform: rpi0
          uuid: d9f8c63a-1234-5678-abcd-ef0123456789
          version: 1.0.1
        inserted_at: '2024-01-01T00:00:00'
        is_current: true
        notes: Roll out after the field test passes
        number: 3
        required: false
        updated_at: '2024-01-01T00:00:00'
      properties:
        archive_uuid:
          nullable: true
          type: string
        connecting_code:
          description: >-
            Elixir run on a device when it connects, as long as this release is
            the one it is sent
          nullable: true
          type: string
        connecting_code_mode:
          description: >-
            Where the release's connecting code runs relative to the deployment
            group's: "first" (before it), "last" (after it) or "override"
            (instead of it)
          enum:
            - first
            - last
            - override
          type: string
        created_by:
          $ref: '#/components/schemas/Author'
        delta_status:
          description: >-
            Whether the deltas this release's devices need are ready:
            "preparing" while one is still being built, "failed" if one gave up
          enum:
            - ready
            - preparing
            - failed
          type: string
        description:
          nullable: true
          type: string
        firmware:
          $ref: '#/components/schemas/ReleaseFirmware'
        inserted_at:
          description: >-
            When it was created, in UTC. Written without an offset, such as
            `2026-01-15T09:34:27`, so not an RFC 3339 `date-time`.
          type: string
        is_current:
          description: Whether this is the deployment group's current release
          type: boolean
        notes:
          nullable: true
          type: string
        number:
          description: The release's number within its deployment group, from 1
          type: integer
        required:
          description: >-
            Devices that have not reached a required release are updated to it
            before any newer release
          type: boolean
        updated_at:
          description: >-
            When it was last changed, in UTC. Written without an offset, such as
            `2026-01-15T09:34:27`, so not an RFC 3339 `date-time`.
          type: string
      title: DeploymentRelease
      type: object
    Author:
      description: >-
        Who created the release: a user, or a product API key. Null for releases
        made before authors were recorded.
      example:
        email: jane@example.com
        name: Jane Doe
        type: user
      nullable: true
      properties:
        email:
          description: Only for a user
          type: string
        name:
          type: string
        type:
          enum:
            - user
            - api_key
          type: string
      required:
        - type
        - name
      title: Author
      type: object
    ReleaseFirmware:
      description: The firmware a release sends
      example:
        architecture: arm
        platform: rpi0
        uuid: d9f8c63a-1234-5678-abcd-ef0123456789
        version: 1.0.0
      properties:
        architecture:
          type: string
        platform:
          type: string
        uuid:
          type: string
        version:
          type: string
      title: ReleaseFirmware
      type: object
  securitySchemes:
    bearer_auth:
      description: >
        A user API token, or a product API key created in a product's settings.


        A product API key only works on the routes for its own product, under

        `/api/orgs/{org_name}/products/{product_name}`, and on
        `/api/devices/{identifier}`

        for that product's devices. What it may do there is decided by the role
        it

        holds, the same way a member's role decides what they may do.
      scheme: bearer
      type: http

````

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