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

# Create Policy



## OpenAPI

````yaml POST /policies
openapi: 3.1.0
info:
  title: Wardin API
  version: 1.0.0
  description: >-
    Wardin REST API — manage virtual keys, budgets, policies, and pull
    analytics.
  contact:
    name: Wardin Support
    url: https://wardin.ai
servers:
  - url: https://api.wardin.ai/v1
    description: Production
security:
  - BearerAuth: []
paths:
  /policies:
    post:
      tags:
        - Policies
      summary: Create a policy
      operationId: createPolicy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - type
                - config
              properties:
                name:
                  type: string
                type:
                  type: string
                  enum:
                    - model_allowlist
                    - pii_redaction
                    - prompt_injection
                    - guardrail
                config:
                  type: object
                keyIds:
                  type: array
                  items:
                    type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
components:
  schemas:
    Policy:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
            - model_allowlist
            - pii_redaction
            - prompt_injection
            - guardrail
        config:
          type: object
        enabled:
          type: boolean
        hitCount:
          type: integer
        createdAt:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: A `wardin_sk_` virtual key with manager-level access.

````