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

# Create or update the asset number policy

> Create or update the asset number generation policy for the organization.



## OpenAPI

````yaml https://api.itmc.i.moneyforward.com/public-api/docs/v1-json patch /api/v1/organizations/{organizationId}/devices/asset-number/policy
openapi: 3.0.0
info:
  title: Admina Public API
  description: >-
    Admina API is a RESTfull API providing programmatic access to much of the
    data in the system. It provides predictable URLs for accessing resources,
    and uses built-in HTTP features to receive commands and return responses.
    This makes it easy to communicate with from a wide variety of environments,
    from command-line utilities to gadgets to the browser URL bar itself.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.itmc.i.moneyforward.com
security: []
tags:
  - name: Organizations
    description: ''
  - name: Users
    description: ''
  - name: Directory
    description: ''
  - name: Departments
    description: ''
  - name: Locations
    description: ''
  - name: Companies
    description: ''
  - name: People
    description: ''
  - name: Workspaces
    description: ''
  - name: Custom Service and Workspace
    description: ''
  - name: Custom Services
    description: ''
  - name: Workspace Accounts
    description: ''
  - name: Accounts
    description: ''
  - name: Contracts
    description: ''
  - name: Devices
    description: ''
  - name: Devices (alpha)
    description: ''
  - name: Alerts
    description: ''
  - name: Spends
    description: ''
  - name: Usage Optimization
    description: ''
  - name: Services
    description: ''
  - name: Service Roles
    description: ''
  - name: Service Licenses
    description: ''
  - name: Recommended Services
    description: ''
  - name: Requests
    description: ''
  - name: AuditLogs
    description: ''
  - name: EventLogs
    description: ''
paths:
  /api/v1/organizations/{organizationId}/devices/asset-number/policy:
    patch:
      tags:
        - Devices
      summary: Create or update the asset number policy
      description: >-
        Create or update the asset number generation policy for the
        organization.
      operationId: publicUpdateAssetNumberPolicy
      parameters:
        - name: organizationId
          required: true
          in: path
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicUpdateAssetNumberPolicyRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicGetAssetNumberPolicyResponseDto'
        '400':
          description: Invalid request body
        '401':
          description: Invalid or missing API key
      security:
        - API-Key: []
components:
  schemas:
    PublicUpdateAssetNumberPolicyRequestDto:
      type: object
      properties:
        prefixPattern:
          description: Prefix pattern defining how asset numbers are generated
          example:
            - type: fixed
              metadata:
                value: ADMINA
          type: array
          items:
            $ref: '#/components/schemas/PrefixPatternDto'
        suffixDigits:
          type: number
          description: >-
            Number of digits for suffix padding (e.g., 2 → 01, 3 → 001, 4 →
            0001)
          example: 2
          minimum: 1
          maximum: 10
      required:
        - prefixPattern
    PublicGetAssetNumberPolicyResponseDto:
      type: object
      properties:
        assignmentMethod:
          type: string
          description: >-
            Assignment method for this organization. Undefined when no policy is
            configured.
          enum:
            - shared
            - device_type
          example: shared
        policy:
          description: >-
            Asset number policy (single policy per organization). Null when no
            policy is configured.
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/PublicAssetNumberPolicyDto'
    PrefixPatternDto:
      type: object
      properties:
        type:
          type: string
          description: Pattern type
          enum:
            - fixed
            - device_type_prefix
            - device_field
            - date_format
          example: fixed
        metadata:
          description: Pattern metadata
          allOf:
            - $ref: '#/components/schemas/PrefixPatternMetadataDto'
      required:
        - type
        - metadata
    PublicAssetNumberPolicyDto:
      type: object
      properties:
        id:
          type: number
          description: Policy ID
          example: 1
        prefixPattern:
          description: Dynamic prefix pattern defining how asset numbers are generated
          example:
            - type: fixed
              metadata:
                value: ADMINA
          type: array
          items:
            type: string
        suffixDigits:
          type: number
          description: Number of digits for suffix padding (e.g., 2 → 01, 3 → 001)
          example: 2
        enabled:
          type: boolean
          description: Whether auto-generation is enabled for this policy
          example: true
        createdAt:
          format: date-time
          type: string
          description: Created timestamp
        updatedAt:
          format: date-time
          type: string
          description: Updated timestamp
      required:
        - id
        - prefixPattern
        - suffixDigits
        - enabled
        - createdAt
        - updatedAt
    PrefixPatternMetadataDto:
      type: object
      properties:
        value:
          type: string
          description: Fixed value (for FIXED type)
          example: ADMINA
        mapping:
          type: object
          description: >-
            Prefix mapping (for DEVICE_TYPE_PREFIX type). Maps key to prefix
            string.
          example:
            desktop_pc: DT
            laptop_pc: LT
        format:
          type: string
          description: Date format string (for DATE_FORMAT type)
          example: MMYYYY
        fieldPath:
          type: string
          description: Field path (for DEVICE_FIELD type)
          example: deviceType
  securitySchemes:
    API-Key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        For authenticated requests, set the `Authorization: Bearer your_api_key`
        parameter in the header. <br/>You can create and manage your API Keys by
        visiting the **API Keys** tab in the **Settings** page of your
        organization in <a target='_blank'
        href='https://itmc.i.moneyforward.com/'>Admina</a>

````