> **Source:** https://knowledge.leegality.com/sign-station/api/create-password-policy > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # POST /api/v1/password-policy — Create new password policy This API creates a new password policy for the current user's organization. Each organization can have only one password policy and it is created during the initial setup. Subsequent updates should use the update endpoint. **Authentication:** `X-Auth-Token` header required on every request. ## Request URL ``` POST https://app1.leegality.com/api/api/v1/password-policy ``` **Environments:** - Production: `https://app1.leegality.com/api/api/v1/password-policy` - Sandbox: `https://sandbox.leegality.com/api/api/v1/password-policy` --- ## Request Body **Content-Type:** `application/json` Password policy data to create | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `minimumPasswordLength` | integer | Yes | Minimum length required for passwords | `8` | | `numbersRequired` | boolean | Yes | Indicates if numbers are required in passwords | `true` | | `specialCharactersRequired` | boolean | Yes | Indicates if special characters are required in passwords | `true` | | `uppercaseRequired` | boolean | Yes | Indicates if uppercase letters are required in passwords | `true` | ### Sample Request ```json { "minimumPasswordLength": 8, "numbersRequired": true, "specialCharactersRequired": true, "uppercaseRequired": true } ``` --- ## Responses ### 201 — Password policy created successfully | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Response code indicating success or failure | `LE_SS_001` | | `message` | string | No | Response message providing additional information | `Password policy created successfully` | | `data` | PasswordPolicyVO | No | See **PasswordPolicyVO** below. | — | #### PasswordPolicyVO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `id` | string | No | Password policy unique identifier | `9ef35b27-86c8-4450-8807-317c37a61aae` | | `minimumPasswordLength` | integer | No | Minimum length required for passwords | `6` | | `numbersRequired` | boolean | No | Indicates if numbers are required in passwords | `false` | | `specialCharactersRequired` | boolean | No | Indicates if special characters are required in passwords | `false` | | `uppercaseRequired` | boolean | No | Indicates if uppercase letters are required in passwords | `true` | | `createdAt` | string | No | The date and time when the password policy was created | `2025-10-10T15:58:34` | ### 400 — Invalid request data | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_400` | | `errors` | array\ | No | List of error details See **ErrorDetailPasswordPolicy400VO** below. | — | #### ErrorDetailPasswordPolicy400VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Invalid value for field [minimumPasswordLength], Minimum pas` | | `path` | string | No | API path that generated the error | `/api/v1/password-policy` | ### 401 — Unauthorized - Invalid or expired token | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_401` | | `errors` | array\ | No | List of error details See **ErrorDetail401Unauthorized** below. | — | #### ErrorDetail401Unauthorized | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Invalid or expired token` | | `path` | string | No | API path that generated the error | `/api/v1/*` | | `code` | string | No | Specific error code | `LE_ERR_SS_303` | ### 409 — Password policy already exists for organization | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_409` | | `errors` | array\ | No | List of error details See **ErrorDetailPasswordPolicy409VO** below. | — | #### ErrorDetailPasswordPolicy409VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Password policy for organization 'TestOrganization' already ` | | `path` | string | No | API path that generated the error | `/api/v1/password-policy` | | `code` | string | No | Specific error code | `LE_ERR_SS_010` | ### 500 — Internal server error | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_500` | | `errors` | array\ | No | List of error details See **ErrorDetailToken500VO** below. | — | #### ErrorDetailToken500VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Internal Server Error` | | `path` | string | No | API path that generated the error | `null` | | `code` | string | No | Specific error code | `null` | ### Sample Response (201) ```json { "code": "LE_SS_001", "message": "Password policy created successfully", "data": { "id": "9ef35b27-86c8-4450-8807-317c37a61aae", "minimumPasswordLength": 6, "numbersRequired": false, "specialCharactersRequired": false, "uppercaseRequired": true, "createdAt": "2025-10-10T15:58:34" } } ```