curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"templateId": "silver-pass",
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": true,
"locale": "en-US",
"amount": 10
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts"
payload = {
"templateId": "silver-pass",
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": True,
"locale": "en-US",
"amount": 10
}
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({
templateId: 'silver-pass',
recipient: 'email:testy@crossmint.com:polygon',
sendNotification: true,
locale: 'en-US',
amount: 10
})
};
fetch('https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts', 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}/sfts",
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([
'templateId' => 'silver-pass',
'recipient' => 'email:testy@crossmint.com:polygon',
'sendNotification' => true,
'locale' => 'en-US',
'amount' => 10
]),
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}/sfts"
payload := strings.NewReader("{\n \"templateId\": \"silver-pass\",\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"amount\": 10\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}/sfts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"silver-pass\",\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"amount\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts")
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 \"templateId\": \"silver-pass\",\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"amount\": 10\n}"
response = http.request(request)
puts response.read_body{
"actionId": "a91c15e3-60f2-4a45-bf1a-cee508981667",
"action": "nfts.create",
"status": "pending",
"data": {
"chain": "polygon",
"collection": {
"id": "84e3d617-9c1b-4e7a-9686-522a9ea7c520",
"contractAddress": "0x9b8ab8949bd7E73E61945b88F7fe12151f98ad3C"
},
"recipient": {
"walletAddress": "0xcFDc00Cf926A5053f9Cdf004e6DF17e6dEB2E146",
"email": "testy@crossmint.com"
},
"token": {
"id": "a91c15e3-60f2-4a45-bf1a-cee508981667"
}
},
"startedAt": "2024-01-02T22:05:01.000Z",
"resource": "https://staging.crossmint.com/api/2022-06-09/actions/a91c15e3-60f2-4a45-bf1a-cee508981667"
}{
"error": true,
"message": "Invalid arguments or empty parameter <missing parameter>."
}{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}{
"error": true,
"message": "Not found"
}{
"error": true,
"message": "Please try again in a few minutes. If the issue still persists, contact Crossmint support."
}Mint SFT
Mint your SFTs 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}/sfts \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"templateId": "silver-pass",
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": true,
"locale": "en-US",
"amount": 10
}
'import requests
url = "https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts"
payload = {
"templateId": "silver-pass",
"recipient": "email:testy@crossmint.com:polygon",
"sendNotification": True,
"locale": "en-US",
"amount": 10
}
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({
templateId: 'silver-pass',
recipient: 'email:testy@crossmint.com:polygon',
sendNotification: true,
locale: 'en-US',
amount: 10
})
};
fetch('https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts', 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}/sfts",
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([
'templateId' => 'silver-pass',
'recipient' => 'email:testy@crossmint.com:polygon',
'sendNotification' => true,
'locale' => 'en-US',
'amount' => 10
]),
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}/sfts"
payload := strings.NewReader("{\n \"templateId\": \"silver-pass\",\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"amount\": 10\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}/sfts")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"templateId\": \"silver-pass\",\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"amount\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.crossmint.com/api/2022-06-09/collections/{collectionId}/sfts")
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 \"templateId\": \"silver-pass\",\n \"recipient\": \"email:testy@crossmint.com:polygon\",\n \"sendNotification\": true,\n \"locale\": \"en-US\",\n \"amount\": 10\n}"
response = http.request(request)
puts response.read_body{
"actionId": "a91c15e3-60f2-4a45-bf1a-cee508981667",
"action": "nfts.create",
"status": "pending",
"data": {
"chain": "polygon",
"collection": {
"id": "84e3d617-9c1b-4e7a-9686-522a9ea7c520",
"contractAddress": "0x9b8ab8949bd7E73E61945b88F7fe12151f98ad3C"
},
"recipient": {
"walletAddress": "0xcFDc00Cf926A5053f9Cdf004e6DF17e6dEB2E146",
"email": "testy@crossmint.com"
},
"token": {
"id": "a91c15e3-60f2-4a45-bf1a-cee508981667"
}
},
"startedAt": "2024-01-02T22:05:01.000Z",
"resource": "https://staging.crossmint.com/api/2022-06-09/actions/a91c15e3-60f2-4a45-bf1a-cee508981667"
}{
"error": true,
"message": "Invalid arguments or empty parameter <missing parameter>."
}{
"error": true,
"message": "Malformed API key. / API key provided doesn't have required scopes."
}{
"error": true,
"message": "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
Headers
Unique identifier to prevent duplicate requests
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 intitial request.
Example: your-custom-identifer
Body
Identifier of the template
"silver-pass"
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]. Learn how this applies to legacy projects.
Specify the locale for the email content [Default: en-US]
"en-US"
(Optional) Amount to mint
10
Response
Success
"a91c15e3-60f2-4a45-bf1a-cee508981667"
"nfts.create"
"pending"
Show child attributes
Show child attributes
"2024-01-02T22:05:01.000Z"
"https://staging.crossmint.com/api/2022-06-09/actions/a91c15e3-60f2-4a45-bf1a-cee508981667"
Was this page helpful?

