Batch Mint NFTs
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 '
{
"nfts": [
{
"recipient": "email:testy@crossmint.com:polygon",
"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>"
}
]
},
"compressed": true,
"id": "<string>"
}
]
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/"
payload = { "nfts": [
{
"recipient": "email:testy@crossmint.com:polygon",
"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>"
}
]
},
"compressed": True,
"id": "<string>"
}
] }
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({
nfts: [
{
recipient: 'email:testy@crossmint.com:polygon',
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>'}]
},
compressed: true,
id: '<string>'
}
]
})
};
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([
'nfts' => [
[
'recipient' => 'email:testy@crossmint.com:polygon',
'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>'
]
]
],
'compressed' => true,
'id' => '<string>'
]
]
]),
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 \"nfts\": [\n {\n \"recipient\": \"email:testy@crossmint.com:polygon\",\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 \"compressed\": true,\n \"id\": \"<string>\"\n }\n ]\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 \"nfts\": [\n {\n \"recipient\": \"email:testy@crossmint.com:polygon\",\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 \"compressed\": true,\n \"id\": \"<string>\"\n }\n ]\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 \"nfts\": [\n {\n \"recipient\": \"email:testy@crossmint.com:polygon\",\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 \"compressed\": true,\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"onChain": {
"status": "<string>",
"chain": "<string>",
"contractAddress": "<string>",
"subscription": {
"expiresAt": "2023-11-07T05:31:56Z"
}
},
"actionId": "<string>"
}
]
}{
"error": true,
"message": "<string>",
"validationErrors": [
{
"index": 123,
"id": "<string>",
"message": "<string>"
}
]
}{
"error": true,
"message": "<string>"
}{
"error": true,
"message": "<string>"
}Batch Mint NFTs
Mint multiple NFTs with a single call and deliver them to a web3 wallet or an email address
API scope required nfts.create
POST
/
2022-06-09
/
collections
/
{collectionId}
/
nfts
/
Batch Mint NFTs
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 '
{
"nfts": [
{
"recipient": "email:testy@crossmint.com:polygon",
"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>"
}
]
},
"compressed": true,
"id": "<string>"
}
]
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/nfts/"
payload = { "nfts": [
{
"recipient": "email:testy@crossmint.com:polygon",
"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>"
}
]
},
"compressed": True,
"id": "<string>"
}
] }
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({
nfts: [
{
recipient: 'email:testy@crossmint.com:polygon',
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>'}]
},
compressed: true,
id: '<string>'
}
]
})
};
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([
'nfts' => [
[
'recipient' => 'email:testy@crossmint.com:polygon',
'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>'
]
]
],
'compressed' => true,
'id' => '<string>'
]
]
]),
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 \"nfts\": [\n {\n \"recipient\": \"email:testy@crossmint.com:polygon\",\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 \"compressed\": true,\n \"id\": \"<string>\"\n }\n ]\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 \"nfts\": [\n {\n \"recipient\": \"email:testy@crossmint.com:polygon\",\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 \"compressed\": true,\n \"id\": \"<string>\"\n }\n ]\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 \"nfts\": [\n {\n \"recipient\": \"email:testy@crossmint.com:polygon\",\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 \"compressed\": true,\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "<string>",
"onChain": {
"status": "<string>",
"chain": "<string>",
"contractAddress": "<string>",
"subscription": {
"expiresAt": "2023-11-07T05:31:56Z"
}
},
"actionId": "<string>"
}
]
}{
"error": true,
"message": "<string>",
"validationErrors": [
{
"index": 123,
"id": "<string>",
"message": "<string>"
}
]
}{
"error": true,
"message": "<string>"
}{
"error": true,
"message": "<string>"
}Enterprise feature. Contact us for access.
The recommended batch size is 125 NFTs or less per request.
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
application/json
Array of objects describing the NFTs to mint to recipients.
Show child attributes
Show child attributes
Response
Success.
Show child attributes
Show child attributes
Was this page helpful?
⌘I

