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

# Update the compliance ticket settings and exceptions

> Change whether compliance issues open tickets on their own and the defaults of those tickets (`ticket`: autoCreateTickets, assignee, priority, subscribers) and the exceptions (`exceptions`: leave unassigned or in-stock devices out, grace period). Only the fields sent change; the others keep their value. `subscribers` replaces the whole list, and null clears the assignee or the priority. A person is a Primo employee (type EMPLOYEE, from `getEmployees`) or an admin with no employee record (type EXTERNAL_ADMIN, the `userId` from `getAdmins`); anyone else is refused with 400. New defaults apply to tickets opened afterwards, never to open ones. Changing `exceptions` or `autoCreateTickets` recomputes every device, so issues and their tickets appear or close within minutes. Auto-remediation is switched with publishComplianceRemediationPolicy / unpublishComplianceRemediationPolicy, and which statuses raise an issue with `updateComplianceAlertRule`. `getComplianceSettings` reads the current values the change replaces. Demo companies are not allowed to change these settings (403).

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json patch /compliance/settings
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:
  /compliance/settings:
    patch:
      tags:
        - Compliance
      summary: Update the compliance ticket settings and exceptions
      description: >-
        Change whether compliance issues open tickets on their own and the
        defaults of those tickets (`ticket`: autoCreateTickets, assignee,
        priority, subscribers) and the exceptions (`exceptions`: leave
        unassigned or in-stock devices out, grace period). Only the fields sent
        change; the others keep their value. `subscribers` replaces the whole
        list, and null clears the assignee or the priority. A person is a Primo
        employee (type EMPLOYEE, from `getEmployees`) or an admin with no
        employee record (type EXTERNAL_ADMIN, the `userId` from `getAdmins`);
        anyone else is refused with 400. New defaults apply to tickets opened
        afterwards, never to open ones. Changing `exceptions` or
        `autoCreateTickets` recomputes every device, so issues and their tickets
        appear or close within minutes. Auto-remediation is switched with
        publishComplianceRemediationPolicy /
        unpublishComplianceRemediationPolicy, and which statuses raise an issue
        with `updateComplianceAlertRule`. `getComplianceSettings` reads the
        current values the change replaces. Demo companies are not allowed to
        change these settings (403).
      operationId: updateComplianceSettings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateComplianceSettingsBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateComplianceSettingsResponse_Output'
components:
  schemas:
    UpdateComplianceSettingsBody:
      type: object
      properties:
        ticket:
          description: >-
            The ticket defaults to change. Only the sent fields change;
            `subscribers` replaces the whole list.
          type: object
          properties:
            autoCreateTickets:
              description: >-
                True: every compliance issue opens a ticket on its own ("Create
                tickets automatically" is on). Ignored while Primo AI works the
                issues itself (auto-remediation ENABLED), which opens one ticket
                per issue.
              type: boolean
            assignee:
              description: >-
                Default assignee of every ticket Primo opens from a compliance
                issue. Null means unassigned.
              anyOf:
                - anyOf:
                    - type: object
                      properties:
                        type:
                          type: string
                          const: EMPLOYEE
                        employeeId:
                          description: >-
                            Primo employee id — look the person up with
                            `getEmployees`.
                          type: string
                          minLength: 1
                      required:
                        - type
                        - employeeId
                    - type: object
                      properties:
                        type:
                          type: string
                          const: EXTERNAL_ADMIN
                        userId:
                          description: >-
                            Clerk user id of an admin with no employee record —
                            the `userId` of an `external` entry of `getAdmins`.
                          type: string
                          minLength: 1
                      required:
                        - type
                        - userId
                - type: 'null'
            priority:
              description: >-
                Priority set on each new compliance ticket. Null means no
                priority.
              anyOf:
                - type: string
                  enum:
                    - LOW
                    - MEDIUM
                    - HIGH
                - type: 'null'
            subscribers:
              description: >-
                People notified when a compliance ticket is created and when it
                changes.
              type: array
              items:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        const: EMPLOYEE
                      employeeId:
                        description: >-
                          Primo employee id — look the person up with
                          `getEmployees`.
                        type: string
                        minLength: 1
                    required:
                      - type
                      - employeeId
                  - type: object
                    properties:
                      type:
                        type: string
                        const: EXTERNAL_ADMIN
                      userId:
                        description: >-
                          Clerk user id of an admin with no employee record —
                          the `userId` of an `external` entry of `getAdmins`.
                        type: string
                        minLength: 1
                    required:
                      - type
                      - userId
        exceptions:
          description: >-
            The exceptions to change. Only the sent fields change. Any change
            here recomputes the compliance of every device.
          type: object
          properties:
            excludeUnassignedDevices:
              description: >-
                True: a device with no owner raises no compliance issue, no
                ticket and no remediation (the "Unassigned devices" exception is
                on).
              type: boolean
            excludeDevicesInStock:
              description: >-
                True: a device held in stock raises no compliance issue, no
                ticket and no remediation (the "In stock devices" exception is
                on).
              type: boolean
            gracePeriodDays:
              description: >-
                Days a device must stay in a pending status before the issue is
                raised, 0 to 30; a failing status raises its issue at once. 0
                raises every issue on the first check.
              type: integer
              minimum: 0
              maximum: 30
    UpdateComplianceSettingsResponse_Output:
      type: object
      properties:
        ticket:
          type: object
          properties:
            autoCreateTickets:
              description: >-
                True: every compliance issue opens a ticket on its own ("Create
                tickets automatically" is on). Ignored while Primo AI works the
                issues itself (auto-remediation ENABLED), which opens one ticket
                per issue.
              type: boolean
            assignee:
              description: >-
                Default assignee of every ticket Primo opens from a compliance
                issue. Null means unassigned.
              anyOf:
                - anyOf:
                    - type: object
                      properties:
                        type:
                          type: string
                          const: EMPLOYEE
                        employeeId:
                          description: >-
                            Primo employee id — look the person up with
                            `getEmployees`.
                          type: string
                          minLength: 1
                      required:
                        - type
                        - employeeId
                      additionalProperties: false
                    - type: object
                      properties:
                        type:
                          type: string
                          const: EXTERNAL_ADMIN
                        userId:
                          description: >-
                            Clerk user id of an admin with no employee record —
                            the `userId` of an `external` entry of `getAdmins`.
                          type: string
                          minLength: 1
                      required:
                        - type
                        - userId
                      additionalProperties: false
                - type: 'null'
            priority:
              description: >-
                Priority set on each new compliance ticket. Null means no
                priority.
              anyOf:
                - type: string
                  enum:
                    - LOW
                    - MEDIUM
                    - HIGH
                - type: 'null'
            subscribers:
              description: >-
                People notified when a compliance ticket is created and when it
                changes.
              type: array
              items:
                anyOf:
                  - type: object
                    properties:
                      type:
                        type: string
                        const: EMPLOYEE
                      employeeId:
                        description: >-
                          Primo employee id — look the person up with
                          `getEmployees`.
                        type: string
                        minLength: 1
                    required:
                      - type
                      - employeeId
                    additionalProperties: false
                  - type: object
                    properties:
                      type:
                        type: string
                        const: EXTERNAL_ADMIN
                      userId:
                        description: >-
                          Clerk user id of an admin with no employee record —
                          the `userId` of an `external` entry of `getAdmins`.
                        type: string
                        minLength: 1
                    required:
                      - type
                      - userId
                    additionalProperties: false
          required:
            - autoCreateTickets
            - assignee
            - priority
            - subscribers
          additionalProperties: false
        exceptions:
          type: object
          properties:
            excludeUnassignedDevices:
              description: >-
                True: a device with no owner raises no compliance issue, no
                ticket and no remediation (the "Unassigned devices" exception is
                on).
              type: boolean
            excludeDevicesInStock:
              description: >-
                True: a device held in stock raises no compliance issue, no
                ticket and no remediation (the "In stock devices" exception is
                on).
              type: boolean
            gracePeriodDays:
              description: >-
                Days a device must stay in a pending status before the issue is
                raised, 0 to 30; a failing status raises its issue at once. 0
                raises every issue on the first check.
              type: integer
              minimum: 0
              maximum: 30
          required:
            - excludeUnassignedDevices
            - excludeDevicesInStock
            - gracePeriodDays
          additionalProperties: false
      required:
        - ticket
        - exceptions
      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>`.

````

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