> For the complete documentation index, see [llms.txt](https://docs.ox.security/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ox.security/api-documentation/api-reference/api--response-center/queries/get-incidents.md).

# getIncidents

Get a paginated list of incidents with filters.

### Examples

{% tabs %}
{% tab title="GraphQL" %}

```graphql
query GetIncidents($input: GetIncidentsInput) {
  getIncidents(input: $input) {
    items {
      id
      caseId
      name
      description
      type
      severity
      status
      blockedReason
      owner
      creator
      slaTargetAt
      settings {
        allowManualClosure
        autoCloseWhenResolved
        cleanDaysBeforeClose
        autoReopenOnNewHit
        watchWindowDays
      }
      isOxDeclared
      autoExpandFromSource
      externalReferences
      sourcePublishedAt
      counts {
        affectedApps
        affectedRepos
        affectedImages
        openFindings
        resolvedFindings
        sbomMatches
        pipelineHits
        clearedMatches
        blockedItems
        cloudAccounts
        cloudRunningImages
        cloudRunningThisVersionImages
        openFindingsBySeverity {
          appoxalypse
          critical
          high
          medium
          low
        }
      }
      exposureState
      currentSeverity
      isMonitoring
      affectedResourceCount
      summary {
        title
        bullets
        lines {
          segments {
            text
            emphasis
          }
        }
      }
      aiSummary {
        bullets
        generatedAt
        model
      }
      indicatorCounts {
        cve
        package
        packageRange
        image
        issue
        advisorySource
      }
      countsAsOf
      lastMatchedAt
      lastExposureChange
      resolvedAt
      createdAt
      updatedAt
      indicators {
        id
        incidentId
        kind
        value
        versionRange
        fixedVersions
        isCompromised
        severity
        cvssScore
        addedAt
        source
        addedBy
        status
        url
        lastFetchedAt
        autoExpand
        matchState
        activeMatchCount
      }
    }
    totalCount
    hasMore
  }
}
```

#### Variables

This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.

```json
{
  "input": {
    "search": "example",
    "statuses": ["Open"],
    "severities": ["Low"],
    "types": ["MaliciousLibrary"],
    "owners": ["example"],
    "isOxDeclared": true,
    "createdFrom": "example",
    "createdTo": "example",
    "conditionalFilters": [
      {
        "fieldName": "example",
        "values": ["example"],
        "condition": "OR"
      }
    ],
    "sortBy": "updatedAt",
    "sortOrder": "asc",
    "limit": 100,
    "offset": 0
  }
}
```

{% endtab %}

{% tab title="cURL" %}

```shell
curl -X POST \
https://api.cloud.ox.security/api/apollo-gateway \
-H 'Content-Type: application/json' \
-H 'Authorization: YOUR_API_TOKEN' \
-d '{
 "query": "query GetIncidents($input: GetIncidentsInput) { getIncidents(input: $input) { items { id caseId name description type severity status blockedReason owner creator slaTargetAt settings { allowManualClosure autoCloseWhenResolved cleanDaysBeforeClose autoReopenOnNewHit watchWindowDays } isOxDeclared autoExpandFromSource externalReferences sourcePublishedAt counts { affectedApps affectedRepos affectedImages openFindings resolvedFindings sbomMatches pipelineHits clearedMatches blockedItems cloudAccounts cloudRunningImages cloudRunningThisVersionImages openFindingsBySeverity { appoxalypse critical high medium low } } exposureState currentSeverity isMonitoring affectedResourceCount summary { title bullets lines { segments { text emphasis } } } aiSummary { bullets generatedAt model } indicatorCounts { cve package packageRange image issue advisorySource } countsAsOf lastMatchedAt lastExposureChange resolvedAt createdAt updatedAt indicators { id incidentId kind value versionRange fixedVersions isCompromised severity cvssScore addedAt source addedBy status url lastFetchedAt autoExpand matchState activeMatchCount } } totalCount hasMore } }",
 "variables": {
    "input": {
      "search": "example",
      "statuses": ["Open"],
      "severities": ["Low"],
      "types": ["MaliciousLibrary"],
      "owners": ["example"],
      "isOxDeclared": true,
      "createdFrom": "example",
      "createdTo": "example",
      "conditionalFilters": [
        {
          "fieldName": "example",
          "values": ["example"],
          "condition": "OR"
        }
      ],
      "sortBy": "updatedAt",
      "sortOrder": "asc",
      "limit": 100,
      "offset": 0
    }
  }
}'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const query = 'query GetIncidents($input: GetIncidentsInput) { getIncidents(input: $input) { items { id caseId name description type severity status blockedReason owner creator slaTargetAt settings { allowManualClosure autoCloseWhenResolved cleanDaysBeforeClose autoReopenOnNewHit watchWindowDays } isOxDeclared autoExpandFromSource externalReferences sourcePublishedAt counts { affectedApps affectedRepos affectedImages openFindings resolvedFindings sbomMatches pipelineHits clearedMatches blockedItems cloudAccounts cloudRunningImages cloudRunningThisVersionImages openFindingsBySeverity { appoxalypse critical high medium low } } exposureState currentSeverity isMonitoring affectedResourceCount summary { title bullets lines { segments { text emphasis } } } aiSummary { bullets generatedAt model } indicatorCounts { cve package packageRange image issue advisorySource } countsAsOf lastMatchedAt lastExposureChange resolvedAt createdAt updatedAt indicators { id incidentId kind value versionRange fixedVersions isCompromised severity cvssScore addedAt source addedBy status url lastFetchedAt autoExpand matchState activeMatchCount } } totalCount hasMore } }';

fetch("https://api.cloud.ox.security/api/apollo-gateway", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_TOKEN"
  },
  body: JSON.stringify({
    query: query,
    // This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
    variables: {
      input: {
        search: "example",
        statuses: ["Open"],
        severities: ["Low"],
        types: ["MaliciousLibrary"],
        owners: ["example"],
        isOxDeclared: true,
        createdFrom: "example",
        createdTo: "example",
        conditionalFilters: [
          {
            fieldName: "example",
            values: ["example"],
            condition: "OR"
          }
        ],
        sortBy: "updatedAt",
        sortOrder: "asc",
        limit: 100,
        offset: 0
      }
    }
  })
})
.then(response => response.json())
.then(result => console.log(JSON.stringify(result, null, 2)))
.catch(error => console.error('Error:', error));
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

query = 'query GetIncidents($input: GetIncidentsInput) { getIncidents(input: $input) { items { id caseId name description type severity status blockedReason owner creator slaTargetAt settings { allowManualClosure autoCloseWhenResolved cleanDaysBeforeClose autoReopenOnNewHit watchWindowDays } isOxDeclared autoExpandFromSource externalReferences sourcePublishedAt counts { affectedApps affectedRepos affectedImages openFindings resolvedFindings sbomMatches pipelineHits clearedMatches blockedItems cloudAccounts cloudRunningImages cloudRunningThisVersionImages openFindingsBySeverity { appoxalypse critical high medium low } } exposureState currentSeverity isMonitoring affectedResourceCount summary { title bullets lines { segments { text emphasis } } } aiSummary { bullets generatedAt model } indicatorCounts { cve package packageRange image issue advisorySource } countsAsOf lastMatchedAt lastExposureChange resolvedAt createdAt updatedAt indicators { id incidentId kind value versionRange fixedVersions isCompromised severity cvssScore addedAt source addedBy status url lastFetchedAt autoExpand matchState activeMatchCount } } totalCount hasMore } }'

response = requests.post(
  "https://api.cloud.ox.security/api/apollo-gateway",
  headers={
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_TOKEN"
  },
  json={
    "query": query,
    # This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
    "variables": {
      "input": {
        "search": "example",
        "statuses": ["Open"],
        "severities": ["Low"],
        "types": ["MaliciousLibrary"],
        "owners": ["example"],
        "isOxDeclared": true,
        "createdFrom": "example",
        "createdTo": "example",
        "conditionalFilters": [
          {
            "fieldName": "example",
            "values": ["example"],
            "condition": "OR"
          }
        ],
        "sortBy": "updatedAt",
        "sortOrder": "asc",
        "limit": 100,
        "offset": 0
      }
    }
  }
)

if response.status_code == 200:
    result = response.json()
    print(result)
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

{% endtab %}
{% endtabs %}

### Arguments

You can use the following argument(s) to customize your `getIncidents` query.

| Argument                                                                                                               | Description | Supported fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| input [`GetIncidentsInput`](/api-documentation/api-reference/api--response-center/types/inputs/get-incidents-input.md) |             | <p>search <code>String</code><br>statuses <a href="/pages/M3ZirphBvWfVtsm2vSzs"><code>\[IncidentStatus!]</code></a><br>severities <a href="/pages/CSXZmUIYQcTfIZIInSIK"><code>\[IncidentSeverity!]</code></a><br>types <a href="/pages/cUYFpKF5FwbycFwxsvGM"><code>\[IncidentType!]</code></a><br>owners <code>\[String!]</code><br>isOxDeclared <code>Boolean</code><br>createdFrom <code>DateTime</code><br>createdTo <code>DateTime</code><br>conditionalFilters <a href="/pages/osnztqSPV1p5lvWgicPL"><code>\[IncidentConditionalFilterInput!]</code></a><br>sortBy <a href="/pages/StOj0ngzAo4khsaKL4Vl"><code>IncidentSortField</code></a><br>sortOrder <a href="/pages/k0RnaEtnV0fbaevhGNyx"><code>SortOrder</code></a><br>limit <code>Int</code><br>offset <code>Int</code></p> |

### Fields

Return type: [`IncidentsConnection!`](/api-documentation/api-reference/api--response-center/types/objects/incidents-connection.md)

You can use the following field(s) to specify what information your `getIncidents` query will return. Please note that some fields may have their own subfields.

| Field                                                                                                   | Description | Supported fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| items [`[Incident!]!`](/api-documentation/api-reference/api--response-center/types/objects/incident.md) |             | <p>id <code>String!</code><br>caseId <code>String!</code><br>name <code>String!</code><br>description <code>String</code><br>type <a href="/pages/cUYFpKF5FwbycFwxsvGM"><code>IncidentType!</code></a><br>severity <a href="/pages/CSXZmUIYQcTfIZIInSIK"><code>IncidentSeverity!</code></a><br>status <a href="/pages/M3ZirphBvWfVtsm2vSzs"><code>IncidentStatus!</code></a><br>blockedReason <code>String</code><br>owner <code>String</code><br>creator <code>String!</code><br>slaTargetAt <code>DateTime</code><br>settings <a href="/pages/5seNDn2xJ86vQleJcimp"><code>IncidentSettings!</code></a><br>isOxDeclared <code>Boolean!</code><br>autoExpandFromSource <code>Boolean!</code><br>externalReferences <code>\[String!]!</code><br>sourcePublishedAt <code>DateTime</code><br>counts <a href="/pages/2Jal83uNnzflAfXTstln"><code>IncidentCounts!</code></a><br>exposureState <a href="/pages/XJm9vVewlzcB1B5KcX7d"><code>ExposureState</code></a><br>currentSeverity <a href="/pages/CSXZmUIYQcTfIZIInSIK"><code>IncidentSeverity</code></a><br>isMonitoring <code>Boolean!</code><br>affectedResourceCount <code>Int!</code><br>summary <a href="/pages/HNR6nsKwNBRzeIFwter4"><code>\[IncidentSummarySection!]!</code></a><br>aiSummary <a href="/pages/q8efDbgOBPJfWWcZaxRb"><code>IncidentAiSummary</code></a><br>indicatorCounts <a href="/pages/53LwqTD7HJbUkF9C166H"><code>IncidentIndicatorCounts</code></a><br>countsAsOf <code>DateTime</code><br>lastMatchedAt <code>DateTime</code><br>lastExposureChange <code>DateTime</code><br>resolvedAt <code>DateTime</code><br>createdAt <code>DateTime</code><br>updatedAt <code>DateTime</code><br>indicators <a href="/pages/hUSs10oFKzlvcDtQSyf6"><code>\[Indicator!]</code></a></p> |
| totalCount `Int!`                                                                                       |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| hasMore `Boolean!`                                                                                      |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ox.security/api-documentation/api-reference/api--response-center/queries/get-incidents.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
