Underdog Protocol
  • API Documentation
  • Quickstart
  • Guides
    • Postman
    • Endpoints
    • Authentication
    • Pagination
    • Errors
    • Webhooks
    • Architecture
  • Resources
    • Projects
      • Transferable Projects
      • Non-Transferable Projects
      • NFTs
        • List all NFTs
        • Search NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
        • Generate Claim Link
        • Revoke an NFT
        • Burn an NFT
      • Methods
        • List all Projects
        • Create a Project
        • Retrieve a Project
        • Update a Project
        • Retrieve Project Stats
    • NFTs
      • Retrieve an NFT
      • Generate Claim Transaction
    • Orgs
      • List all Orgs
    • Transactions
      • List all Transactions
      • Retrieve a Transaction
    • Webhooks
      • List all Webhooks
      • Create a Webhook
      • Delete a Webhook
    • V1
      • Collections
        • List all Collections
        • Create a Collection
        • Retrieve a Collection
      • NFTs
        • List all NFTs
        • Create an NFT
        • Retrieve an NFT
        • Update an NFT
      • Managed NFTs
        • Claim
        • Revoke
  • Examples
    • Zapier Integrations
      • Zapier + Viral Loops
      • Zapier + Github + OpenAI
      • Zapier + Github
      • Zapier + Mailchimp
      • Zapier + Shopify
      • Zapier + Calendly
      • Zapier + Hubspot
      • Zapier + Typeform
    • Underdog with Airtable
      • Create a Project
      • Create NFT on Form Submission
      • Send a Claim Link
      • Updating NFTs
    • Web3 Blog
    • Mint NFTs on iPhone
  • Use Cases
    • Solana Mobile
    • Parcl
Powered by GitBook
On this page
  1. Resources
  2. V1
  3. NFTs

Update an NFT

PreviousRetrieve an NFTNextManaged NFTs

Last updated 2 years ago

There are two API methods to update an NFT.

  • PATCH allows for partial updates so you can just pass in the image or the attribute you want to update

  • PUT requires the full NFT metadata to be passed in and updates the full metadata

If you just want to make a change to a single attribute or just update the image, the PATCH endpoint should be sufficient.

If you are trying to remove attributes, you'll need to use the PUT endpoint to pass in the new attribute body.

Partial Update an NFT

Example

curl -X PATCH \
      --url https://api.underdogprotocol.com/v1/nfts/7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer {token}" \
      -d '
{
  "attributes": {
    "best player": "Tyrese Haliburton"
  }
}'
import axios from 'axios';

const mintAddress = '7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB';

const partialUpdateNft = async () => {
  try {
    const response = await axios.patch(`https://api.underdogprotocol.com/v1/nfts/${mintAddress}`, {
      attributes: {
        'best player': 'Tyrese Haliburton'
      }
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }
    });

    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Update an NFT

Example

curl -X PUT \
      --url https://api.underdogprotocol.com/v1/nfts/7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer {token}" \
      -d '
{
  "name": "Sacramento Kings",
  "description": "",
  "image": "https://arweave.net/U0PFVZ_LszARt7OgfSiLl--OrRmczn0cNAjw4tYerVQ",
  "attributes": {
    "best player": "Tyrese Haliburton"
  }
}'
import axios from 'axios';

const mintAddress = '7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB';

const updateNft = async () => {
  try {
    const response = await axios.put(`https://api.underdogprotocol.com/v1/nfts/${mintAddress}`, {
      name: 'Sacramento Kings',
      description: '',
      image: 'https://arweave.net/U0PFVZ_LszARt7OgfSiLl--OrRmczn0cNAjw4tYerVQ',
      attributes: {
        'best player': 'Tyrese Haliburton'
      }
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }
    });

    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}
  • Partial Update an NFT
  • PUTUpdate an NFT
  • Example
  • Update an NFT
  • PATCHPartial update an NFT
  • Example

Update an NFT

put

This endpoint allows you to perform an update on an NFT.

Authorizations
Path parameters
mintAddressstringRequired

Address for the NFT's or token's mint account

Example: EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDpPattern: ^[A-HJ-NP-Za-km-z1-9]*$
Body
descriptionstringOptional

Description stored in the metadata

Example: This is my first NFT
imagestringRequired

Image URL for your NFT

Example: https://example.com/image.png
Responses
200
Returns an Updated NFT
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
put
PUT /v1/nfts/:mintAddress HTTP/1.1
Host: api.underdogprotocol.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 130

{
  "description": "This is my first NFT",
  "image": "https://example.com/image.png",
  "attributes": {
    "Points": "40000",
    "Nickname": "LeGoat"
  }
}
{
  "name": "NFT #1",
  "symbol": "NFT",
  "description": "This is my first NFT",
  "image": "https://example.com/image.png",
  "animationUrl": "https://example.com/animation.mp4",
  "attributes": {
    "Points": "40000",
    "Nickname": "LeGoat"
  },
  "id": 1,
  "projectId": 1,
  "transferable": true,
  "mintAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "ownerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "claimerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "status": "text"
}

Partial update an NFT

patch

This endpoint allows you to perform a partial update on an NFT.

Authorizations
Path parameters
mintAddressstringRequired

Address for the NFT's or token's mint account

Example: EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDpPattern: ^[A-HJ-NP-Za-km-z1-9]*$
Body
descriptionstringOptional

Description stored in the metadata

Example: This is my first NFT
imagestringOptional

Image URL for your NFT

Example: https://example.com/image.png
Responses
200
Returns an Updated NFT
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not Found
application/json
patch
PATCH /v1/nfts/:mintAddress HTTP/1.1
Host: api.underdogprotocol.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 130

{
  "description": "This is my first NFT",
  "image": "https://example.com/image.png",
  "attributes": {
    "Points": "40000",
    "Nickname": "LeGoat"
  }
}
{
  "name": "NFT #1",
  "symbol": "NFT",
  "description": "This is my first NFT",
  "image": "https://example.com/image.png",
  "animationUrl": "https://example.com/animation.mp4",
  "attributes": {
    "Points": "40000",
    "Nickname": "LeGoat"
  },
  "id": 1,
  "projectId": 1,
  "transferable": true,
  "mintAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "ownerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "claimerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "status": "text"
}