---
title: "Get Hunt"
method: POST
path: "/security-hunt/{id}/get-item"
tags: ["Hunt"]
---

# Get Hunt

`POST /security-hunt/{id}/get-item`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/security-hunt/{id}/get-item`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/security-hunt/:id/get-item/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to retrieve a single Hunt by ID

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `select` SecurityHuntSelectSchema: Select schema for SecurityHunt. Set fields to true to include them in the response.
    - `_id` boolean
    - `createdAt` boolean
    - `updatedAt` boolean
    - `deletedAt` boolean
    - `projectId` boolean
    - `name` boolean
    - `description` boolean
    - `searchQuery` boolean
    - `filters` boolean
    - `timeRange` boolean
    - `schedule` boolean
    - `notifyUsers` UserRelationSelectSchema: What a select may name of the User records a relation holds: set a field to true to include it.
      - `_id` boolean
      - `createdAt` boolean
      - `updatedAt` boolean
      - `deletedAt` boolean
      - `name` boolean
      - `email` boolean
      - `profilePictureId` boolean
      - `twoFactorAuthEnabled` boolean
    - `notifyTeams` TeamRelationSelectSchema: What a select may name of the Team records a relation holds: set a field to true to include it.
      - `_id` boolean
      - `createdAt` boolean
      - `updatedAt` boolean
      - `deletedAt` boolean
      - `projectId` boolean
      - `name` boolean
    - `libraryHuntId` boolean
    - `scheduledByUserId` boolean
    - `searchedUpToAt` boolean
    - `nextRunAt` boolean
    - `lastRunAt` boolean
    - `lastRunEventCount` boolean
    - `lastRunError` boolean
    - `lastFoundAt` boolean
    - `lastFoundSinceAt` boolean
    - `lastFoundEventCount` boolean
    - `createdByUserId` boolean
    - `deletedByUserId` boolean

## Response `200`

Successful response

- object
  - `data` SecurityHunt
    - `_id` string, uuid: ID of this object. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `createdAt` object: Date and Time when the object was created. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `updatedAt` object: Date and Time when the object was updated. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `deletedAt` object: Date and Time when the object was deleted. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `version` number: Object version
    - `projectId` string, uuid, required: ID of the project this hunt belongs to. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `name` string, required: What the hunt looks for, in a few words. At most 100 characters. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `description` string: Why the hunt matters and what to do when it finds something, for whoever opens it later. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `searchQuery` string: What the hunt searches for, in the Events search bar's language: words a message contains, fields such as severity:High or user:alice, and source attributes such as @threat.matched:true. At most 2,000 characters. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `filters` object: The Events sidebar's filters kept beside the search: each field's values, or with ! before the field the values it leaves out. At most 50 values. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `timeRange` 'Past 5 Mins' | 'Past 15 Mins' | 'Past 30 Mins' | 'Past 1 Hour' | 'Past 2 Hours' | 'Past 3 Hours' | 'Past 1 Day' | 'Past 2 Days' | 'Past 1 Week' | 'Past 2 Weeks' | 'Past 1 Month' | 'Past 3 Months' | 'Custom', required: How far back the hunt searches when it is opened, as the Events time picker names it: Past 1 Hour, Past 1 Day, Past 1 Week, Past 1 Month and the rest. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `schedule` 'Not Scheduled' | 'Every Hour' | 'Every 6 Hours' | 'Every Day' | 'Every Week', required: How often the hunt runs on its own and tells people what it found: Not Scheduled, Every Hour, Every 6 Hours, Every Day or Every Week. Each run searches the events that arrived since the run before. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
    - `notifyUsers` object[]: The people told when a scheduled run finds events, each as their notification settings say. Only people who can read security events are told. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
      - `_id` string, uuid: Unique identifier for the entity
    - `notifyTeams` object[]: The teams whose members are told when a scheduled run finds events, each as their notification settings say. Only members who can read security events are told. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [Project Owner, Project Admin, Security Admin, Security Member, Edit Detection Rule]
      - `_id` string, uuid: Unique identifier for the entity
    - `libraryHuntId` string: The Hunt Library starter this hunt was added from, such as encoded-powershell. Empty for a hunt saved from a search of your own. Permissions - Create: [Project Owner, Project Admin, Security Admin, Security Member, Create Detection Rule], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `scheduledByUserId` string, uuid: ID of the person the hunt's scheduled runs run as. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `searchedUpToAt` object: How far the scheduled runs have searched: the next run reads the events from here on. Set to the moment the schedule is set or the search changes. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `nextRunAt` object: When the hunt next runs on its schedule. Empty for a hunt that is not scheduled. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `lastRunAt` object: When the hunt last ran on its schedule, whether it found anything or not. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `lastRunEventCount` number: How many events the hunt's last scheduled run found. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `lastRunError` string: Why the hunt's last scheduled run could not be made. Empty when it ran. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `lastFoundAt` object: The end of the events the last run that found something searched: what it found arrived before this. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `lastFoundSinceAt` object: The start of the events the last run that found something searched: what it found arrived after this. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `lastFoundEventCount` number: How many events the last run that found something found. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `createdByUserId` string, uuid: ID of the person who saved the hunt. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]
    - `deletedByUserId` string, uuid: ID of the person who deleted the hunt. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Security Admin, Security Member, Security Viewer, Read Detection Rule], Update: [No access - you don't have permission for this operation]

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `404`: Not found. The record does not exist, belongs to another project, or is one you may not read - the same answer for each.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
