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

# Create password policy for alphanumeric password

## OpenAPI

````json POST /api/v1/secretmanager/pwdpolicies
{
  "openapi": "3.0.1",
  "info": {
    "title": "Secret Manager APIs",
    "version": "v1",
    "description": "API documentation for Secret Manager, Policy Administration, Notifications, Approval service, etc."
  },
  "servers": [
    {
      "url": "https://{tenantURL}",
      "description": "The primary server",
      "variables": {
        "tenantURL": {
          "default": "test.britive-app.com",
          "description": "The host of the server"
        }
      }
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Approvals"
    },
    {
      "name": "Notification Service"
    },
    {
      "name": "Policy Administration"
    },
    {
      "name": "Secrets Manager"
    },
    {
      "name": "Secret Rotation"
    }
  ],
  "paths": {
    "/api/v1/secretmanager/pwdpolicies": {
      "post": {
        "tags": [
          "Secrets Manager"
        ],
        "summary": "Create password policy for alphanumeric password",
        "operationId": "createPasswordPolicy",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "description": "Action",
            "schema": {
              "type": "string"
            },
            "example": "validatePasswordOrPin"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordPolicyDTO"
              },
              "example": {
                "name": "DBPasswordPolicy",
                "description": "Password Policy",
                "passwordType": "alphanumeric",
                "minPasswordLength": "8",
                "hasUpperCaseChars": "false",
                "hasLowerCaseChars": "true",
                "hasNumbers": "true",
                "hasSpecialChars": "true",
                "allowedSpecialChars": "@#$%("
              }
            }
          },
          "required": "false"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PasswordPolicyDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "maxLength": "30",
            "minLength": "1",
            "pattern": "^[a-zA-Z0-9-_\\s]{1,30}$",
            "type": "string"
          },
          "description": {
            "maxLength": "255",
            "minLength": "0",
            "type": "string"
          },
          "passwordType": {
            "pattern": "\\s*alphanumeric\\s*|\\s*pin\\s*",
            "type": "string"
          },
          "allowedSpecialChars": {
            "pattern": "[^a-zA-Z0-9]+",
            "type": "string"
          },
          "minPasswordLength": {
            "type": "integer",
            "format": "int32"
          },
          "hasUpperCaseChars": {
            "type": "boolean"
          },
          "hasLowerCaseChars": {
            "type": "boolean"
          },
          "hasNumbers": {
            "type": "boolean"
          },
          "hasSpecialChars": {
            "type": "boolean"
          },
          "pinLength": {
            "type": "integer",
            "format": "int32"
          },
          "passwordOrPin": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
````

