---
title: "Create Xpath Rule"
method: POST
path: "/rules/v1/rule/xpath"
---

# Create Xpath Rule

`POST /rules/v1/rule/xpath`

## Request

- Base URL: `https://api.qualityclouds.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.qualityclouds.ai/rules/v1/rule/xpath`
- Auth: one of:
  - HTTP bearer
  - OpenID Connect (`https://account.qualityclouds.com//realms/ai-production/.well-known/openid-configuration`)

Endpoint para crear una regla de tipo xpath.

## Request body

- XpathRuleInput
  - `rule_slug` string, required
  - `version` string, required
  - `name` string, required
  - `description` string, required
  - `severity` string, required
  - `impact_area` string, required
  - `estimated_time_to_fix` integer, required
  - `platforms` string[], required
  - `ce_types` string[], required
  - `file_extensions` string[], required
  - `repository_ids` integer[], required
  - `org_uuids` string[], required
  - `is_common` boolean
  - `payload` object, required
  - `file_extensions_ids` string[]
  - `path_patterns` string[]
  - `impact` string, nullable
  - `action` string, nullable
  - `ruleset_id` string, nullable

## Response `200`

Successful Response

- XpathRuleResponse: Respuesta para reglas de tipo xpath.
  - `id` string, required
  - `rule_slug` string, required
  - `version` string, required
  - `name` string, required
  - `description` string, required
  - `estimated_time_to_fix` integer, required
  - `severity` string, required
  - `impact_area` string, required
  - `ce_types` string[], required
  - `platforms` string[], required
  - `repository_ids` integer[], required
  - `org_uuids` string[], required
  - `payload` XpathPayload, required: Payload interno que contiene la expresión XPath de la regla.
    - `xpath_expression` string, required: XPath expression pattern for the rule
  - `is_common` boolean, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Validation Error

---

[API](https://skmtc.dev/qualityclouds/apis/qai-orchestrator-api.md) · [All operations](https://skmtc.dev/qualityclouds/apis/qai-orchestrator-api/llms.txt) · [OpenAPI document](https://skmtc.dev/qualityclouds/apis/qai-orchestrator-api/revisions/250c849925af?raw)
