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

# Update token decimals and scale related entities

> 
    Updates the decimal places for a token and automatically scales all related donation and pledge amounts.
    This endpoint is restricted to users with the maintainer role.
    The operation is atomic - if any step fails, all changes are rolled back.
    



## OpenAPI

````yaml https://api.endaoment.org/oas-json patch /v1/tokens/{id}/decimals
openapi: 3.0.0
info:
  title: Endaoment API
  description: The official Endaoment API endpoints
  version: 0.0.1
  contact: {}
servers:
  - url: https://api.endaoment.org
    description: Production
security: []
tags: []
paths:
  /v1/tokens/{id}/decimals:
    patch:
      tags:
        - Tokens
      summary: Update token decimals and scale related entities
      description: |2-

            Updates the decimal places for a token and automatically scales all related donation and pledge amounts.
            This endpoint is restricted to users with the maintainer role.
            The operation is atomic - if any step fails, all changes are rolled back.
            
      operationId: TokensController_updateTokenDecimals
      parameters:
        - name: id
          required: true
          in: path
          description: Token ID
          example: 1
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTokenDecimalsInputDto'
      responses:
        '200':
          description: Token decimals successfully updated with detailed report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateTokenDecimalsResponseDto'
components:
  schemas:
    UpdateTokenDecimalsInputDto:
      type: object
      properties:
        newDecimals:
          type: number
          description: New decimal places for the token
          minimum: 1
          maximum: 32
          example: 18
      required:
        - newDecimals
    UpdateTokenDecimalsResponseDto:
      type: object
      properties:
        token:
          description: The updated token
          allOf:
            - $ref: '#/components/schemas/Token'
        donationsUpdated:
          type: number
          description: Number of donations updated without precision loss
          example: 5
        cryptoPledgesUpdated:
          type: number
          description: Number of crypto pledges updated without precision loss
          example: 3
        itemsWithPrecisionLoss:
          description: Array of items that experienced precision loss during the update
          type: array
          items:
            $ref: '#/components/schemas/PrecisionLossItemDto'
      required:
        - token
        - donationsUpdated
        - cryptoPledgesUpdated
        - itemsWithPrecisionLoss
    Token:
      type: object
      properties: {}
    PrecisionLossItemDto:
      type: object
      properties:
        oldInputAmount:
          type: string
          description: Original input amount before scaling
          example: '1000000000000000001'
        newInputAmount:
          type: string
          description: New input amount after scaling (with precision loss)
          example: '1000000'
        entityId:
          type: string
          description: ID of the entity that was updated
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        entityName:
          type: string
          description: Name of the entity class that was updated
          example: Donation
          enum:
            - Donation
            - CryptoDonationPledge
      required:
        - oldInputAmount
        - newInputAmount
        - entityId
        - entityName

````