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

# Create Policy

> Creates a policy that grants developers temporary permission to perform specific actions on users' behalf for a limited time.

<Snippet file="header-project-id.mdx" />


## OpenAPI

````yaml post /policies
openapi: 3.0.1
info:
  title: WalletKit
  version: 0.0.1
servers:
  - url: https://testnet.walletkit.com
    description: testnet
  - url: https://mainnet.walletkit.com
    description: mainnet
security: []
paths:
  /policies:
    post:
      tags:
        - Policies
      summary: Create Policy
      description: >-
        Creates a policy that grants developers temporary permission to perform
        specific actions on users' behalf for a limited time.
      operationId: policies_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                network:
                  $ref: '#/components/schemas/Network'
                name:
                  type: string
                wallet_address:
                  type: string
                argument_rules:
                  type: array
                  items:
                    $ref: '#/components/schemas/ArgumentRule'
                  description: >-
                    A list of rules that govern the arguments of the function
                    calls that the developer is allowed to make.
                expires_at:
                  type: string
                  format: date-time
                  nullable: true
                  description: >-
                    The time at which the policy expires. The developer will no
                    longer be able to make function calls on the user's behalf
                    after this time. When omitted, the policy will never expire.
                developer_secret:
                  $ref: '#/components/schemas/DeveloperSecret'
                user_pin:
                  $ref: '#/components/schemas/UserPin'
              required:
                - network
                - name
                - wallet_address
                - argument_rules
                - developer_secret
                - user_pin
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    Network:
      title: Network
      type: string
      enum:
        - Ethereum
        - Polygon
        - Base
        - Avalanche
        - Polkadot
        - Vara
    ArgumentRule:
      title: ArgumentRule
      type: object
      properties:
        argument:
          type: string
          description: >-
            The name of the argument that the rule applies to. e.g.
            decodedInput.function, decodedInput.to
        operator:
          $ref: '#/components/schemas/Operator'
        value:
          type: string
          description: the value to compare the argument to. e.g. "transfer", "0x1234..."
      required:
        - argument
        - operator
        - value
    DeveloperSecret:
      title: DeveloperSecret
      type: string
      nullable: true
      description: >-
        On testnet, the developer_secret is always "testnet-secret". On mainnet,
        the developer_secret is set by the developer during account activation.
    UserPin:
      title: UserPin
      type: string
      nullable: true
      description: >-
        A 6-digit numeric pin that is only known to the user, set during wallet
        creation. This pin is required to sign transactions from this wallet.
    Policy:
      title: Policy
      type: object
      properties:
        uuid:
          type: string
        project_id:
          type: string
        network:
          $ref: '#/components/schemas/Network'
        name:
          type: string
          nullable: true
        wallet_address:
          type: string
        argument_rules:
          type: array
          items:
            $ref: '#/components/schemas/ArgumentRule'
        expires_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - uuid
        - project_id
        - network
        - wallet_address
        - argument_rules
        - created_at
        - updated_at
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        code:
          type: string
          nullable: true
        error:
          type: string
      required:
        - error
    Operator:
      title: Operator
      type: string
      enum:
        - eq
        - ne
        - gt
        - ge
        - lt
        - le
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````