---
title: "Import Rules From File Handler"
method: POST
path: "/api/rules/import/file"
tags: ["runtime_mutations", "rules"]
---

# Import Rules From File Handler

`POST /api/rules/import/file`

Import a rule from an arbitrary file on the backend host.

The file's full contents become the rule body. Reading an arbitrary
path is only safe on a single-user local backend, so it is refused in
multi-tenant cloud mode where the filesystem is shared across clients.

## Request body

- ImportFileRequest
  - `path` string, required
  - `name` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-18** `abf76937a751` — 2 info
  - added the optional property `detail/items/ctx` to the response with the `422` status
  - added the optional property `detail/items/input` to the response with the `422` status

[Change history](https://skmtc.dev/quadrillion/apis/quadrillion-cloud-api/changes/api/rules/import/file/post.md)

---

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