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
Parameter | Description |
---|---|
HM_ACCESS_KEY | HyperMint Access Key |
HM_ACCESS_KEY_SECRET | HyperMint Access Key Secret |
Body
Parameter | Type | Required | Description |
---|---|---|---|
name | string | N | The name of the token |
description | string | N | The description of the token |
image | string | N | Can use a prehosted image url if not use the upload token metadata media endpoint |
external_url | string | N | external url usually is a website link |
background_color | string | N | Background color to add |
animation_url | string | N | Can use a prehosted animation url if not use the upload token metadata media endpoint |
youtube_url | string | N | A url linking to a youtube video |
attributes | string | N | An array of metadata attributes object, see MetadataAttribute interface in the request interface section below for more details |
Response
Code | Meaning |
---|---|
🟢 200: OK | If the contract has been deployed, an interactionId will be returned which allows you to check the status of the request. |
🟠 404: Not Found | Contract does not exist or you don't have permission |
🟠 404: Bad Request | The 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.
Updated 8 months ago