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

# Atualizar um Ativo

> Use este endpoint para atualizar os detalhes de um Ativo.



## OpenAPI

````yaml pt/openapi/v3-current/ledger.yaml patch /v1/organizations/{organization_id}/ledgers/{ledger_id}/assets/{asset_id}
openapi: 3.1.0
info:
  title: API Midaz Ledger
  description: >-
    Referência completa da API para serviços do Midaz Ledger incluindo
    gerenciamento de organizações, operações de ledger, ativos, segmentos,
    portfolios, contas, tipos de conta, transações, operações, saldos, rotas de
    operação, rotas de transação e índices de metadata.
  version: 3.7.8
servers:
  - url: https://ledger.sandbox.lerian.net
security: []
tags:
  - name: API de Organizações
  - name: API de Ledgers
  - name: API de Ativos
  - name: API de Segmentos
  - name: API de Portfolios
  - name: API de Tipos de Conta
  - name: API de Contas
  - name: API de Saldos
  - name: API de Transações
  - name: API de Operações
  - name: API de Rotas de Operação
  - name: API de Rotas de Transação
  - name: API de Índices de Metadata
  - name: API de Titulares
  - name: API de Instrumentos
  - name: API de Pacotes de Cobrança
  - name: API de Pacotes
  - name: API de Cálculo de Cobrança
  - name: API de Estimativa
  - name: API de Criptografia
  - name: API de Proteção
  - name: API de Taxas de Ativos
paths:
  /v1/organizations/{organization_id}/ledgers/{ledger_id}/assets/{asset_id}:
    patch:
      tags:
        - API de Ativos
      summary: Atualizar um Ativo
      description: Use este endpoint para atualizar os detalhes de um Ativo.
      parameters:
        - $ref: '#/components/parameters/OrganizationId'
        - $ref: '#/components/parameters/LedgerId'
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XRequestId'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/AssetId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAssetRequest'
            example:
              name: Brazilian Real - Updated
              status:
                code: INACTIVE
                description: Asset temporarily deactivated due to regulatory review
              metadata:
                symbol: R$
                country: Brazil
                isoNumeric: '986'
                supportsFractions: true
                decimalPlaces: 2
                category: fiat
                environment: production
                updatedBy: system_admin
                notes: BRL asset blocked pending compliance verification
      responses:
        '200':
          description: >-
            Indica que a requisição foi bem-sucedida e a resposta contém os
            dados esperados.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAssetResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0047:
                  $ref: '#/components/examples/Error0047'
                Error0050:
                  $ref: '#/components/examples/Error0050'
                Error0051:
                  $ref: '#/components/examples/Error0051'
                Error0053:
                  $ref: '#/components/examples/Error0053'
                Error0065:
                  $ref: '#/components/examples/Error0065'
                Error0067:
                  $ref: '#/components/examples/Error0067'
                Error0094:
                  $ref: '#/components/examples/Error0094'
        '401':
          description: Não autorizado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0041:
                  $ref: '#/components/examples/Error0041'
                Error0042:
                  $ref: '#/components/examples/Error0042'
        '403':
          description: Proibido
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0043:
                  $ref: '#/components/examples/Error0043'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error0055:
                  $ref: '#/components/examples/Error0055'
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0003:
                  $ref: '#/components/examples/Error0003'
        '500':
          description: Erro Interno do Servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0046:
                  $ref: '#/components/examples/Error0046'
components:
  parameters:
    OrganizationId:
      name: organization_id
      in: path
      description: O identificador único da Organização associada ao Ledger.
      required: true
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
        format: uuid
    LedgerId:
      name: ledger_id
      in: path
      description: O identificador único do Ledger associado.
      required: true
      example: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
      schema:
        type: string
        format: uuid
    ContentType:
      name: Content-Type
      in: header
      description: O tipo de mídia do recurso. O valor recomendado é `application/json`.
      required: false
      example: application/json
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: >-
        Um identificador único utilizado para rastrear e acompanhar cada
        requisição.
      required: false
      example: 019c96a0-0a98-7287-9a31-786e0809c769
      schema:
        type: string
        format: uuid
    Authorization:
      name: Authorization
      in: header
      required: false
      schema:
        type: string
      description: >
        Token JWT bearer para autenticação.

        Obrigatório quando `PLUGIN_AUTH_ENABLED=true` (exigido em implantações
        multi-tenant).

        Opcional no modo OSS single-tenant padrão.

        Formato: `Bearer <token>`
    AssetId:
      name: asset_id
      in: path
      description: >-
        O identificador único do ativo que você deseja consultar, excluir ou
        atualizar.
      required: true
      example: 019c96a0-0adb-785e-a400-e1cdb2dcfeff
      schema:
        type: string
        format: uuid
  schemas:
    UpdateAssetRequest:
      type: object
      properties:
        name:
          type: string
          description: O nome do Ativo.
          maxLength: 256
        status:
          $ref: '#/components/schemas/StatusOrganizationRequest'
        metadata:
          $ref: '#/components/schemas/Metadata'
    CreateAssetResponse:
      type: object
      properties:
        id:
          type: string
          description: O identificador único do Ativo.
          format: uuid
        organizationId:
          type: string
          format: uuid
          description: O identificador único da Organização.
        ledgerId:
          type: string
          description: O identificador único do Ledger.
          format: uuid
        name:
          type: string
          description: O nome do Ativo.
          maxLength: 256
        type:
          type: string
          description: O tipo de Ativo.
          enum:
            - currency
            - crypto
            - commodity
            - others
          format: enum
        code:
          type: string
          description: O código usado para referenciar o Ativo.
        status:
          $ref: '#/components/schemas/StatusOrganization'
        metadata:
          $ref: '#/components/schemas/Metadata'
        createdAt:
          type: string
          format: date-time
          description: Data e hora de criação (UTC).
        updatedAt:
          type: string
          format: date-time
          description: Data e hora da última atualização (UTC).
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Data e hora da exclusão lógica, se aplicável (UTC).
    ErrorFormat:
      type: object
      description: A mensagem de erro da resposta.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Um identificador único e estável para o erro.
        title:
          type: string
          description: Um breve resumo do problema.
        message:
          type: string
          description: Orientação detalhada para resolver o erro.
        entityType:
          type: string
          description: >-
            O tipo de entidade ao qual o erro se refere (por exemplo,
            organization, ledger, account, transaction). Opcional.
        fields:
          type: object
          additionalProperties: true
          description: Informações adicionais sobre os campos que causaram o erro.
    StatusOrganizationRequest:
      type: object
      description: >-
        Um objeto contendo informações sobre o status. **Importante**: Se não
        fornecido, o status padrão será 'ACTIVE'.
      properties:
        code:
          type: string
          maxLength: 100
          description: O nome do status.
        description:
          type:
            - string
            - 'null'
          maxLength: 256
          description: A descrição do status.
    Metadata:
      type: object
      additionalProperties:
        oneOf:
          - type: string
            maxLength: 2000
          - type: number
          - type: boolean
      description: >-
        Um objeto contendo pares de chave-valor para adicionar como metadata,
        onde o campo `name` é a chave e o campo `value` é o valor. Por exemplo,
        para adicionar um Centro de Custo, use `'costCenter': 'BR_11101997'`.


        **Restrições:** as chaves devem ter no máximo 100 caracteres; valores de
        string no máximo 2000 caracteres. Objetos aninhados não são permitidos
        (os valores devem ser string, número ou booleano), a estrutura não pode
        exceder uma profundidade máxima de 10, e é permitido um máximo de 100
        chaves.
    StatusOrganization:
      type: object
      description: Um objeto contendo informações sobre o status.
      properties:
        code:
          type: string
          maxLength: 100
          description: O nome do status.
        description:
          type:
            - string
            - 'null'
          maxLength: 256
          description: A descrição do status.
  examples:
    Error0047:
      summary: Bad Request
      value:
        code: '0047'
        title: Bad Request
        message: >-
          The server could not understand the request due to malformed syntax.
          Please check the listed fields and try again.
    Error0050:
      value:
        code: '0050'
        title: Invalid Metadata
        message: >-
          One or more metadata entries are invalid. Please ensure metadata keys
          and values follow the allowed format.
      summary: Invalid Metadata
    Error0051:
      value:
        code: '0051'
        title: Invalid Metadata Key
        message: >-
          A metadata key contains unsupported characters or exceeds length
          limits. Please correct the key and try again.
      summary: Invalid Metadata Key
    Error0053:
      value:
        code: '0053'
        title: Unexpected Fields in the Request
        message: >-
          The request body contains more fields than expected. Please send only
          the allowed fields as per the documentation. The unexpected fields are
          listed in the fields object.
        fields:
          '{{field}}': '{{value}}'
      summary: Unexpected Fields in the Request
    Error0065:
      value:
        code: '0065'
        title: Invalid Path Parameter
        message: >-
          The provided path parameter {{parameter_name}} is not in the expected
          format. Please ensure the parameter adheres to the required format and
          try again.
      summary: Invalid Path Parameter
    Error0067:
      value:
        code: '0067'
        title: Invalid Metadata Nesting
        message: >-
          The metadata object cannot contain nested values. Please ensure that
          the value {{value}} is not nested and try again.
      summary: Invalid Metadata Nesting
    Error0094:
      value:
        code: '0094'
        title: Invalid Request Body
        message: >-
          The request body is invalid or could not be parsed. Please check JSON
          structure and field types.
      summary: Invalid Request Body
    Error0041:
      summary: Token Missing
      value:
        code: '0041'
        title: Token Missing
        message: >-
          A valid token must be provided in the request header. Please include a
          token and try again.
    Error0042:
      summary: Invalid Token
      value:
        code: '0042'
        title: Invalid Token
        message: >-
          The provided token is expired, invalid or malformed. Please provide a
          valid token and try again.
    Error0043:
      summary: Insufficient Privileges
      value:
        code: '0043'
        title: Insufficient Privileges
        message: >-
          You do not have the necessary permissions to perform this action.
          Please contact your administrator if you believe this is an error.
    Error0007:
      value:
        code: '0007'
        title: Entity Not Found
        message: >-
          No entity was found for the given ID. Please make sure to use the
          correct ID for the entity you are trying to manage.
      summary: Entity Not Found
    Error0055:
      summary: Asset ID Not Found
      value:
        code: '0055'
        title: Asset ID Not Found
        message: >-
          The specified asset ID does not exist in the provided ledger. Please
          verify the asset ID and try again.
    Error0003:
      summary: Asset Name or Code Duplicate
      value:
        code: '0003'
        title: Asset Name or Code Duplicate
        message: >-
          An asset with the same name or code already exists in your ledger.
          Please modify the name or code of your new asset.
    Error0046:
      summary: Internal Server Error
      value:
        code: '0046'
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.

````