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

# Open the ticket of an AI finding

> Open the ticket that tracks the fix of one finding (`deviceId` and `findingKey` from `getAiFindings`), tagged AI Tools, and return it as JSON (`ticketId`, `ticketReference`). Each finding has its own ticket, even two findings of the same rule on the same device. It goes to the assignee, priority and subscribers of the company's AI tools ticket settings, the device owner as requester, and the AI Findings Remediation agent works it when the company has it on. Primo closes it once the device no longer reports the finding. A 409 means the finding already has an open ticket, named in the answer; a 404 that the device no longer reports the finding. To open a ticket for every finding the settings keep, turn `autoCreateTickets` on with `updateAiToolsSettings`. AI tools are what Primo finds on Macs (assistant apps, coding agents, IDE plugins, browser extensions, MCP servers, AI connections, agent instruction files), as of the last sync (`lastSyncedAt` of `getAiToolsOverview`), with Primo's severities, less the findings the company's AI tools settings ignore. They are not the software catalog (`getSoftwares`, `getDeviceSoftware`), the company's own AI agents (`listAgents`) nor AI credits (`getAiUsage`). A company without AI tools monitoring gets a 403, final.

Key: WriteScope: Company


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /ai-tools/findings/{deviceId}/{findingKey}/ticket
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:
  /ai-tools/findings/{deviceId}/{findingKey}/ticket:
    post:
      tags:
        - AiTools
      summary: Open the ticket of an AI finding
      description: >-
        Open the ticket that tracks the fix of one finding (`deviceId` and
        `findingKey` from `getAiFindings`), tagged AI Tools, and return it as
        JSON (`ticketId`, `ticketReference`). Each finding has its own ticket,
        even two findings of the same rule on the same device. It goes to the
        assignee, priority and subscribers of the company's AI tools ticket
        settings, the device owner as requester, and the AI Findings Remediation
        agent works it when the company has it on. Primo closes it once the
        device no longer reports the finding. A 409 means the finding already
        has an open ticket, named in the answer; a 404 that the device no longer
        reports the finding. To open a ticket for every finding the settings
        keep, turn `autoCreateTickets` on with `updateAiToolsSettings`. AI tools
        are what Primo finds on Macs (assistant apps, coding agents, IDE
        plugins, browser extensions, MCP servers, AI connections, agent
        instruction files), as of the last sync (`lastSyncedAt` of
        `getAiToolsOverview`), with Primo's severities, less the findings the
        company's AI tools settings ignore. They are not the software catalog
        (`getSoftwares`, `getDeviceSoftware`), the company's own AI agents
        (`listAgents`) nor AI credits (`getAiUsage`). A company without AI tools
        monitoring gets a 403, final.
      operationId: createAiFindingTicket
      parameters:
        - name: deviceId
          required: true
          in: path
          schema:
            type: string
        - name: findingKey
          required: true
          in: path
          schema:
            type: string
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAiFindingTicketResponse_Output'
components:
  schemas:
    CreateAiFindingTicketResponse_Output:
      type: object
      properties:
        ticketId:
          description: Ticket id, to pass to `getTicket` or `getAiToolsTicketDetails`
          type: string
        ticketReference:
          type: string
        deviceId:
          type: string
        rule:
          type: string
          description: The rule's code
        findingKey:
          type: string
          description: 'The finding the ticket tracks: each finding has its own ticket'
        openedBy:
          type: string
          description: >-
            `policy`: opened by Create tickets automatically, closed by Primo
            when the finding is gone or the settings no longer cover it; `admin`
            (a person), `agent` (Primo AI) or `api` (an API key): opened by
            hand, closed by Primo once the finding is gone
          enum:
            - policy
            - admin
            - agent
            - api
        openedAt:
          type: string
          description: ISO 8601
        closedAt:
          description: When Primo closed it (ISO 8601); null while it is open
          anyOf:
            - type: string
            - type: 'null'
        closeReason:
          description: >-
            Why Primo closed it: `finding_resolved`, `device_gone`,
            `auto_tickets_off`, `device_excluded`, `rule_ignored`,
            `severity_ignored`, `ticket_completed` or `ticket_cancelled` when
            someone finished the ticket, or `ticket_deleted` when the ticket was
            deleted
          anyOf:
            - type: string
            - type: 'null'
      required:
        - ticketId
        - ticketReference
        - deviceId
        - rule
        - findingKey
        - openedBy
        - openedAt
        - closedAt
        - closeReason
      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.