PATCH: Set Token Hosted Metadata

If you have chosen to host metadata on the HyperMint servers, metadata for a token can be set via this endpoint.

https://api.hypermint.com/v1/nft-contract/:contractId/token/:tokenId/metadata

Set HyperMint Hosted Metadata

All properties need to be sent with the request body. Properties that are not sent when using this endpoint will set those properties to null. Token id in the request is the integer token id on the network found in the UI or returned as part of contract information/when adding new tokens. I.E token id 1, 2, 1000, etc..

Parameters

Header

ParameterDescription
HM_ACCESS_KEYHyperMint Access Key
HM_ACCESS_KEY_SECRETHyperMint Access Key Secret

Body

ParameterTypeRequiredDescription
namestringNThe name of the token
descriptionstringNThe description of the token
imagestringNCan use a prehosted image url if not use the upload token metadata media endpoint
external_urlstringNexternal url usually is a website link
background_colorstringNBackground color to add
animation_urlstringNCan use a prehosted animation url if not use the upload token metadata media endpoint
youtube_urlstringNA url linking to a youtube video
attributesstringNAn array of metadata attributes object, see MetadataAttribute interface in the request interface section below for more details

Response

CodeMeaning
🟒 200: OKIf the contract has been deployed, an interactionId will be returned which allows you to check the status of the request.
🟠 404: Not FoundContract does not exist or you don't have permission
🟠 404: Bad RequestThe token does not exist
interface SetMetadataResponse {
    success: boolean;
}

Request Interface

interface Metadata {
    name?: string;
    description?: string;
    image?: string;
    background_color?: string;
    animation_url?: string;
    youtube_url?: string;
    attributes?: MetadataAttribute[];
}

export interface MetadataAttribute {
    trait_type?: string;
    value?: string;
    display_type?: string;
}

Feedback

Something not quite right, unclear or can't find what you are looking for? Please let us know at support.moonpay.com and we will get back to you as soon as we can.