For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a Collection

Create a Collection

post

This endpoint allows you to create a new Collection.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
namestringRequired

Name for you NFT Collection

descriptionstringRequired

Description for your NFT Collection

imagestringRequired

URL pointing to an image for your NFT Collection

Responses
202Success
application/json
transactionIdstringRequired

Transaction ID that identifies the Transaction generated by an API request

mintAddressstringRequired

Address for the NFT's or token's mint account

Example: EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDpPattern: ^[A-HJ-NP-Za-km-z1-9]*$
post/v1/collections
POST /v1/collections HTTP/1.1
Host: api.underdogprotocol.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 110

{
  "name": "text",
  "description": "text",
  "image": "text",
  "attributes": {
    "Overall": "0",
    "Clout": "0",
    "Credibility": "0"
  }
}
{
  "transactionId": "text",
  "mintAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
}

Example

curl -X POST \
        --url https://api.underdogprotocol.com/v1/collections \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer {token}" \
        -d '
{
        "name": "Underdog Protocol",
	"description": "Underdog Protocol Collection",
        "image": "https://underdogprotocol.com/logo-dark.svg"
}'
import axios from 'axios';

const createCollection = async () => {
  try {
    const response = await axios.post('https://api.underdogprotocol.com/v1/collections', {
      name: 'Underdog Protocol',
      description: 'Underdog Protocol Collection',
      image: 'https://underdogprotocol.com/logo-dark.svg'
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }
    });

    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Last updated