> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xsdr.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Rule



## OpenAPI

````yaml /openapi.json post /api.CreateRule
openapi: 3.0.0
info:
  description: Real-time event monitoring infrastructure for agents.
  title: XSDR API
  version: '1'
servers:
  - description: Production
    url: https://api.xsdr.app
security:
  - apiKey: []
paths:
  /api.CreateRule:
    post:
      summary: Create Rule
      operationId: createRule
      requestBody:
        content:
          application/json:
            schema:
              properties:
                intent:
                  type: string
                name:
                  type: string
                overrides:
                  additionalProperties:
                    type: string
                  type: object
                platforms:
                  items:
                    type: string
                  type: array
              required:
                - name
                - intent
                - platforms
                - overrides
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  platforms:
                    additionalProperties:
                      $ref: '#/components/schemas/api.PlatformRuleResult'
                    type: object
                  rule_id:
                    type: string
                required:
                  - rule_id
                  - platforms
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    api.PlatformRuleResult:
      properties:
        platform_rule_id:
          type: string
        translated_value:
          type: string
      required:
        - platform_rule_id
        - translated_value
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization

````