---
title: "Create file policy"
method: POST
path: "/filePolicies"
tags: ["FilePolicies"]
---

# Create file policy

`POST /filePolicies`

## Request

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

Create new file policy.

## Request body

- object
  - `name` string, required: File policy name. Must be unique.
  - `case_insensitive` boolean, required: Case sensitivity ON/OFF for rules lists.
  - `hydration` string, required: List of hydration rules. Must not contain empty strings. Must contain only valid regular expressions.
  - `exclusion` string, required: List of exclusion rules. Must not contain empty strings. Must contain only valid regular expressions.
  - `pinning` string, required: List of pinning rules. Must not contain empty strings. Must contain only valid regular expressions.
  - `size_limit_type` string, required: Type of size limit.
  - `size_limit` number, required: Cache size limit. Must be greater than 0. Max value is 100, if size_limit_type is equal 'percent'.
  - `clear_cache_when` number, required: Clear cache when percent of used cache storage is equal to specified value. Must be integer. Must be greater than or equal to 0. Must be less than or equal to 100.
  - `clear_cache_until` number, required: Clear cache cache until percent of used cache storage is back to specified value. Must be integer. Must be greater than or equal to 0. Must be less than or equal to 100. Must be less than clear_cache_when
  - `priority_type` string, required: Type of priority.
  - `priority_by_mtime` string: Type of priority by mtime. Required if priority_type is equal 'mtime'. Ignored if other priority_type is selected.
  - `priority_by_name` string: List of names. Required if priority_type is equal 'name'. Ignored if other priority_type is selected. Must not contain empty strings. Must be in correct format and contain only valid regular expressions.

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