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

# Create

> Create a Static Secrets Validation Rule for the specified project.



## OpenAPI

````yaml POST /api/v1/secret-validation-rules/static-secrets
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/secret-validation-rules/static-secrets:
    post:
      tags:
        - Secret Validation Rules
      description: Create a Static Secrets Validation Rule for the specified project.
      operationId: createStaticSecretsValidationRule
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: The name of the Static Secrets Validation Rule to create.
                projectId:
                  type: string
                  minLength: 1
                  maxLength: 36
                  description: >-
                    The ID of the project to create the Static Secrets
                    Validation Rule in.
                description:
                  type: string
                  maxLength: 500
                  nullable: true
                  description: >-
                    An optional description of the Static Secrets Validation
                    Rule.
                environment:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: >-
                    The slug of the environment to scope this rule to. Omit to
                    enforce the rule in every environment of the project.
                secretPath:
                  type: string
                  minLength: 1
                  maxLength: 1024
                  description: >-
                    The secret path to scope this rule to. Supports glob
                    patterns such as `/apps/**`.
                isActive:
                  type: boolean
                  default: true
                  description: >-
                    Whether the rule is enforced. An inactive rule is kept but
                    ignored.
                keyConstraints:
                  type: object
                  properties:
                    minLength:
                      type: integer
                      minimum: 1
                      maximum: 65536
                      description: >-
                        The minimum number of characters the secret key must
                        contain.
                    maxLength:
                      type: integer
                      minimum: 1
                      maximum: 65536
                      description: >-
                        The maximum number of characters the secret key may
                        contain.
                    regexPattern:
                      type: string
                      minLength: 1
                      maxLength: 4096
                      description: A regular expression the secret key must match.
                    requiredPrefix:
                      type: string
                      minLength: 1
                      maxLength: 1024
                      description: A string the secret key must start with.
                    requiredSuffix:
                      type: string
                      minLength: 1
                      maxLength: 1024
                      description: A string the secret key must end with.
                  additionalProperties: false
                  description: >-
                    Constraints enforced on the secret key when a secret is
                    created or renamed. Omit to leave keys unconstrained.
                valueConstraints:
                  type: object
                  properties:
                    minLength:
                      type: integer
                      minimum: 1
                      maximum: 65536
                      description: >-
                        The minimum number of characters the secret value must
                        contain.
                    maxLength:
                      type: integer
                      minimum: 1
                      maximum: 65536
                      description: >-
                        The maximum number of characters the secret value may
                        contain.
                    regexPattern:
                      type: string
                      minLength: 1
                      maxLength: 4096
                      description: A regular expression the secret value must match.
                    requiredPrefix:
                      type: string
                      minLength: 1
                      maxLength: 1024
                      description: A string the secret value must start with.
                    requiredSuffix:
                      type: string
                      minLength: 1
                      maxLength: 1024
                      description: A string the secret value must end with.
                    uniqueAcrossLastVersions:
                      type: integer
                      minimum: 1
                      maximum: 25
                      description: >-
                        How many of the secret's own previous versions the new
                        value must differ from. Between 1 and 25. Omit to accept
                        a value the secret has held before.
                    uniqueWithinScope:
                      type: boolean
                      description: >-
                        Set to true to reject a value that another secret in the
                        rule's scope already holds. Requires blind indexing on
                        the project.
                  additionalProperties: false
                  description: >-
                    Constraints enforced on the secret value when a secret is
                    created or updated. Omit to leave values unconstrained.
              required:
                - name
                - projectId
                - secretPath
              additionalProperties: false
      responses:
        '201':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  secretValidationRule:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type: string
                        nullable: true
                      projectId:
                        type: string
                      secretPath:
                        type: string
                      isActive:
                        type: boolean
                        default: true
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                      environment:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          name:
                            type: string
                          slug:
                            type: string
                        required:
                          - id
                          - name
                          - slug
                        additionalProperties: false
                        nullable: true
                      type:
                        type: string
                        enum:
                          - static-secrets
                      keyConstraints:
                        type: object
                        properties:
                          minLength:
                            type: integer
                            minimum: 1
                            maximum: 65536
                            description: >-
                              The minimum number of characters the secret key
                              must contain.
                          maxLength:
                            type: integer
                            minimum: 1
                            maximum: 65536
                            description: >-
                              The maximum number of characters the secret key
                              may contain.
                          regexPattern:
                            type: string
                            minLength: 1
                            maxLength: 4096
                            description: A regular expression the secret key must match.
                          requiredPrefix:
                            type: string
                            minLength: 1
                            maxLength: 1024
                            description: A string the secret key must start with.
                          requiredSuffix:
                            type: string
                            minLength: 1
                            maxLength: 1024
                            description: A string the secret key must end with.
                        additionalProperties: false
                        description: >-
                          Constraints enforced on the secret key when a secret
                          is created or renamed. Omit to leave keys
                          unconstrained.
                      valueConstraints:
                        type: object
                        properties:
                          minLength:
                            type: integer
                            minimum: 1
                            maximum: 65536
                            description: >-
                              The minimum number of characters the secret value
                              must contain.
                          maxLength:
                            type: integer
                            minimum: 1
                            maximum: 65536
                            description: >-
                              The maximum number of characters the secret value
                              may contain.
                          regexPattern:
                            type: string
                            minLength: 1
                            maxLength: 4096
                            description: A regular expression the secret value must match.
                          requiredPrefix:
                            type: string
                            minLength: 1
                            maxLength: 1024
                            description: A string the secret value must start with.
                          requiredSuffix:
                            type: string
                            minLength: 1
                            maxLength: 1024
                            description: A string the secret value must end with.
                          uniqueAcrossLastVersions:
                            type: integer
                            minimum: 1
                            maximum: 25
                            description: >-
                              How many of the secret's own previous versions the
                              new value must differ from. Between 1 and 25. Omit
                              to accept a value the secret has held before.
                          uniqueWithinScope:
                            type: boolean
                            description: >-
                              Set to true to reject a value that another secret
                              in the rule's scope already holds. Requires blind
                              indexing on the project.
                        additionalProperties: false
                        description: >-
                          Constraints enforced on the secret value when a secret
                          is created or updated. Omit to leave values
                          unconstrained.
                    required:
                      - id
                      - name
                      - projectId
                      - secretPath
                      - createdAt
                      - updatedAt
                      - environment
                      - type
                    additionalProperties: false
                    title: Static Secrets
                required:
                  - secretValidationRule
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````