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

# Create an MDM control

> Create a new MDM control of the given `type` with its `configurationPayload` and targeting. Discover creatable types and their config JSON Schema via GET /mdm-controls/catalog. `name` is optional — when omitted, the catalog default name for the type is used; supply a name to create several controls of one type (some profile-backed types require unique names). `enabled` defaults to true, so a created control is deployed to its targeted devices immediately. `configurationPayload` must match the type's config schema (send null for config-less types). Targeting is set via `targetMethod`: "All" (every device) or "DeviceGroup" (`includedDeviceGroupIds`/`excludedDeviceGroupIds`). Returns the created control `id`. Invalid config/targeting returns 400, an unknown device group 404, a name/profile conflict 409, MDM not configured for the company 412, and demo companies are not allowed to create MDM controls (403).

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


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /mdm-controls
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:
  /mdm-controls:
    post:
      tags:
        - MdmControls
      summary: Create an MDM control
      description: >-
        Create a new MDM control of the given `type` with its
        `configurationPayload` and targeting. Discover creatable types and their
        config JSON Schema via GET /mdm-controls/catalog. `name` is optional —
        when omitted, the catalog default name for the type is used; supply a
        name to create several controls of one type (some profile-backed types
        require unique names). `enabled` defaults to true, so a created control
        is deployed to its targeted devices immediately. `configurationPayload`
        must match the type's config schema (send null for config-less types).
        Targeting is set via `targetMethod`: "All" (every device) or
        "DeviceGroup" (`includedDeviceGroupIds`/`excludedDeviceGroupIds`).
        Returns the created control `id`. Invalid config/targeting returns 400,
        an unknown device group 404, a name/profile conflict 409, MDM not
        configured for the company 412, and demo companies are not allowed to
        create MDM controls (403).
      operationId: createMdmControl
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMdmControlBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateMdmControl_Output'
components:
  schemas:
    CreateMdmControlBody:
      type: object
      properties:
        type:
          description: >-
            Control type discriminator, e.g. "wifi_macos". Discover the
            creatable types and each type's config JSON Schema via GET
            /mdm-controls/catalog.
          type: string
          enum:
            - malwarebyte_macos
            - malwarebyte_windows
            - malwarebyte_linux
            - recoveryOs_macos
            - softwareUpdate_macos
            - appBlocking_macos
            - wifi_macos
            - wifi_ios
            - wifi_ipados
            - wifi_windows
            - wifi_android
            - wifi_linux
            - adminUserManagement_macos
            - adminUserManagement_windows
            - adminUserPasswordRotation_macos
            - adminUserPasswordRotation_windows
            - deviceNaming_macos
            - deviceNaming_windows
            - deviceNaming_linux
            - googleChrome_macos
            - googleChrome_windows
            - firewall_macos
            - firewall_windows
            - usbBlocking_macos
            - usbBlocking_windows
            - usbBlocking_linux
            - entraSSO_macos
            - oktaSSO_macos
            - primoSSO_macos
            - customFile_macos
            - customFile_ios
            - customFile_ipados
            - customFile_windows
            - customFile_android
            - customFile_linux
            - passwordPolicy_macos
            - passwordPolicy_windows
            - passwordPolicy_ios
            - passwordPolicy_ipados
            - passwordPolicy_android
            - sentinelOne_macos
            - sentinelOne_windows
            - sentinelOne_windows_arm64
            - sentinelOne_linux_deb
            - sentinelOne_linux_deb_arm64
            - sentinelOne_linux_rpm
            - sentinelOne_linux_rpm_arm64
            - diskEncryption_all
            - osUpdate_macos
            - osUpdate_windows
            - osUpdate_ios
            - osUpdate_ipados
            - rustdesk_macos
            - rustdesk_windows
            - disableProfilesPane_macos
            - screenCapture_macos
            - disableAirdrop_macos
            - airPrint_macos
            - webClip_macos
            - webClip_ios
            - webClip_ipados
        name:
          description: >-
            Display name for the control. Omit to use the catalog default name
            for the given type. Supply a name to create several controls of the
            same type — some profile-backed types require a unique name.
          type: string
        enabled:
          description: >-
            Whether the control is active once created. Defaults to true when
            omitted.
          type: boolean
        configurationPayload:
          description: >-
            Configuration payload for the control, in clear values, matching the
            type's config JSON Schema (see GET /mdm-controls/catalog). Send null
            for control types that take no config.
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties: {}
            - type: 'null'
        targetMethod:
          description: >-
            How the control is targeted. "All" targets every device (ignores the
            group fields below); "DeviceGroup" uses the included/excluded group
            lists.
          type: string
          enum:
            - All
            - DeviceGroup
        includedDeviceGroupIds:
          description: >-
            Device group IDs to include. Used only when targetMethod is
            "DeviceGroup".
          type: array
          items:
            type: string
        excludedDeviceGroupIds:
          description: >-
            Device group IDs to exclude. Used only when targetMethod is
            "DeviceGroup".
          type: array
          items:
            type: string
      required:
        - type
        - configurationPayload
        - targetMethod
    CreateMdmControl_Output:
      type: object
      properties:
        id:
          type: string
          description: ID of the created MDM control.
      required:
        - id
      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>`.

````