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

# Get Threat Hunt Alert history

> Every Hunt Alert episode linked to this Threat, newest first.



## OpenAPI

````yaml https://app.cotool.ai/api/docs/openapi.json get /api/threats/{id}/alerts
openapi: 3.1.0
info:
  title: Cotool API
  version: 1.0.0
  description: >-
    # Cotool API Documentation


    The Cotool API allows you to interact with the Cotool platform
    programmatically, enabling you to build powerful integrations and automate
    your workflows.


    ## Getting an API Key


    Follow these steps to generate your API key:


    1. **Log in** to the Cotool web interface

    2. **Navigate** to `/settings/api-keys`

    3. **Click** "Generate Key"

    4. **Copy and store** your API key securely ⚠️ *It won't be shown again*


    ## API Key Authentication


    For programmatic access and integrations, use your API key with the
    Authorization header:


    ```http

    Authorization: Bearer your_api_key_here

    ```


    ```bash

    curl -X GET "https://app.cotool.ai/api/endpoint" \
      -H "Authorization: Bearer your_api_key_here" \
      -H "Content-Type: application/json"
    ```
servers:
  - url: https://app.cotool.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /api/threats/{id}/alerts:
    get:
      tags:
        - Hunt
      summary: Get Threat Hunt Alert history
      description: Every Hunt Alert episode linked to this Threat, newest first.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  alerts:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: Internal alert identifier
                        displayId:
                          type: string
                          pattern: ^COT-\d+$
                          description: Human-readable alert identifier
                        organizationId:
                          type: string
                          format: uuid
                          description: Organization that owns the alert
                        organizationName:
                          type: string
                          minLength: 1
                          description: >-
                            URL-safe organization name used in durable alert
                            paths
                        title:
                          type: string
                          minLength: 1
                          description: Human-readable alert title
                        description:
                          type:
                            - string
                            - 'null'
                          description: Markdown summary or details for the alert
                        severity:
                          type:
                            - string
                            - 'null'
                          enum:
                            - low
                            - medium
                            - high
                            - critical
                            - null
                          description: Alert severity when known
                        status:
                          type: string
                          enum:
                            - open
                            - in_progress
                            - escalated
                            - closed_true_positive
                            - closed_false_positive
                            - closed_true_positive_benign
                            - dismissed
                          description: >-
                            Lifecycle status for a first-class alert. Terminal
                            closed statuses include final disposition. Dismissed
                            archives the alert and hides it from alert lists.
                        source:
                          type: object
                          properties:
                            category:
                              type: string
                              enum:
                                - detection
                                - trigger
                                - hunt
                              description: >-
                                Broad alert source category. Hunt covers
                                threat-intel exposure alerts minted by the Hunt
                                surface.
                            name:
                              type: string
                              enum:
                                - cotool_detection
                                - hunt
                                - jira
                                - jira-automation
                                - slack
                                - linear
                                - cron
                                - webhook
                                - email
                                - bugcrowd
                                - hackerone
                              description: >-
                                Filter-oriented alert source name.
                                Trigger-created alerts use the trigger type.
                            triggerType:
                              type:
                                - string
                                - 'null'
                              enum:
                                - jira
                                - jira-automation
                                - slack
                                - linear
                                - cron
                                - webhook
                                - email
                                - bugcrowd
                                - hackerone
                                - null
                              description: Trigger source when category is trigger
                          required:
                            - category
                            - name
                            - triggerType
                          description: Filter-oriented source attribution for an alert.
                        detection:
                          type:
                            - object
                            - 'null'
                          properties:
                            id:
                              type:
                                - string
                                - 'null'
                              format: uuid
                              description: Cotool detection identifier when known
                            agentId:
                              type:
                                - string
                                - 'null'
                              format: uuid
                              description: Cotool detection agent identifier when known
                            ruleId:
                              type:
                                - string
                                - 'null'
                              format: uuid
                              description: >-
                                Platform detection rule identifier
                                (detection_rules inventory) when an external
                                detection was matched to a synced rule
                            name:
                              type: string
                              minLength: 1
                              description: Detection display name
                            kind:
                              type: string
                              enum:
                                - cotool
                                - external
                              description: >-
                                Whether this detection attribution is internal
                                or extracted
                            origin:
                              type:
                                - string
                                - 'null'
                              enum:
                                - user
                                - orchestrator
                                - null
                              description: >-
                                Origin of the Cotool detection agent when known.
                                `orchestrator` marks a detection created by the
                                retired Auto Detect feature.
                          required:
                            - id
                            - agentId
                            - ruleId
                            - name
                            - kind
                          description: Detection attribution for the alert, when known.
                        createdBy:
                          type: string
                          enum:
                            - agent
                            - trigger
                            - system
                          description: Actor class that created the alert.
                        originAgentId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: Agent that produced or owns the source flow
                        originTriggerId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: >-
                            Trigger that created this alert, when source is an
                            external trigger
                        originRunId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: Run that minted the alert, stored as chats.id
                        originDetectionHitId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: >-
                            Detection hit that produced this alert, when
                            applicable
                        externalProvider:
                          type:
                            - string
                            - 'null'
                          enum:
                            - jira
                            - jira-automation
                            - slack
                            - linear
                            - cron
                            - webhook
                            - email
                            - bugcrowd
                            - hackerone
                            - null
                          description: >-
                            External trigger provider such as jira, linear,
                            email, or webhook
                        externalRef:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Provider-native event, ticket, message, or alert
                            identifier
                        externalUrl:
                          type:
                            - string
                            - 'null'
                          format: uri
                          description: Provider-native URL for the originating object
                        assignedAgentId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: >-
                            Response agent currently assigned to triage this
                            alert
                        triageRunId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: >-
                            Latest response-agent triage run for this alert,
                            stored as chats.id
                        dedupeKey:
                          type:
                            - string
                            - 'null'
                          description: Stable key used for idempotent alert creation
                        createdAt:
                          type: string
                          description: ISO timestamp when the alert was created
                        updatedAt:
                          type: string
                          description: ISO timestamp when the alert was last updated
                        firstTriagedAt:
                          type:
                            - string
                            - 'null'
                          description: ISO timestamp when triage first started
                        resolvedAt:
                          type:
                            - string
                            - 'null'
                          description: >-
                            ISO timestamp when the alert reached a terminal
                            closed status
                        derivedDisposition:
                          type:
                            - string
                            - 'null'
                          enum:
                            - true_positive
                            - false_positive
                            - true_positive_benign
                            - null
                          description: Disposition derived from terminal alert status
                        originAgentName:
                          type:
                            - string
                            - 'null'
                          description: Display name for the origin agent, when available
                        assignedAgentName:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Display name for the assigned triage agent, when
                            available
                        triggerSource:
                          type:
                            - string
                            - 'null'
                          enum:
                            - jira
                            - jira-automation
                            - slack
                            - linear
                            - cron
                            - webhook
                            - email
                            - bugcrowd
                            - hackerone
                            - null
                          description: Trigger source for external-trigger alerts
                        resolvedByType:
                          type:
                            - string
                            - 'null'
                          enum:
                            - human
                            - agent
                            - system
                            - null
                          description: >-
                            Actor class that moved the alert to its terminal
                            status. Null while the alert is not closed.
                        resolvedByUserId:
                          type:
                            - string
                            - 'null'
                          format: uuid
                          description: User who closed the alert, when a human closed it
                        resolvedByAgentName:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Display name of the agent that closed the alert,
                            when an agent closed it
                        resolvedReason:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Reason recorded with the closing status change, when
                            provided
                        huntQualifiedBy:
                          type:
                            - string
                            - 'null'
                          enum:
                            - compromise_signal_found
                            - exposure_found
                            - null
                          description: >-
                            Qualifying condition that opened this Hunt alert.
                            Null for non-hunt alerts.
                      required:
                        - id
                        - displayId
                        - organizationId
                        - organizationName
                        - title
                        - description
                        - severity
                        - status
                        - source
                        - detection
                        - createdBy
                        - originAgentId
                        - originTriggerId
                        - originRunId
                        - originDetectionHitId
                        - externalProvider
                        - externalRef
                        - externalUrl
                        - assignedAgentId
                        - triageRunId
                        - dedupeKey
                        - createdAt
                        - updatedAt
                        - firstTriagedAt
                        - resolvedAt
                        - derivedDisposition
                        - originAgentName
                        - assignedAgentName
                        - triggerSource
                required:
                  - alerts
        '400':
          description: Bad request — input validation failed or the request was malformed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized — missing or invalid API key / session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden — the authenticated user lacks the required permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: shell
          label: cURL
          source: |-
            curl -X GET "https://app.cotool.ai/api/threats/:id/alerts" \
              -H "Authorization: Bearer YOUR_API_KEY" \
              -H "Content-Type: application/json"
components:
  schemas:
    ValidationError:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        issues:
          type: array
          description: >-
            Detailed validation issues, present when request or response schema
            validation fails
          items:
            type: object
            additionalProperties: true
      required:
        - error
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
      required:
        - error
    PermissionError:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
        missingPerms:
          type: array
          description: Permissions the authenticated user is missing for this operation
          items:
            type: string
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API Key authentication for programmatic access. Include your API key in
        the Authorization header as: `Bearer your_api_key_here`

````