---
title: "Create file query"
method: POST
path: "/filequery"
tags: ["File query"]
---

# Create file query

`POST /filequery`

## Request

- Base URL: `https://localhost:8446/api/v2`
- URL: `https://localhost:8446/api/v2/filequery`
- Auth: API key in header `Authorization`

Creates file query. Returns file query details. See get file query for the response details.

## Request body

- object
  - `job_run_id` number, required: Job run id. Files can be queried on active job runs only except for script jobs.
  - `agents_ids` number, required: Job run Agents ids. Start file query of specified Agents. Will query files on all Job run Agents in case array is empty
  - `type` string, required: File query type
  - `files` number, required: Number of files to show in result. Required for type "by_file_path" and "by_statuses". Minimum value is 1. Maximum value is 1000.
  - `file_path` string: Show files by specified path. Required for type "by_file_path"
  - `file_regex` string: Filter files by specified regex. For type "by_statuses"
  - `period` number: Show deleted files for last N hours. Default value is 24. For type "by_statuses" and "file_status_settings.deleted"
  - `file_status_settings` object: Show files with specified statuses. Requried for type "by_statuses"
  - `file_status_settings.cant_sync_now` boolean, required: Show files that cannot be synced now.
  - `file_status_settings.deleted` boolean, required: Show deleted files (see "period" parameter).
  - `file_status_settings.downloaded` boolean, required: Show downloaded files
  - `file_status_settings.in_queue` boolean, required: Show files in download queue

## Response `200`

Successful response

- object

## Other responses

- `default`: Error response. Depending on the error, either a 4xx or 5xx response status is returned.

---

[API](https://skmtc.dev/resilio/apis/resilio-api.md) - [All operations](https://skmtc.dev/resilio/apis/resilio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/resilio/apis/resilio-api/revisions/ca39130a395e?raw)
