# APIs related to Schema Rules

Schema Rules define validation rule sets applied to schema documents within policies. Rules specify field-level constraints, cross-field dependencies, and data quality checks beyond basic JSON Schema validation.

**Authentication:** All endpoints require a Bearer JWT token (`Authorization: Bearer <token>`). Obtain a token via `POST /accounts/login`.

***

## Endpoints

| Method       | Endpoint                                      | Description                                     | Auth Required |
| ------------ | --------------------------------------------- | ----------------------------------------------- | ------------- |
| **`POST`**   | `/api/v1/schema-rules`                        | Creates a new schema rule                       | Yes           |
| **`GET`**    | `/api/v1/schema-rules`                        | Returns a paginated list of all schema rules    | Yes           |
| **`GET`**    | `/api/v1/schema-rules/{ruleId}`               | Retrieves a schema rule by ID                   | Yes           |
| **`PUT`**    | `/api/v1/schema-rules/{ruleId}`               | Updates a schema rule by ID                     | Yes           |
| **`DELETE`** | `/api/v1/schema-rules/{ruleId}`               | Deletes a schema rule by ID                     | Yes           |
| **`PUT`**    | `/api/v1/schema-rules/{ruleId}/activate`      | Activates a schema rule                         | Yes           |
| **`PUT`**    | `/api/v1/schema-rules/{ruleId}/inactivate`    | Deactivates a schema rule                       | Yes           |
| **`GET`**    | `/api/v1/schema-rules/{ruleId}/relationships` | Lists all schemas and policies linked to a rule | Yes           |
| **`POST`**   | `/api/v1/schema-rules/data`                   | Retrieves data needed for evaluating rules      | Yes           |
| **`POST`**   | `/api/v1/schema-rules/{policyId}/import/file` | Imports schema rules from a ZIP file            | Yes           |
| **`GET`**    | `/api/v1/schema-rules/{ruleId}/export/file`   | Exports a schema rule to a ZIP file             | Yes           |
| **`POST`**   | `/api/v1/schema-rules/import/file/preview`    | Previews a schema rule ZIP without saving       | Yes           |

***

## Endpoint Details

* [Creation of a New Schema Rule](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/creation-of-the-new-schema-rule.md)
* [Retrieve the Schema Rules](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/retrieve-the-schema-rules.md)
* [Retrieve the Configuration of the Rule by Its ID](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/retrieve-the-configuration-of-the-rule-by-its-id.md)
* [Update the Configuration of the Rule with the Corresponding ID](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/update-the-configuration-of-the-rule-with-the-corresponding-id.md)
* [Delete the Rule by Its ID](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/delete-the-rule-by-its-id.md)
* [Activate the Rule with the Specified ID](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/activate-the-rule-with-the-specified-id.md)
* [Deactivate the Rule with the Specified ID](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/deactivate-the-rule-with-the-specified-id.md)
* [List All Schemas and Policies Relevant to the Rule with the Specified ID](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/list-all-the-schemas-and-policy-relevant-to-the-rule-with-the-specified-id.md)
* [Retrieve All the Data Needed for Evaluating the Rules](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/retrieve-all-the-data-needed-for-evaluating-the-rules.md)
* [Create a New Rule from the File](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/create-a-new-rule-from-the-file.md)
* [Export the Selected Rule by ID into the File](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/export-the-selected-rule-by-id-into-the-file.md)
* [Load the File and Return Its Preview](/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules/load-the-file-and-return-its-preview.md)


---

# Agent Instructions: 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:

```
GET https://guardian.hedera.com/docs/develop/guardian/standard-registry/schemas/schema-rules/apis-related-to-schema-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
