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

# Delete a device group

> Delete a device group by ID. A group that is still targeted by an MDM control or a software is rejected with 409 — call `GET /device-groups/:deviceGroupId/relations` to see what references it and remove those first. An unknown ID returns 404; deleting an already-deleted group is a no-op that still returns success.

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json delete /device-groups/{deviceGroupId}
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /device-groups/{deviceGroupId}:
    delete:
      tags:
        - DeviceGroups
      summary: Delete a device group
      description: >-
        Delete a device group by ID. A group that is still targeted by an MDM
        control or a software is rejected with 409 — call `GET
        /device-groups/:deviceGroupId/relations` to see what references it and
        remove those first. An unknown ID returns 404; deleting an
        already-deleted group is a no-op that still returns success.
      operationId: deleteDeviceGroup
      parameters:
        - name: deviceGroupId
          required: true
          in: path
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteDeviceGroup_Output'
components:
  schemas:
    DeleteDeviceGroup_Output:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the device group was deleted.
      required:
        - success
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````