cURL
Python
JavaScript
PHP
Go
Java
curl --request PUT \
--url https://staging.crossmint.com/api/2022-06-09/collections/{ collectionId} /nfts/{ id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '{
"metadata": {
"name": "Crossmint Example NFT",
"image": "https://www.crossmint.com/assets/crossmint/logo.png",
"description": "My NFT created via the mint API!",
"animation_url": "",
"attributes": [
{
"display_type": "boost_number",
"trait_type": "<string>",
"value": "<string>"
}
]
},
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": true,
"locale": "en-US",
"reuploadLinkedFiles": true,
"compressed": true
}'
200 EVM
200 Solana
400
403
404
503
{
"id" : "a9c57776-8f0c-4dfc-8a81-06909439234e" ,
"onChain" : {
"status" : "pending" ,
"chain" : "polygon" ,
"contractAddress" : "0xe7Ad5c85B14b5bedc6911c148cfbB52B2744531E"
} ,
"actionId" : "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
Subsequent reqeuests to this endpoint with the same id
in the path will not mint additional NFTs.
Furthermore, the success responses (with status code 200) will be different once the initial request has completed and includes the metadata for the minted NFT.
200 response examples for subsequent requests
{
"id" : "<string>" ,
"metadata" : {
"name" : "<string>" ,
"image" : "<string>" ,
"description" : "<string>"
} ,
"onChain" : {
"status" : "<string>" ,
"tokenId" : "<string>" ,
"owner" : "<string>" ,
"txId" : "<string>" ,
"contractAddress" : "<string>" ,
"chain" : "<string>"
} ,
"actionId" : "<string>"
}
200 EVM
200 Solana
400
403
404
503
{
"id" : "a9c57776-8f0c-4dfc-8a81-06909439234e" ,
"onChain" : {
"status" : "pending" ,
"chain" : "polygon" ,
"contractAddress" : "0xe7Ad5c85B14b5bedc6911c148cfbB52B2744531E"
} ,
"actionId" : "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
Obtained in the Crossmint developer console
This is the identifier for the collection related to the request. Every project has default collections: default-solana
and default-polygon
.
The create-collection API will result in collections with UUID formatted collectionId
.
Example: 9c82ef99-617f-497d-9abb-fd355291681b
The create-collection-idempotent API allows you to specify an arbitrary identifier during the intitial request.
Example: your-custom-identifer
Custom ID of the NFT, which is used as an idempotency key
metadata
[EVM] Metadata Object · object [EVM] Metadata URL · string [Solana] Metadata Object · object [Solana] Metadata URL · object
required
The name of your NFT (Max length: 32)
Maximum length: 32
Direct link to your NFT image
Example: "https://www.crossmint.com/assets/crossmint/logo.png"
A brief description of the NFT (Max length: 64)
Maximum length: 64
Example: "My NFT created via the mint API!"
Add attributes to your NFT
metadata.attributes. trait_type
metadata.attributes. value
metadata.attributes. display_type
Display name of your attribute
Available options:
boost_number
,
boost_percentage
,
number
Allowed formats:
<chain>:<address>
or
email:<email_address>:<chain>
or
userId:<userId>:<chain>
or
twitter:<twitter_handle>:<chain>
see here for more info
Example: "email:testy@crossmint.com:polygon"
Notify recipient via email notification about successful mint [Default: true]. Learn how this applies to legacy projects .
Specify the locale for the email content [Default: en-US]
Any URLs in the metadata object will be resolved and reuploaded to IPFS [Default: true]
Solana only Use NFT compression for cheaper mint costs [Default: true]
The request has been accepted.
Option 1 Option 2 Option 3 Option 4