curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts \
--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"
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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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"
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("POST", 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.post("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts")
.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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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
Mint your NFTs and deliver them to a web3 wallet or an email address
API scope required: nfts.create
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts \
--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"
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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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"
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("POST", 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.post("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts")
.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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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": "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
Body
- Metadata
- Template Id
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?

