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": [
{
"trait_type": "<string>",
"value": "<string>"
}
]
},
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": true,
"locale": "en-US",
"reuploadLinkedFiles": true,
"compressed": true
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}"
payload = {
"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": [
{
"trait_type": "<string>",
"value": "<string>"
}
]
},
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": True,
"locale": "en-US",
"reuploadLinkedFiles": True,
"compressed": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: [{trait_type: '<string>', value: '<string>'}]
},
recipient: 'email:testy@crossmint.com:polygon',
sendNotification: true,
locale: 'en-US',
reuploadLinkedFiles: true,
compressed: true
})
};
fetch('https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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' => [
[
'trait_type' => '<string>',
'value' => '<string>'
]
]
],
'recipient' => 'email:testy@crossmint.com:polygon',
'sendNotification' => true,
'locale' => 'en-US',
'reuploadLinkedFiles' => true,
'compressed' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"Crossmint Example NFT\",\n \"image\": \"https://www.crossmint.com/assets/crossmint/logo.png\",\n \"description\": \"My NFT created via the mint API!\",\n \"animation_url\": \"\",\n \"attributes\": [\n {\n \"trait_type\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"reuploadLinkedFiles\": true,\n \"compressed\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"Crossmint Example NFT\",\n \"image\": \"https://www.crossmint.com/assets/crossmint/logo.png\",\n \"description\": \"My NFT created via the mint API!\",\n \"animation_url\": \"\",\n \"attributes\": [\n {\n \"trait_type\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"reuploadLinkedFiles\": true,\n \"compressed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"Crossmint Example NFT\",\n \"image\": \"https://www.crossmint.com/assets/crossmint/logo.png\",\n \"description\": \"My NFT created via the mint API!\",\n \"animation_url\": \"\",\n \"attributes\": [\n {\n \"trait_type\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"reuploadLinkedFiles\": true,\n \"compressed\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "a9c57776-8f0c-4dfc-8a81-06909439234e",
"onChain": {
"status": "pending",
"chain": "polygon",
"contractAddress": "0xe7Ad5c85B14b5bedc6911c148cfbB52B2744531E"
},
"actionId": "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
{
"id": "a9c57776-8f0c-4dfc-8a81-06909439234e",
"onChain": {
"status": "pending",
"chain": "solana"
},
"actionId": "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
{
"error": true,
"message": "Empty parameter <missing parameter>"
}
{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}
{
"error": true,
"message": "Collection <collectionId> not found"
}
{
"error": true,
"message": "Please try again in a few minutes. If the issue still persists, contact Crossmint support."
}
Mint NFT with ID
This pathway allows you to mint NFTs and guarantee idempotency to ensure you never double mint for the same NFT.
API scope required: nfts.create
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": [
{
"trait_type": "<string>",
"value": "<string>"
}
]
},
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": true,
"locale": "en-US",
"reuploadLinkedFiles": true,
"compressed": true
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}"
payload = {
"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": [
{
"trait_type": "<string>",
"value": "<string>"
}
]
},
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": True,
"locale": "en-US",
"reuploadLinkedFiles": True,
"compressed": True
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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: [{trait_type: '<string>', value: '<string>'}]
},
recipient: 'email:testy@crossmint.com:polygon',
sendNotification: true,
locale: 'en-US',
reuploadLinkedFiles: true,
compressed: true
})
};
fetch('https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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' => [
[
'trait_type' => '<string>',
'value' => '<string>'
]
]
],
'recipient' => 'email:testy@crossmint.com:polygon',
'sendNotification' => true,
'locale' => 'en-US',
'reuploadLinkedFiles' => true,
'compressed' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}"
payload := strings.NewReader("{\n \"metadata\": {\n \"name\": \"Crossmint Example NFT\",\n \"image\": \"https://www.crossmint.com/assets/crossmint/logo.png\",\n \"description\": \"My NFT created via the mint API!\",\n \"animation_url\": \"\",\n \"attributes\": [\n {\n \"trait_type\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"reuploadLinkedFiles\": true,\n \"compressed\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"Crossmint Example NFT\",\n \"image\": \"https://www.crossmint.com/assets/crossmint/logo.png\",\n \"description\": \"My NFT created via the mint API!\",\n \"animation_url\": \"\",\n \"attributes\": [\n {\n \"trait_type\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"reuploadLinkedFiles\": true,\n \"compressed\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metadata\": {\n \"name\": \"Crossmint Example NFT\",\n \"image\": \"https://www.crossmint.com/assets/crossmint/logo.png\",\n \"description\": \"My NFT created via the mint API!\",\n \"animation_url\": \"\",\n \"attributes\": [\n {\n \"trait_type\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"reuploadLinkedFiles\": true,\n \"compressed\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "a9c57776-8f0c-4dfc-8a81-06909439234e",
"onChain": {
"status": "pending",
"chain": "polygon",
"contractAddress": "0xe7Ad5c85B14b5bedc6911c148cfbB52B2744531E"
},
"actionId": "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
{
"id": "a9c57776-8f0c-4dfc-8a81-06909439234e",
"onChain": {
"status": "pending",
"chain": "solana"
},
"actionId": "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
{
"error": true,
"message": "Empty parameter <missing parameter>"
}
{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}
{
"error": true,
"message": "Collection <collectionId> not found"
}
{
"error": true,
"message": "Please try again in a few minutes. If the issue still persists, contact Crossmint support."
}
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
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>"
}
{
"id": "<string>",
"metadata": {
"name": "<string>",
"symbol": "<string>",
"description": "<string>",
"seller_fee_basis_points": 0,
"image": "<string>",
"attributes": [],
"properties": {}
},
"onChain": {
"status": "success",
"mintHash": "<string>",
"txId": "<string>",
"owner": "<string>",
"chain": "solana"
},
"actionId": "<string>"
}
{
"id": "a9c57776-8f0c-4dfc-8a81-06909439234e",
"onChain": {
"status": "pending",
"chain": "polygon",
"contractAddress": "0xe7Ad5c85B14b5bedc6911c148cfbB52B2744531E"
},
"actionId": "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
{
"id": "a9c57776-8f0c-4dfc-8a81-06909439234e",
"onChain": {
"status": "pending",
"chain": "solana"
},
"actionId": "a9c57776-8f0c-4dfc-8a81-06909439234e"
}
{
"error": true,
"message": "Empty parameter <missing parameter>"
}
{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}
{
"error": true,
"message": "Collection <collectionId> not found"
}
{
"error": true,
"message": "Please try again in a few minutes. If the issue still persists, contact Crossmint support."
}
Authorizations
Obtained in the Crossmint developer console
Path Parameters
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 initial request.
Example: your-custom-identifier
Custom ID of the NFT, which is used as an idempotency key
"my-idempotency-key"
Body
Allowed formats:
<chain>:<address> or
email:<email_address>:<chain> or
userId:<userId>:<chain> or
twitter:<twitter_handle>:<chain>
"email:testy@crossmint.com:polygon"
Notify recipient via email notification about successful mint [Default: true]. For legacy projects created before Sep 16, 2024, this is set to false by default.
Specify the locale for the email content [Default: en-US]
"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]
Was this page helpful?

