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

# Create Profile Validation Rule

> A `POST` to the `/profiles/validation-rules` endpoint allows your application to create a new Profile Validation Rule.



## OpenAPI

````yaml post /v3/profiles/validation-rules
openapi: 3.1.0
info:
  title: Omneo
  version: 0.0.1
servers:
  - url: https://api.{tenant}.getomneo.com/api
    variables:
      tenant:
        default: example
security: []
paths:
  /v3/profiles/validation-rules:
    post:
      tags:
        - Profile Validation Rule
      summary: Create Profile Validation Rule
      description: >-
        A `POST` to the `/profiles/validation-rules` endpoint allows your
        application to create a new Profile Validation Rule.
      operationId: validation-rules.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreProfileValidationRule'
      responses:
        '200':
          description: '`ProfileValidationRule`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ProfileValidationRule'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    StoreProfileValidationRule:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        type:
          type: string
          enum:
            - email
            - mobile
            - name
        rule_type:
          type: string
          enum:
            - exact
            - domain
            - prefix
            - regex
        applies_to:
          type: string
          enum:
            - create
            - update
            - import
            - all
        pattern:
          type:
            - string
            - 'null'
        error_message:
          type:
            - string
            - 'null'
          maxLength: 255
        priority:
          type:
            - integer
            - 'null'
        is_active:
          type:
            - boolean
            - 'null'
        effective_from:
          type:
            - string
            - 'null'
          format: date-time
        effective_to:
          type:
            - string
            - 'null'
          format: date-time
        created_by:
          type:
            - string
            - 'null'
          maxLength: 255
        updated_by:
          type:
            - string
            - 'null'
          maxLength: 255
        values:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              value:
                type: string
                maxLength: 255
              is_active:
                type:
                  - boolean
                  - 'null'
            required:
              - value
      required:
        - name
        - type
        - rule_type
        - applies_to
      title: StoreProfileValidationRule
    ProfileValidationRule:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          type: string
        rule_type:
          type: string
        applies_to:
          type: string
        pattern:
          type:
            - string
            - 'null'
        error_message:
          type:
            - string
            - 'null'
        priority:
          type: integer
        is_active:
          type: boolean
        effective_from:
          type: string
        effective_to:
          type: string
        created_by:
          type:
            - string
            - 'null'
        updated_by:
          type:
            - string
            - 'null'
        values:
          type: array
          items:
            $ref: '#/components/schemas/ProfileValidationRuleValue'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - name
        - type
        - rule_type
        - applies_to
        - pattern
        - error_message
        - priority
        - is_active
        - effective_from
        - effective_to
        - created_by
        - updated_by
        - created_at
        - updated_at
      title: ProfileValidationRule
    ProfileValidationRuleValue:
      type: object
      properties:
        id:
          type: integer
        rule_id:
          type: integer
        value:
          type: string
        is_active:
          type: boolean
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - rule_id
        - value
        - is_active
        - created_at
        - updated_at
      title: ProfileValidationRuleValue
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````