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

# Create a new Deployment Group for a Product



## OpenAPI

````yaml https://manage.nervescloud.com/api/openapi post /api/orgs/{org_name}/products/{product_name}/deployments
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: 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: >-
      Device management, including action requests eg. upgrade, reboot,
      reconnect
    name: Devices (short URL)
  - description: Device Certificate management
    name: Device Certificates
  - 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: Platform healthcheck
    name: Platform Status
paths:
  /api/orgs/{org_name}/products/{product_name}/deployments:
    post:
      tags:
        - Deployment Groups
      summary: Create a new Deployment Group for a Product
      operationId: NervesHubWeb.API.DeploymentGroupController.create
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentGroupCreationRequest'
        description: Deployment Group creation request body
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentGroupResponse'
          description: Deployment Group response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangesetErrorResponse'
          description: Unprocessable Entity
      callbacks: {}
      security:
        - bearer_auth: []
components:
  schemas:
    DeploymentGroupCreationRequest:
      description: POST body for creating a Deployment Group
      example:
        conditions:
          tags:
            - prod
          version: '>= 1.0.0'
        firmware: d9f8c63a-1234-5678-abcd-ef0123456789
        name: production
        notes: Rolled out for the summer campaign hardware batch
        state: 'on'
      properties:
        conditions:
          $ref: '#/components/schemas/Conditions'
        delta_updatable:
          type: boolean
        firmware:
          description: Firmware UUID
          type: string
        name:
          type: string
        notes:
          description: >-
            Free-text notes describing why this deployment group is being
            created
          type: string
        state:
          enum:
            - 'on'
            - 'off'
          type: string
      required:
        - name
        - firmware
      title: DeploymentGroupCreationRequest
      type: object
    DeploymentGroupResponse:
      description: Response schema for a single Deployment Group
      properties:
        data:
          $ref: '#/components/schemas/DeploymentGroup'
      title: DeploymentGroupResponse
      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
    Conditions:
      example:
        tag_operator: and
        tags:
          - beta
        version: '>= 1.0.0'
      properties:
        tag_operator:
          default: and
          description: 'How device tags are matched: "and" (require all) or "or" (allow any)'
          enum:
            - and
            - or
          type: string
        tags:
          items:
            type: string
          type: array
        version:
          type: string
      title: Conditions
      type: object
    DeploymentGroup:
      example:
        conditions:
          tags:
            - beta
          version: '>= 1.0.0'
        current_release:
          firmware:
            architecture: arm
            platform: rpi0
            uuid: d9f8c63a-1234-5678-abcd-ef0123456789
            version: 1.0.0
          inserted_at: '2024-01-01T00:00:00Z'
          number: 3
          updated_at: '2024-01-01T00:00:00Z'
        delta_updatable: false
        device_count: 42
        firmware_uuid: d9f8c63a-1234-5678-abcd-ef0123456789
        is_active: true
        name: production
        notes: Rolled out for the summer campaign hardware batch
        releases_count: 3
        state: 'on'
      properties:
        conditions:
          $ref: '#/components/schemas/Conditions'
        current_release:
          $ref: '#/components/schemas/CurrentRelease'
        delta_updatable:
          type: boolean
        device_count:
          type: integer
        firmware_uuid:
          type: string
        is_active:
          type: boolean
        name:
          type: string
        notes:
          description: Free-text notes describing why this deployment group exists
          nullable: true
          type: string
        releases_count:
          type: integer
        state:
          enum:
            - 'on'
            - 'off'
          type: string
      title: DeploymentGroup
      type: object
    CurrentRelease:
      example:
        firmware:
          architecture: arm
          platform: rpi0
          uuid: d9f8c63a-1234-5678-abcd-ef0123456789
          version: 1.0.0
        inserted_at: '2024-01-01T00:00:00Z'
        number: 3
        updated_at: '2024-01-01T00:00:00Z'
      properties:
        firmware:
          $ref: '#/components/schemas/Firmware'
        inserted_at:
          format: date-time
          type: string
        number:
          type: integer
        updated_at:
          format: date-time
          type: string
      title: CurrentRelease
      type: object
    Firmware:
      example:
        architecture: arm
        author: NervesHub
        platform: rpi0
        product: MyProduct
        tool: fwup
        uuid: d9f8c63a-1234-5678-abcd-ef0123456789
        version: 1.0.0
      properties:
        architecture:
          type: string
        author:
          type: string
        platform:
          type: string
        product:
          description: Product name
          type: string
        tool:
          description: >-
            The update tool that handles this firmware, determined from the
            uploaded file
          enum:
            - fwup
            - esp-idf
          type: string
        uuid:
          format: uuid
          type: string
        version:
          type: string
      title: Firmware
      type: object
  securitySchemes:
    bearer_auth:
      scheme: bearer
      type: http

````