# ダイナミックNFT更新

## update**dnft** <a href="#createnft" id="createnft"></a>

既存のダイナミックNFTを更新します。

## **基本情報** <a href="#basic-info" id="basic-info"></a>

<table><thead><tr><th width="134">プロパティ</th><th width="226">詳細</th></tr></thead><tbody><tr><td>URL</td><td><code>/api/v1/updatednft</code></td></tr><tr><td>Method</td><td>POST</td></tr></tbody></table>

## **リクエストパラメータ** <a href="#request" id="request"></a>

<table><thead><tr><th width="231">パラメータ</th><th width="85">種類</th><th width="78">必須</th><th width="318">詳細</th></tr></thead><tbody><tr><td>nft_gdn_id</td><td>str</td><td>yes</td><td>対象NFTの<code>nft_gdn_id</code></td></tr><tr><td>contract_address</td><td>str</td><td>yes</td><td>コレクション(コントラクト)のアドレス</td></tr><tr><td>metadata</td><td>list</td><td>yes</td><td>NFTのメタデータ(下記参照)</td></tr></tbody></table>

## **metadata** <a href="#metadata" id="metadata"></a>

NFTのメタデータを定義します。ファイルアップロードが必要な項目は、`file_fields`に指定します。

<table><thead><tr><th width="149">パラメータ</th><th width="76">種類</th><th width="73">必須</th><th width="393">詳細</th></tr></thead><tbody><tr><td>title</td><td>str</td><td>Yes</td><td>NFTのタイトル</td></tr><tr><td>description</td><td>str</td><td>Yes</td><td>NFTの説明</td></tr><tr><td>file_fields</td><td>list</td><td>Yes</td><td>ファイルアップロードが必要なメタデータの項目。KeyとUrlのペアで登録（下記参考）</td></tr><tr><td>attribute</td><td>list</td><td>No</td><td>NFTに追加するプロパティ。最大10個。</td></tr></tbody></table>

{% hint style="warning" %}
メタデータに設定できる項目の数は、`title`, `description`, 各`file_fields`を合計して10個。attributeは10個まで。
{% endhint %}

{% hint style="warning" %}
メタデータは指定した内容で上書きされます。(作成時のメタデータを上書きします)
{% endhint %}

## **file\_fields** <a href="#file-fields" id="file-fields"></a>

`file_fields`は`key`, `url`のペアの配列です。

<table><thead><tr><th width="139">パラメータ</th><th width="76">種類</th><th width="75">必須</th><th width="397.12109375">詳細</th></tr></thead><tbody><tr><td>key</td><td>str</td><td>Yes</td><td>メタデータのkey。<code>image</code> または <code>animation_url</code> のどちらかを指定。 <code>image</code> は1つ以上必須。</td></tr><tr><td>url</td><td>str</td><td>Yes</td><td>画像または動画のURL</td></tr></tbody></table>

## attribute <a href="#attribute" id="attribute"></a>

`attribute`は`tag`,`value`のペアの配列です。

<table><thead><tr><th width="139">パラメータ</th><th width="76">種類</th><th width="75">必須</th><th width="280">詳細</th></tr></thead><tbody><tr><td>tag</td><td>str</td><td>Yes</td><td>プロパティのタグ</td></tr><tr><td>value</td><td>str</td><td>Yes</td><td>プロパティの値</td></tr></tbody></table>

{% hint style="info" %}
URLに指定したファイルがIPFSなどのストレージにアップロードされます。
{% endhint %}

## **リクエストのサンプル** <a href="#sample" id="sample"></a>

```json
{
  "nft_gdn_id": "cf7faf94-a5ec-462c-ad06-1bd772fefe21",
  "contract_address": "0x0000000000000000000000000000000000000000",
  "metadata": [
    {
      "title": "NFT Name1 new",
      "description": "Description of NFT1 new",
      "file_fields": [
        {
          "key": "image",
          "url": "https://my.nftgarden.app/image_new.png"
        }
      ],
      "attribute": [
        {
          "tag": "color",
          "value": "Blue"
        },
        {
          "tag": "price",
          "value": "20000"
        }
      ]
    }
  ]
}
```

## **成功した場合のレスポンス例** <a href="#response" id="response"></a>

```json
{
  "message": "Create NFT request accepted",
  "requests": {
    "contract_address": "0x0000000000000000000000000000000000000000",
    "nft_gdn_id": "cf7faf94-a5ec-462c-ad06-1bd772fefe21",
    "metadata": [
      {
        "title": "NFT Name1 new",
        "description": "Description of NFT1 new",
        "file_fields": [
          {
            "key": "image",
            "url": "https://my.nftgarden.app/image_new.png"
          }
        ],
      "attribute": [
          {
            "tag": "color",
            "value": "Blue"
          },
          {
            "tag": "price",
            "value": "20000"
          }
        ]
      }
    ]
  },
  "nfts": [
    {
      "nft_gdn_ids": "cf7faf94-a5ec-462c-ad06-1bd772fefe21",
      "accepted_date": "2025-05-04 07:49:31"
    }
  ]
}
```

## **失敗した場合のレスポンス例(ステータスコード400)** <a href="#error" id="error"></a>

```json
{
  "error": {
    "title": "Bad Request",
    "message": "contract_address and blockchain are inconsistent"
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nftgarden.app/jp/api/nft-api/v1.2/update-dnft.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
