# API Documentation

Use the Underdog API to manage NFT Projects, mint transferable & non-transferable NFTs, and seamlessly integrate web3 into your product and workflows.

{% content-ref url="/pages/Vm01YxK5h9uhkZyhah1C" %}
[Quickstart](/quickstart)
{% endcontent-ref %}

## Getting Started

To get started, create a new Project in the [Underdog Protocol Dashboard](https://app.underdogprotocol.com). Then read about how to make requests for the resources you need using our API.

[Get your API Key ->](https://app.underdogprotocol.com)

## API Endpoints

The Underdog API supports Solana Mainnet-Beta and Solana Devnet. We recommend testing your implementation with our Devnet endpoint before moving to production. The Devnet endpoint is free to use while the Mainnet endpoint requires a subscription.&#x20;

<table><thead><tr><th width="175">Network</th><th>API URL </th></tr></thead><tbody><tr><td>Solana Mainnet</td><td><code>https://api.underdogprotocol.com</code></td></tr><tr><td>Solana Devnet</td><td><code>https://dev.underdogprotocol.com</code></td></tr></tbody></table>

[Read More -> ](/guides/endpoints)

## Postman

If you'd like to test out our API endpoints using Postman, you can do so at our public [Underdog API workspace](https://www.postman.com/underdogprotocol/workspace/underdog-api/overview).  There are both Devnet and Mainnet API collections within Postman.&#x20;

To go in more depth on how to get started with our Postman workspace, follow the guide below.&#x20;

{% content-ref url="/pages/iqTaS887qSXQqnMRd4EG" %}
[Postman](/guides/postman)
{% endcontent-ref %}

## Guides

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Authentication</strong></td><td>Learn how to authenticate your API requests. </td><td><a href="/pages/56GBZzRr4UBtfMM3GfxK">Read more -></a> </td><td><a href="/pages/56GBZzRr4UBtfMM3GfxK">/pages/56GBZzRr4UBtfMM3GfxK</a></td></tr><tr><td><strong>Pagination</strong></td><td>Understand how to work with paginated responses. </td><td><a href="/pages/XQx4BYq4KQiNEqo2m2mj">Read more -></a></td><td><a href="/pages/XQx4BYq4KQiNEqo2m2mj">/pages/XQx4BYq4KQiNEqo2m2mj</a></td></tr><tr><td><strong>Webhooks</strong></td><td>Learn how to programmatically configure webhooks for your app. </td><td><a href="/pages/CZfD0g62XgPmSQV2rhEd">Read more -> </a></td><td><a href="/pages/CZfD0g62XgPmSQV2rhEd">/pages/CZfD0g62XgPmSQV2rhEd</a></td></tr><tr><td><strong>Errors</strong></td><td>Read about the different types of errors returned by the API.</td><td><a href="/pages/SSE9Lrnsou2UwAi2AVlt">Read more -></a></td><td><a href="/pages/SSE9Lrnsou2UwAi2AVlt">/pages/SSE9Lrnsou2UwAi2AVlt</a></td></tr></tbody></table>

## Resources

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Projects</strong></td><td></td><td></td><td><a href="/pages/W5YHbp7vh9PK0BdOLaM4">/pages/W5YHbp7vh9PK0BdOLaM4</a></td></tr><tr><td><strong>NFTs</strong></td><td></td><td></td><td><a href="/pages/sDCuvqcsO3HDgnaZaQCm">/pages/sDCuvqcsO3HDgnaZaQCm</a></td></tr><tr><td><strong>Transactions</strong></td><td></td><td></td><td><a href="/pages/GZY8GcJel6ofFtLXD5LF">/pages/GZY8GcJel6ofFtLXD5LF</a></td></tr></tbody></table>


# Quickstart

This guide will get you all set up and ready to use the Underdog API. We'll cover how to get started using one of our API clients and how to make your first API request.

We'll also look at where to go next to find all the information you need to take full advantage of everything the Underdog API can do.&#x20;

{% hint style="info" %}
Before you can make requests to the Underdog API, you will need to grab your API Key from your [dashboard](https://app.underdogprotocol.com).
{% endhint %}

## Making your first API request

Below, you can see how to send a POST request to the Projects endpoint to create your first Collection.&#x20;

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST \
        --url https://dev.underdogprotocol.com/v2/projects \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer {token}" \
        -d '
{
        "name": "Underdog Project",
        "transferable": true,
	"description": "My Underdog NFT Project",
        "image": "https://underdogprotocol.com/logo-dark.svg"
}'
```

{% endtab %}
{% endtabs %}

[Read the docs for the Project endpoint ->](/resources/projects)

## What's next?

You're now set up with an API client and have made your first request to the API. Here are a few links that might be handy as you venture further into the Underdog API:

* [Grab your API Key from the Underdog Dashboard](https://app.underdogprotocol.com)
* [Mint your first NFT in the Project](/resources/projects/nfts)


# Guides


# Postman

You can use the Underdog API Postman to test your Devnet and Mainnet implementations

<figure><img src="/files/GbAL7TN0dMADMGk8DCPy" alt=""><figcaption><p>Overview page for the Underdog API Postman</p></figcaption></figure>

{% hint style="warning" %}
Follow this link to view the [Underdog API Postman](https://www.postman.com/underdogprotocol/workspace/underdog-api/overview)
{% endhint %}

When you head over to the [Underdog API Postman](https://www.postman.com/underdogprotocol/workspace/underdog-api/overview), you'll hit an overview page with recent activity to the Postman workspace. We'll continue making updates to the workspace as API functionality grows.&#x20;

## Getting Started

On the left hand side, click the desired API endpoint: **Mainnet API** or **Devnet API**. Within the collection page, hit the **Variables** tab to set the `apiKey` variable in your workspace.&#x20;

Your API Key can be generated from the Underdog Protocol dashboard when you sign in.&#x20;

<figure><img src="/files/3tkPolWIAhgdi9TLOzBn" alt=""><figcaption><p>Where you can set the apiKey variable in Postman</p></figcaption></figure>

{% hint style="info" %}
The Devnet API is free to use and the same API Key you generate can be used for both endpoints. You will need a subscription to use the Mainnet API.&#x20;
{% endhint %}


# Endpoints

The Underdog API supports both Solana Mainnet-Beta and Solana Devnet through its two API endpoints

The Underdog API supports Solana Mainnet-Beta and Solana Devnet. We recommend testing your implementation with our Devnet endpoint before moving to production. The Devnet endpoint is free to use while the Mainnet endpoint requires a subscription.&#x20;

<table><thead><tr><th width="175">Network</th><th>API URL </th></tr></thead><tbody><tr><td>Solana Mainnet</td><td><code>https://api.underdogprotocol.com</code></td></tr><tr><td>Solana Devnet</td><td><code>https://dev.underdogprotocol.com</code></td></tr></tbody></table>

The examples in the documentation will use the Devnet API.&#x20;


# Authentication

You'll need to authenticate your requests to access any of the endpoints in the Underdog API. In this guide, we'll look at how authentication works.

Underdog uses OAuth2 with a token to authenticate API requests.&#x20;

## OAuth2 with bearer token

The recommended way to authenticate with the Underdog API is by using OAuth2. When establishing a connection using OAuth2, you will need your access token — you will find it on the home page of the [Underdog dashboard](https://app.underdogprotocol.com) or in the [developer settings](https://app.underdogprotocol.com/developers?network=MAINNET). Here's how to add the token to the request header using cURL:

#### Example request with bearer token

```bash
curl https://api.underdogprotocol.com/v1/collections \
  -H "Authorization: Bearer {token}"
```

Always keep your token safe and reset it if you suspect it has been compromised.

## Network Access

API keys can be configured to give access to the Mainnet API, Devnet API, or both. This setting can be configured in the dashboard.&#x20;


# Pagination

In this guide, we will look at how to work with paginated responses when querying the Underdog API.

By default, all responses limit results to ten. However, you can go as high as 100 by adding a `limit` parameter to your requests.

When an API response returns a list of objects, no matter the amount, pagination is supported. In paginated responses, objects are nested in a `results` attribute and include four attributes to determine whether you have reach the end of the last page.&#x20;

* `limit`
* `page`
* `totalPages`
* `totalResults`

You can use the `limit` and `page` query parameters to browse pages.

## Example using cursors

In this example, we request the first page with at most one result. As a result, we get a list of one Collection and can tell by the `totalResults` and `totalPages` attributes that we have one more page of results.&#x20;

`limit` integer

Limit the number of items returned.

`page` integer

The page number to return.&#x20;

{% code title="Manual pagination using cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/collections?limit=1&page=1" \
        -H "Authorization: Bearer {token}"
```

{% endcode %}

{% code title="Paginated response" %}

```json
{
    "results":[{
        "mintAddress":"FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
        "name":"NBA",
        "description":"",
        "image":"https://arweave.net/57PrJ_-S-m2BXOSkaUN2t5ibsjbSrCjElSVUQXXyCq0",
        "attributes":[],
        "uri":"https://arweave.net/DnftYIM2sNZQBXm7qzRiFoUP0S7QtN4q_GkmIcv1UJ8",
        "collectionDetails":{},
        "ownerAddress":"EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
    }],
    "page": 1,
    "limit": 1,
    "totalPages": 1,
    "totalResults": 2
}
```

{% endcode %}


# Errors

In this guide, we will talk about what happens when something goes wrong while you work with the API.

Mistakes happen, and mostly they will be yours, not ours. Let's look at some status codes and error types you might encounter.

You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging (before contacting support).

## Status Codes <a href="#status-codes" id="status-codes"></a>

Here is a list of the different categories of status codes returned by the Underdog API. Use these to understand if a request was successful.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>2xx</strong></td><td>A 2xx status code indicates a successful response.</td><td></td></tr><tr><td><strong>4xx</strong></td><td>A 4xx status code indicates a client error — this means it's a <em>you</em> problem.</td><td></td></tr><tr><td><strong>5xx</strong></td><td>A 5xx status code indicates a server error — you won't be seeing these.</td><td></td></tr></tbody></table>

\ <br>


# Webhooks

In this guide, we will look at how to register and consume webhooks to integrate your app with Underdog.

With Webhooks, your app can know when something happens in Underdog, such as creating a Project or minting an NFT.

## Registering Webhooks

To register a new Webhook, you need to have a URL in your app that Underdog can call. You can configure a new Webhook from the Underdog dashboard. Add your URL and pick the events you want to listen for.&#x20;

Now, whenever something of interest happens in Underdog, a Webhook is fired off by Underdog. In the next section, we'll look at how to consume Webhooks.

## Consuming Webhooks <a href="#consuming-webhooks" id="consuming-webhooks"></a>

When your app receives a webhook request from Underdog, check the `type` attribute to see what event caused it. The first part of the event type will tell you the payload type, e.g., an NFT, Project, etc.

{% code title="Example Webhook payload" %}

```json
{
  "id": "66396cba-f6f7-488e-8431-665598548661",
  "type": "collection.create",
  "data": {
    "mintAddress": "GQw5KBtUo1tUa29BsFEJ4F9mdFsXALoHRTRaBfAvFsbU"
    // ...
  }
}
```

{% endcode %}

In the example above, there was a `project.create`.

## Transaction Types

<table><thead><tr><th width="245.66666666666666">Transaction Type</th><th>Details</th></tr></thead><tbody><tr><td><code>project.create</code></td><td>Project was successfully created</td></tr><tr><td><code>project.nft.create</code></td><td>NFT in a Project was successfully created</td></tr><tr><td><code>project.nft.update</code></td><td>NFT in a Project was successfully updated</td></tr><tr><td><code>project.nft.revoke</code></td><td>NFT in a Project was successfully revoked</td></tr><tr><td><code>project.nft.burn</code></td><td>NFT in a Project was successfully burned</td></tr></tbody></table>

{% code title="Example payload" %}

```json
{
  "id": "12b9d241-bff6-4e64-91d7-3b19d27b42f6",
  "type": "project.create",
  "data": {
    "mintAddress":"DoBjCkCgwpqUQEKqEnjEsi8vStUch6xbHAoERSNK5WQM",
    "superAdminAddress":"Aht2mY2BKAkt7aJtTkeMEyrZH7rG2UNFt3sVaKTQtxmX",
    "orgId": 1,
    "projectId": 1,
    "transferable": true,
    "nftId": 1,
    "name":"Project #1",
    "description":"Description for Project #1",
    "image":"https://exmaple.com/project.png",
  }
}
```

{% endcode %}

## API Reference

{% content-ref url="/pages/vfKhyp7tVYfj7jrZnFjq" %}
[Webhooks](/resources/webhooks)
{% endcontent-ref %}


# Architecture

<figure><img src="/files/XaZHj95P8Uw4rUHqTwVn" alt=""><figcaption></figcaption></figure>


# Projects

Projects are the containers for NFTs shared with you, your community, and your product.

On this page, we'll dive into the different Project endpoints you can use to manage Projects programmatically.

Projects represent a group of related [NFTs](/resources/projects/nfts). A Project is itself an NFT. For example, a Project can be a group of NFTs where each NFT is a membership pass.&#x20;

There are two types of Projects:&#x20;

1. [Transferable Projects](/resources/projects/transferable-projects)
2. [Non-Transferable Projects](/resources/projects/non-transferable-projects)

We'll walk through the different Project types and how the NFTs in each Project type are different.&#x20;

## The Project Model

The Project model contains all the information about your Project, such as its mint address, name, and image.

| Property       | Description                                                | Type    |
| -------------- | ---------------------------------------------------------- | ------- |
| `id`           | Unique ID for a Project                                    | number  |
| `transferable` | Whether or not the NFTs in this project can be transferred | boolean |
| `mintAddress`  | Address for the Project's mint account                     | string  |
| `status`       | Whether your Project has been confirmed on-chain           | string  |
| `name`         | Name stored as on-chain metadata                           | string  |
| `image`        | URL pointing to the image for your Project                 | string  |
| `description`  | Description stored in the metadata for your Project        | string  |

## Project Types

The Underdog API supports two types of Projects that affect how the NFTs in the Project are minted and the transferability of the NFTs in the Project.&#x20;

| Project Type             | Project Path Param |
| ------------------------ | ------------------ |
| Transferable Project     | `t`                |
| Non-Transferable Project | `n`                |

### Transferable Projects `t`

NFTs in a Transferable Project are minted directly to a wallet and can be transfered freely the the owner of the NFT.&#x20;

{% content-ref url="/pages/9EqZAzoo5Jcwi72DNZyM" %}
[Transferable Projects](/resources/projects/transferable-projects)
{% endcontent-ref %}

### Non-Transferable Projects `n`

NFTs in a Non-Transferable Project are lazily minted. Only when the NFT is claimed is it minted and the claimer cannot transfer the NFT.

{% content-ref url="/pages/WdBg1AuPUTnc9AweQY8M" %}
[Non-Transferable Projects](/resources/projects/non-transferable-projects)
{% endcontent-ref %}

## NFTs

The Projects endpoint includes endpoints to create, update, and manage the Project's NFTs.

The `:transferable` param is set to either `t` for a Transferable Project or `n` for a Non-Transferable Project. The `:projectId` param is set to the Project's ID.&#x20;

{% content-ref url="/pages/QS7CX9Z4VK9v6fKwO2Ns" %}
[NFTs](/resources/nfts)
{% endcontent-ref %}


# Transferable Projects

{% hint style="warning" %}
For Transferable Projects, the `:transferable` path param is set to t
{% endhint %}

This guide will walk through the process of setting up a Transferable Project and minting NFTs that are part of the Project.&#x20;

## Create a Transferable Project

<figure><img src="/files/q8aKhg6B3YI3NYYDpYsO" alt=""><figcaption></figcaption></figure>

Besides passing in the Project's name and image, you'll need to set the `transferable` to `true` in the request body.&#x20;

{% code title="Example Request Body" %}

```json
{
    "name": "Transferable Project",
    "description": "Description for your transferable project",
    "image": "https://hatrabbits.com/wp-content/uploads/2017/01/random-word-1.jpg",
    "transferable": true
}
```

{% endcode %}

### API Reference

{% content-ref url="/pages/OIvuYeysFkcYabt0b0QR" %}
[Create a Project](/resources/projects/methods/create-a-project)
{% endcontent-ref %}

## Mint a Transferable NFT

<figure><img src="/files/uWvEZ5TltoethyFCadjP" alt=""><figcaption></figcaption></figure>

Besides setting the metadata like name, description, image, and attributes, you can also specify a receiver for your NFT.&#x20;

When the receiver is set, the NFT will be minted directly to the receiver's address.&#x20;

If you don't set a receiver, the NFT will be minted to the wallet associated to the API Key in the request.&#x20;

### API Reference

{% content-ref url="/pages/QLihY5NN86TVp0os2lJU" %}
[Create an NFT](/resources/projects/nfts/create-an-nft)
{% endcontent-ref %}


# Non-Transferable Projects

Non-Transferable Projects allow you to mint Non-Transferable NFTs that can be claimed by your community, product users, or customers

{% hint style="warning" %}
For Non-Transferable Projects, the `:transferable` path param is set to `n`
{% endhint %}

This guide will walk through the process of setting up a Non-Transferable Project, minting NFTs that are part of the Project, and claiming the NFT.&#x20;

## Create a Non-Transferable Project

<figure><img src="/files/vJJ010QpEiwcPIDkMbiA" alt=""><figcaption><p>From the V2 dashboard, you'll head to <strong>Create a Project</strong></p></figcaption></figure>

Besides passing in the Project's name and image, you'll need to set the `transferable` to `false` in the request body.&#x20;

{% code title="Example Request Body" %}

```json
{
    "name": "Project #420",
    "image": "https://hatrabbits.com/wp-content/uploads/2017/01/random-word-1.jpg",
    "transferable": false
}
```

{% endcode %}

### API Reference

{% content-ref url="/pages/OIvuYeysFkcYabt0b0QR" %}
[Create a Project](/resources/projects/methods/create-a-project)
{% endcontent-ref %}

## Mint a Non-Transferable NFT

<figure><img src="/files/QoqQzmopckocbnlJe00l" alt=""><figcaption><p>You can set custom attributes and specify a claimer for your NFT</p></figcaption></figure>

Non-Transferable NFTs are lazily minted. When you create an NFT through the API or the Underdog dashboard, the metadata is prepared to be minted and then minted on-chain when it is claimed.

{% hint style="info" %}
Non-Transferable NFTs can be updated before they are actually minted through the [update](https://docs.underdogprotocol.com/resources/v2/projects/nfts/update-an-nft#update-an-nft) and [partial update](https://docs.underdogprotocol.com/resources/v2/projects/nfts/update-an-nft#partial-update-an-nft) endpoints.&#x20;
{% endhint %}

The claimer is determined by the optional `claimerAddress` in the request body.&#x20;

### Setting a Claimer

When the `receiverAddress` is set in the request body, only the specified address can mint and claim the NFT.&#x20;

When you know the claimer address ahead of time, this ensures that the Non-Transferable NFT is claimed by the right claimer. Only a wallet with the specified `receiverAddress` can sign the transaction to claim the NFT.&#x20;

### Without a Claimer Address

If you don't know the `receiverAddress` ahead of time, you can exclude it from the request body. This generate a one-time password (OTP) that can be used to claim the NFT.&#x20;

The OTP must be passed in along with the claimer address to generate the claim transaction for the Non-Transferable NFT. This will be covered in more detail in the next section.&#x20;

### API Reference

{% content-ref url="/pages/QLihY5NN86TVp0os2lJU" %}
[Create an NFT](/resources/projects/nfts/create-an-nft)
{% endcontent-ref %}

## Claim a Non-Transferable NFT

<figure><img src="/files/bKJvFmrFFvfB8rDXNtWA" alt=""><figcaption><p>The claim page for the Non-Transferable NFT</p></figcaption></figure>

Once you've created your NFT, you can send the claim link to your desired claimer. The claim page sends a POST request to the API that generate a transaction the claimer can sign to mint & claim the NFT.&#x20;

{% hint style="info" %}
Claiming the NFT requires the claimer to sign the transaction. The claimer pays the rent and networks fees to mint the NFT.&#x20;
{% endhint %}

### API Reference

{% content-ref url="/pages/Xxysl85tyZEi8mcweTCs" %}
[Generate Claim Link](/resources/projects/nfts/generate-claim-link)
{% endcontent-ref %}

{% content-ref url="/pages/LGaSRCgWfDZCeq52JpOD" %}
[Generate Claim Transaction](/resources/nfts/generate-claim-transaction)
{% endcontent-ref %}


# NFTs

NFTs are a core part of Underdog — the very reason Underdog exists is so you can seamlessly integrate NFTs with your own products.

On this page, we'll dive into the different NFT endpoints you can use to manage NFTs programmatically. We'll look at how to query, create, and update NFTs.

NFTs are grouped together through Projects. For example, a community can create a Project and NFTs in that Project can act as membership NFTs.

## The NFT Model

The NFT model contains all the information about your NFT, such as their mint address, name, and image.

| Property         | Description                                                                  | Type    |
| ---------------- | ---------------------------------------------------------------------------- | ------- |
| `id`             | Unique ID for an NFT in a Project                                            | number  |
| `projectId`      | The ID of the Project the NFT is part o                                      | number  |
| `transferable`   | Whether or not the NFT can be transferred based on the Project its a part of | boolean |
| `status`         | On-chain state of the NFT                                                    | string  |
| `mintAddress`    | The mint address of the NFT's mint account                                   | string  |
| `name`           | The on-chain name of the NFT                                                 | string  |
| `description`    | Description for the NFT                                                      | string  |
| `image`          | Image URL for the NFT                                                        | string  |
| `ownerAddress`   | The wallet address of the owner of the NFT                                   | string  |
| `claimerAddress` | The wallet address that can claim a non-transferable NFT                     | string  |
| `attributes`     | Object with traits and values  of the NFT's attributes                       | object  |

## NFTs

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Create an NFT</strong></td><td></td><td><a href="/pages/QLihY5NN86TVp0os2lJU">POST -></a></td><td><a href="/pages/ENKq3A54GJCzX6zMpH8U">/pages/ENKq3A54GJCzX6zMpH8U</a></td></tr><tr><td><strong>Retrieve an NFT</strong></td><td></td><td><a href="/pages/V1TcA1yVdvAsVg2otTtx">GET -></a></td><td><a href="/pages/yaiNPICP9TTbwUhaRTbi">/pages/yaiNPICP9TTbwUhaRTbi</a></td></tr><tr><td><strong>Update an NFT</strong></td><td></td><td><a href="/pages/oQrVpyvEvpN5wGS98EXt">PATCH / PUT -></a></td><td><a href="/pages/qXvsmqn0k9GeptvdiEDm">/pages/qXvsmqn0k9GeptvdiEDm</a></td></tr><tr><td><strong>Claim an NFT</strong></td><td></td><td><a href="/pages/Xxysl85tyZEi8mcweTCs">GET -></a></td><td></td></tr></tbody></table>


# List all NFTs

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/nfts" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location 'https://dev.underdogprotocol.com/v2/projects/n/5/nfts?limit=10&page=1&ownerAddress=3LtsySLcKoW4VAp7pfSCGAFpwwuAVeqhe42fcc42aSpw' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/5/nfts?limit=10&page=1&ownerAddress=3LtsySLcKoW4VAp7pfSCGAFpwwuAVeqhe42fcc42aSpw',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "results": [
        {
            "id": 4,
            "status": "confirmed",
            "transferable": false,
            "projectId": 5,
            "mintAddress": "Fs7pQhk6qfBZfHe8uEQkXYQZobNC4vbR3b5h947KBqk2",
            "claimerAddress": null,
            "ownerAddress": "3LtsySLcKoW4VAp7pfSCGAFpwwuAVeqhe42fcc42aSpw",
            "name": "Lazy Koalas",
            "description": "",
            "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/Fs7pQhk6qfBZfHe8uEQkXYQZobNC4vbR3b5h947KBqk2/image.png",
            "attributes": {}
        }
    ],
    "page": 1,
    "limit": 10,
    "totalPages": 1,
    "totalResults": 1
}
```

{% endcode %}


# Search NFTs

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/nfts/search" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location 'https://dev.underdogprotocol.com/v2/projects/n/5/nfts/search
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/5/nfts/search?search=Fs7'
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "results": [
        {
            "id": 4,
            "status": "confirmed",
            "transferable": false,
            "projectId": 5,
            "mintAddress": "Fs7pQhk6qfBZfHe8uEQkXYQZobNC4vbR3b5h947KBqk2",
            "claimerAddress": null,
            "ownerAddress": "3LtsySLcKoW4VAp7pfSCGAFpwwuAVeqhe42fcc42aSpw",
            "name": "Lazy Koalas",
            "description": "",
            "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/Fs7pQhk6qfBZfHe8uEQkXYQZobNC4vbR3b5h947KBqk2/image.png",
            "attributes": {}
        }
    ],
    "page": 1,
    "limit": 10,
    "totalPages": 1,
    "totalResults": 1
}
```

{% endcode %}


# Create an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/nfts" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "LeGoat",
    "image": "https://sportshub.cbsistatic.com/i/r/2023/02/08/aa0a798f-6268-41ba-9be4-ea4ee03fd817/thumbnail/1200x675/421458d6419a36da2aaad75e10b2e347/king.jpg",
    "attributes": {
        "points": "38390"
    }
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "name": "LeGoat",
  "image": "https://sportshub.cbsistatic.com/i/r/2023/02/08/aa0a798f-6268-41ba-9be4-ea4ee03fd817/thumbnail/1200x675/421458d6419a36da2aaad75e10b2e347/king.jpg",
  "attributes": {
    "points": "38390"
  }
});

let config = {
  method: 'post',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "transactionId": "c3f66040-89f2-4692-9987-e7d0465179ab",
    "mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi"
}
```

{% endcode %}


# Retrieve an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/nfts/:nftId" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 1,
    "status": "confirmed",
    "mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi",
    "ownerAddress": "3ZBGxWRQdKTaXRcyLapMn1LaSU5TbKnBKJ6m2jBERKAp",
    "name": "LeGoat",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi/image.png",
    "attributes": {
        "points": "38390"
    }
}
```

{% endcode %}


# Update an NFT

## Partial Update an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/nfts/:nftId" method="patch" expanded="false" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request PATCH 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "attributes": {
        "points": "40000"
    }
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "attributes": {
    "points": "40000"
  }
});

let config = {
  method: 'patch',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 1,
    "status": "confirmed",
    "mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi",
    "name": "LeGoat",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi/image.png",
    "attributes": {
        "points": "40000"
    }
}
```

{% endcode %}

## Update an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/nfts/:nftId" method="put" expanded="false" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request PUT 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "LeKareem",
    "image": "https://upload.wikimedia.org/wikipedia/commons/a/a0/Kareem_Abdul-Jabbar_May_2014.jpg",
    "attributes": {
        "points": "40000"
    }
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "name": "LeKareem",
  "image": "https://upload.wikimedia.org/wikipedia/commons/a/a0/Kareem_Abdul-Jabbar_May_2014.jpg",
  "attributes": {
    "points": "40000"
  }
});

let config = {
  method: 'put',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 1,
    "status": "confirmed",
    "mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi",
    "name": "LeGoat",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi/image.png",
    "attributes": {
        "points": "40000"
    }
}
```

{% endcode %}


# Generate Claim Link

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/n/:projectId/nfts/:nftId/claim" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1/claim' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1/claim',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "link": "https://claim.underdogprotocol.com/nfts/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi?otp=926b7a07-d4e6-44e6-a43e-526e452ff06f&network=DEVNET",
    "otp": "926b7a07-d4e6-44e6-a43e-526e452ff06f"
}
```

{% endcode %}


# Revoke an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/n/:projectId/nfts/:nftId/revoke" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://dev.underdogprotocol.com/v2/projects/n/:projectId/nfts/:nftId/revoke' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/:projectId/nfts/:nftId/revoke',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "nftId": 1,
    "projectId": 1,
    "transferable": false,
    "transactionId": "3945e22e-6c8d-42ce-894b-6f77b59df7bd",
    "mintAddress": "CTASofcsAKVg2wy7xu2r7LFx8H1N8THQCD8vSkvV5dqr"
}
```

{% endcode %}


# Burn an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/n/:projectId/nfts/:nftId/burn" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://dev.underdogprotocol.com/v2/projects/n/:projectId/nfts/:nftId/burn
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'post',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/:projectId/nfts/:nftId/burn',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "nftId": 1,
    "projectId": 1,
    "transferable": false,
    "transactionId": "3945e22e-6c8d-42ce-894b-6f77b59df7bd",
    "mintAddress": "CTASofcsAKVg2wy7xu2r7LFx8H1N8THQCD8vSkvV5dqr"
}
```

{% endcode %}


# Methods

## Project Methods

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>List all Projects</strong></td><td></td><td><a href="/pages/IMVf2ZflNwelmVx40cMS">GET -></a></td><td><a href="/pages/ENKq3A54GJCzX6zMpH8U">/pages/ENKq3A54GJCzX6zMpH8U</a></td></tr><tr><td><strong>Create a Project</strong></td><td></td><td><a href="/pages/OIvuYeysFkcYabt0b0QR">POST -></a></td><td><a href="/pages/yaiNPICP9TTbwUhaRTbi">/pages/yaiNPICP9TTbwUhaRTbi</a></td></tr><tr><td><strong>Retrieve a Project</strong></td><td></td><td><a href="/pages/jaAYCEZPEi010Fs7w0Z1">GET -></a></td><td><a href="/pages/qXvsmqn0k9GeptvdiEDm">/pages/qXvsmqn0k9GeptvdiEDm</a></td></tr></tbody></table>

## NFT Methods

{% content-ref url="/pages/sDCuvqcsO3HDgnaZaQCm" %}
[NFTs](/resources/projects/nfts)
{% endcontent-ref %}


# List all Projects

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/projects?limit=2' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects?limit=2',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "results": [
        {
            "id": 1,
            "transferable": false,
            "mintAddress": "D7MRhsnN5MSSsYVwY1NiAomW1ZrFBGnsEfMnrKULAFva",
            "ownerAddress": "J7oqTbAUdMazGbBs4LZRpKv6SNE4k1GVqkxTQz526vkz",
            "name": "Project #1",
            "description": "",
            "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/D7MRhsnN5MSSsYVwY1NiAomW1ZrFBGnsEfMnrKULAFva/image.png"
        },
        {
            "id": 2,
            "transferable": false,
            "mintAddress": "FX2cGp5jUvfHfoAFE9PnPFnS5DC9AyLugaTNgbVq4Dd5",
            "ownerAddress": "3Wku1E83DskbBaxwPBwD1BXNzX1B1VVEqp75P2oLxWTk",
            "name": "Project #3",
            "description": "",
            "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/FX2cGp5jUvfHfoAFE9PnPFnS5DC9AyLugaTNgbVq4Dd5/image.png"
        }
    ],
    "page": 1,
    "limit": 2,
    "totalPages": 3,
    "totalResults": 5
}
```

{% endcode %}


# Create a Project

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://dev.underdogprotocol.com/v2/projects' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Project #420",
    "image": "https://hatrabbits.com/wp-content/uploads/2017/01/random-word-1.jpg",
    "transferable": false
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "name": "Project #420",
  "image": "https://hatrabbits.com/wp-content/uploads/2017/01/random-word-1.jpg",
  "transferable": false
});

let config = {
  method: 'post',
  url: 'https://dev.underdogprotocol.com/v2/projects',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "projectId": 4,
    "transferable": false,
    "transactionId": "f6818014-838c-45db-bf9e-70a55ffb14d6",
    "mintAddress": "7eq4L3mxaaZxLw5JGP2dDtoYA71vPoRvszSUYSbqxGgF"
}
```

{% endcode %}


# Retrieve a Project

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/projects/n/4' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4',
  headers: { 
    'Authorization': 'Bearer d098077945e454.c76459c2fa07476788b3cbf7d60273fd'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 4,
    "transferable": false,
    "status": "confirmed",
    "mintAddress": "7eq4L3mxaaZxLw5JGP2dDtoYA71vPoRvszSUYSbqxGgF",
    "ownerAddress": "3ZBGxWRQdKTaXRcyLapMn1LaSU5TbKnBKJ6m2jBERKAp",
    "name": "Project #420",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/7eq4L3mxaaZxLw5JGP2dDtoYA71vPoRvszSUYSbqxGgF/image.png",
    "nfts": {
        "results": [],
        "page": 1,
        "limit": 10,
        "totalPages": 0,
        "totalResults": 0
    }
}
```

{% endcode %}


# Update a Project

## Partial Update an Project

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId" method="patch" expanded="false" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request PATCH 'https://dev.underdogprotocol.com/v2/projects/n/1' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
    "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/005.png"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/005.png"
});

let config = {
  method: 'patch',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/1',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 1,
    "status": "confirmed",
    "mintAddress": "6ntqAJmmkJup9h9EX3B5vETCj6ZYhZNfmQ6Rqm2myGmE",
    "name": "Underdogs",
    "description": "Pokemnon",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/6ntqAJmmkJup9h9EX3B5vETCj6ZYhZNfmQ6Rqm2myGmE/image.png"
}
```

{% endcode %}

## Update a Project

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId" method="put" expanded="false" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request PUT 'https://dev.underdogprotocol.com/v2/projects/n/1' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
    "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/005.png",
    "description": "Pokemnon"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "image": "https://assets.pokemon.com/assets/cms2/img/pokedex/full/005.png",
  "description": "Pokemnon"
});

let config = {
  method: 'put',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/1',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 1,
    "status": "confirmed",
    "mintAddress": "6ntqAJmmkJup9h9EX3B5vETCj6ZYhZNfmQ6Rqm2myGmE",
    "name": "Underdogs",
    "description": "Pokemnon",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/6ntqAJmmkJup9h9EX3B5vETCj6ZYhZNfmQ6Rqm2myGmE/image.png"
}
```

{% endcode %}

## Update Name & Symbol

### Update Project Name

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/name" method="put" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

#### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request PUT 'https://dev.underdogprotocol.com/v2/projects/n/1/name' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
    "name": "Project"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "name": "Project"
});

let config = {
  method: 'put',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/1/name',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "transactionId": "b8bde20a-a689-4ce7-9199-b5e4ca08e1cc",
    "projectId": 1,
    "transferable": false,
    "mintAddress": "6ntqAJmmkJup9h9EX3B5vETCj6ZYhZNfmQ6Rqm2myGmE"
}
```

{% endcode %}

### Update Project Symbol

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/symbol" method="put" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

#### Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request PUT 'https://dev.underdogprotocol.com/v2/projects/n/1/symbol \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
    "symbol": "TEST"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "symbol": "TEST"
});

let config = {
  method: 'put',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/1/symbol',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "transactionId": "b8bde20a-a689-4ce7-9199-b5e4ca08e1cc",
    "projectId": 1,
    "transferable": false,
    "mintAddress": "6ntqAJmmkJup9h9EX3B5vETCj6ZYhZNfmQ6Rqm2myGmE"
}
```

{% endcode %}


# Retrieve Project Stats

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/projects/:transferable/:projectId/stats" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/projects/n/4' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/projects/n/4',
  headers: { 
    'Authorization': 'Bearer d098077945e454.c76459c2fa07476788b3cbf7d60273fd'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": 4,
    "transferable": false,
    "status": "confirmed",
    "mintAddress": "7eq4L3mxaaZxLw5JGP2dDtoYA71vPoRvszSUYSbqxGgF",
    "ownerAddress": "3ZBGxWRQdKTaXRcyLapMn1LaSU5TbKnBKJ6m2jBERKAp",
    "name": "Project #420",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/7eq4L3mxaaZxLw5JGP2dDtoYA71vPoRvszSUYSbqxGgF/image.png",
    "nfts": {
        "results": [],
        "page": 1,
        "limit": 10,
        "totalPages": 0,
        "totalResults": 0
    }
}
```

{% endcode %}


# NFTs


# Retrieve an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/nfts/:mintAddress" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/nfts/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/nfts/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi',
  headers: { 
    'Authorization': 'Bearer d098077945e454.c76459c2fa07476788b3cbf7d60273fd'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi",
    "ownerAddress": "3ZBGxWRQdKTaXRcyLapMn1LaSU5TbKnBKJ6m2jBERKAp",
    "name": "LeGoat",
    "image": "https://underdog-test-bucket-dev.s3.amazonaws.com/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi/image.png",
    "attributes": {
        "points": "40000"
    }
}
```

{% endcode %}


# Generate Claim Transaction

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/nfts/:mintAddress/claim" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request POST 'https://dev.underdogprotocol.com/v2/nfts/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi/claim' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "otp": "ddb287f5-f25b-4eb3-9abe-161c676b3f03",
    "claimerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "otp": "ddb287f5-f25b-4eb3-9abe-161c676b3f03",
  "claimerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
});

let config = {
  method: 'post',
  url: 'https://dev.underdogprotocol.com/v2/nfts/Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi/claim',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "transaction": "ZUdfciTNnhrYbDaBnWjP1ZTQjNMM6KBvW2kCk5DXW9iVY6XSEkqgueroVFcyLNcj2oHW6ZoYWT3FbFRRZLAn7tepKvkiRtD8Fj1reHiFmKgc45LfjCcC6n9us1Ere2CMVkPq4SYrgPhpQR2sj7MX1vajJKrWsJSryJbUnZXZdrTFk5XKBtBHv7mj1Wss1MhvMGEBBgdyweG5zTfA8sfNrgPBmqPXbKCJWGUj5hpxAAYREo2EG5vQJkR11QGvDkzQfTShdX11Hx58fjj66KUJe6uLwa5hrU3aX6CPnorLmnAwdP7oR9NAX8fyhNxp4Ju6rMJ8vVEhkLeWtJu4aYbfUHgoAXUKpJkAgH32K51FJFCvkSCwazc8P9sNMBgUFGnGdNGxxNRizQbX6KFAon2skeswf9qUBbmL5yjfux6AQwyhdr8yE3GoXDr1TXEyynQfSoPmMACxqMXQPJgbH4vzUgZsYdVG55iVbN7GmbQwMrHZJo4AVm8cbL11JRvpZMeqQerFww5kLpwJ2VC9gzU1CbA4qXpQ19zWC1TMDqCNm1N9P7kNBXcpu9n4pp5PJLpDaqutXJrMLjSP5baeTffPkhwZEg5SDLKE3NexJtyFA58TDRmMctz5FhdJ8Xi459MhvVrXkbN1ffX5MmX6wv8ZNX1ysrs6HGcbSea6B1UKw689ks6BKNzfagGZ54GZi8MFjHhTcrqjDi1EMbtLbNSL89arPiEPYUo2gXFe9FRLWuvCQegtMS3gGFjbr7mY9tmJn97p9kGCYT5oPXd8QHooS9vUmsGPraPtbW41qC4x6fyYNDR8tP2vZaetVaiLfEd64jE2DNjDNugDyiMSQF8h8DhECCmB9o4tUJVqGmf5T1emBxuL9c4GntHYYzByueh6tyHqrSiATQtrLigxyj1fFMVHBnaQaSpg3tfQSHxq2Kxro7DB8AUNyWsKvU169C2nTP8q2x88uzr9VfwKcgCWNyRjKJmYJM5CPGhP55bBS5GcVeTiSUZh4Vaq4LcBdxjEJQPB6TLLvjAaanEvycw55GbbmLcJDszfrNZHGh2P65RoswMBoVKQkFxT35ZatrQHrqCCnwmpWskU7fcWp4qp8T4aaozWpRxECNWNpeQbkCwEDdX69cL4i6i6ag34VAWM8FJ6sB251cDjvaQcFAMkTnCzC3s5mReovVu9CDDGPtbzpFXRQVP7c3KD5rsPLpzYs36zo7iChrdA7nmCTDiktiZKGJZ7FUKWpzebwC7RJKqyNNmq467u4VCEGuePm5CRjvfaHVnfjRdmXyAS8T1kTiJRmPVyF2xMugB3BzQGo4eQitRsBsBULnHdUCRC33qFDgNNbMSsggifp5vvQz7it1jgYY8ortgd9H6Z6czNByrxwNYJJLGbRp8w6PWr2aJ5jpkPU6M6DMsjX97GLsY6R9b3EMJm3SDMfhCnvmULepuem4cVKHdQ1dHkdAXukQLZ586pdETFp6xYjxAyu"
}
```

{% endcode %}


# Orgs


# List all Orgs

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/orgs" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/orgs' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/orgs',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "results": [
        {
            "id": 1,
            "superAdminAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
            "status": "confirmed",
            "network": "DEVNET"
        }
    ],
    "page": 1,
    "limit": 10,
    "totalPages": 1,
    "totalResults": 1
}
```

{% endcode %}


# Transactions

Transactions are how you keep track of on-chain actions on Underdog.

## The Transaction Model

<table><thead><tr><th>Property</th><th width="336.6666666666667">Description</th><th>Type</th></tr></thead><tbody><tr><td><code>id</code></td><td>Unique identifier for the transaction</td><td>string</td></tr><tr><td><code>status</code></td><td>Current state of the transaction</td><td>string</td></tr><tr><td><code>type</code></td><td>Type of transaction</td><td>string</td></tr><tr><td><code>mintAddress</code></td><td>Mint address of the NFT or Collection associated with the transaction</td><td>string</td></tr><tr><td><code>walletAddress</code></td><td>Wallet address that initiated the transaction</td><td>string</td></tr></tbody></table>

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Retrieve a Transaction</strong></td><td></td><td><a href="/pages/0iyG1rdlQTNaQXn2ANhY">GET -></a></td><td><a href="/pages/0iyG1rdlQTNaQXn2ANhY">/pages/0iyG1rdlQTNaQXn2ANhY</a></td></tr></tbody></table>


# List all Transactions

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/transactions" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://dev.underdogprotocol.com/v2/transactions' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/transactions',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
  "results": [
    {
      "id": "FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
      ...
    },
    {
      "id": "7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB",
      ...
    },
    {
      "id": "61YbMJWQbboN3PUQen9MrxF53eMkGcnhEVrkX24TcTqK",
      ...    
    }
  ],
  "limit": 3,
  "page": 1,
  "totalPages": 3,
  "totalResults": 8
}
```

{% endcode %}


# Retrieve a Transaction

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/transactions/:transactionId" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/transactions/1e10e1e9-e4df-4561-8392-70bdd5ece1d1" \
        -H "Authorization: Bearer {token}"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
  url: 'https://dev.underdogprotocol.com/v2/transactions/252cb616-8be6-4be7-bff2-6e2da5a1745d',
  headers: {
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "id": "252cb616-8be6-4be7-bff2-6e2da5a1745d",
    "status": "error",
    "type": "PROJECT_CREATE",
    "mintAddress": null,
    "walletAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
    "createdAt": "2023-02-14T16:25:06.79322+00:00",
    "data": "{\"name\":\"Project #12\",\"orgId\":1,\"projectId\":9,\"transferable\":false}",
    "requestId": "5758c24c-45e2-44fb-abb0-a489efeb5311",
    "nft": null
}
```

{% endcode %}


# Webhooks

Webhooks are how you react in real-time to on-chain Transactions on Underdog.

## The Webhook Model

<table><thead><tr><th>Property</th><th width="336.6666666666667">Description</th><th>Type</th></tr></thead><tbody><tr><td><code>id</code></td><td>Unique identifier for the Webhook</td><td>string</td></tr><tr><td><code>url</code></td><td>URL to send POST request to</td><td>string</td></tr><tr><td><code>valid</code></td><td>Whether or not the Webhook is valid</td><td>boolean</td></tr><tr><td><code>triggers</code></td><td>The transaction types that trigger the Webhook</td><td></td></tr><tr><td><code>walletAddress</code></td><td>Wallet address that owns the webhook</td><td>string</td></tr></tbody></table>

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>List all Webhooks</strong></td><td></td><td><a href="/pages/mLhcrwdvqZPqA1xLaI7X">GET -></a></td><td><a href="/pages/0iyG1rdlQTNaQXn2ANhY">/pages/0iyG1rdlQTNaQXn2ANhY</a></td></tr><tr><td><strong>Create a Webhook</strong></td><td></td><td><a href="/pages/mL5qL7a0WKsrEetbC0e3">POST -></a></td><td><a href="/pages/mL5qL7a0WKsrEetbC0e3">/pages/mL5qL7a0WKsrEetbC0e3</a></td></tr><tr><td><strong>Delete a Webhook</strong></td><td></td><td><a href="/pages/F0AOT1RTfteSJ0lZCfdQ">DELETE -></a></td><td><a href="/pages/F0AOT1RTfteSJ0lZCfdQ">/pages/F0AOT1RTfteSJ0lZCfdQ</a></td></tr></tbody></table>


# List all Webhooks

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/webhooks" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location 'https://dev.underdogprotocol.com/v2/webhooks' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'get',
maxBodyLength: Infinity,
  url: 'https://dev.underdogprotocol.com/v2/webhooks',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "results": [
        {
            "id": "bb103366-7555-4a62-9270-a46990582020",
            "url": "https:/google.com",
            "walletAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
            "valid": true,
            "createdAt": "2023-02-16T02:53:40.457843+00:00",
            "updatedAt": "2023-02-16T02:53:40.457843+00:00",
            "triggers": []
        }
    ],
    "page": 1,
    "limit": 10,
    "totalPages": 1,
    "totalResults": 1
}
```

{% endcode %}


# Create a Webhook

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/webhooks" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location 'https://dev.underdogprotocol.com/v2/webhooks' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https:/google.com",
    "triggers": []
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "url": "https:/google.com",
  "triggers": []
});

let config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://dev.underdogprotocol.com/v2/webhooks',
  headers: { 
    'Authorization': 'Bearer {token}', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}

```
{
    "id": "bb103366-7555-4a62-9270-a46990582020",
    "url": "https:/google.com",
    "walletAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
    "valid": true,
    "triggers": [],
    "createdAt": "2023-02-16T02:53:40.457843+00:00",
    "updatedAt": "2023-02-16T02:53:40.457843+00:00"
}
```


# Delete a Webhook

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v2/webhooks/:webhookId" method="delete" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request DELETE 'https://dev.underdogprotocol.com/v2/webhooks/:webhookId' \
--header 'Authorization: Bearer {token}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const axios = require('axios');

let config = {
  method: 'delete',
maxBodyLength: Infinity,
  url: 'https://dev.underdogprotocol.com/v2/webhooks/:webhookId',
  headers: { 
    'Authorization': 'Bearer {token}'
  }
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}
{% endtabs %}


# V1

Version 1 of the Underdog API is feature complete to manage your NFT Collections and the NFTs within them.&#x20;


# Collections

Collections are the containers for NFTs shared with you, your community, and your product.

On this page, we'll dive into the different Collection endpoints you can use to manage Collections programmatically. We'll look at how to query and create Collections.

Collections represents a group of related NFTs. A Collection is itself an NFT. For example, a Collection can be a group of NFTs where each NFT is a membership pass.&#x20;

## The Collection Model

The Collection model contains all the information about your Collection, such as their mint address, name, and image.

| Property       | Description                                            | Type   |
| -------------- | ------------------------------------------------------ | ------ |
| `mintAddress`  | The mint address of the NFT                            | string |
| `name`         | The on-chain name of the Collection                    | string |
| `description`  | Description of the Collection                          | string |
| `image`        | Image for the Collection                               | string |
| `ownerAddress` | The wallet address of the owner of the Collection      | string |
| `attributes`   | Object with traits and values  of the NFT's attributes | object |

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>List all Collections</strong></td><td></td><td><a href="/pages/ENKq3A54GJCzX6zMpH8U">GET -></a></td><td><a href="/pages/ENKq3A54GJCzX6zMpH8U">/pages/ENKq3A54GJCzX6zMpH8U</a></td></tr><tr><td><strong>Create a Collection</strong></td><td></td><td><a href="/pages/yaiNPICP9TTbwUhaRTbi">POST -></a></td><td><a href="/pages/yaiNPICP9TTbwUhaRTbi">/pages/yaiNPICP9TTbwUhaRTbi</a></td></tr><tr><td><strong>Retrieve a Collection</strong></td><td></td><td><a href="/pages/qXvsmqn0k9GeptvdiEDm">GET -> </a></td><td><a href="/pages/qXvsmqn0k9GeptvdiEDm">/pages/qXvsmqn0k9GeptvdiEDm</a></td></tr></tbody></table>


# List all Collections

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/collections" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/collections?limit=1&page=1" \
        -H "Authorization: Bearer {token}"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import axios from 'axios';

const getCollections = () => {
  try {
    const response = await axios.get('https://api.underdogprotocol.com/v1/collections', {
      params: {
        limit: 1,
        page: 1
      },
      headers: {
        'Authorization': `Bearer ${token}`
      }
    });

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

{% endtab %}
{% endtabs %}

<pre class="language-json" data-title="Response"><code class="lang-json">{
    "results":[{
        "mintAddress":"FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
        "name":"NBA",
        "description":"",
        "image":"https://arweave.net/57PrJ_-S-m2BXOSkaUN2t5ibsjbSrCjElSVUQXXyCq0",
        "attributes":[],
        "uri":"https://arweave.net/DnftYIM2sNZQBXm7qzRiFoUP0S7QtN4q_GkmIcv1UJ8",
        "collectionDetails":{},
        "ownerAddress":"EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
    }],
<strong>    "page": 1,
</strong>    "limit": 1,
    "totalPages": 2,
    "totalResults": 2
}
</code></pre>


# Create a Collection

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/collections" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
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"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
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);
  }
}

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "mintAddress": "FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
    "jobId": "1e10e1e9-e4df-4561-8392-70bdd5ece1d1"
}
```

{% endcode %}


# Retrieve a Collection

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/collections/:collectionAddress" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/collections/6TpvoRVJfJe6VdqfML4yjvp9Qc49LuVNb7uzWtPRZzVV" \
        -H "Authorization: Bearer {token}"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import axios from 'axios';

const collectionAddress = '6TpvoRVJfJe6VdqfML4yjvp9Qc49LuVNb7uzWtPRZzVV';

const getCollection = async () => {
  try {
    const response = await axios.get(`https://api.underdogprotocol.com/v1/collections/${collectionAddress}`, {
      headers: {
        'Authorization': `Bearer ${token}`
      }
    });

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

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
  "mintAddress": "6TpvoRVJfJe6VdqfML4yjvp9Qc49LuVNb7uzWtPRZzVV",
  "name": "Underdog Protocol",
  "description": "Underdog Protocol Collection",
  "image": "https://arweave.net/-RawfoOduz6O18yTuz4zOGbCokzoACaDjoogsSwMaBY",
  "collectionDetails": {},
  "status": "confirmed",
  "ownerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
  "nfts": {
    "results": [
      {
        "mintAddress": "DBqMFAaE8rxJ5emotUywQLWJStGMgGRo3vH52dcKApe6",
        "ownerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
        "name": "Degenerate Ape",
        "image": "https://arweave.net/8FZ8SmhuLDUH-vN0psJuq7GKpCncqGP-03UU_tjmHW8",
        "description": null,
        "status": "confirmed",
        "tokenManager": {}
      }
    ],
    "page": 1,
    "limit": 10,
    "totalPages": 1,
    "totalResults": 1
  }
}
```

{% endcode %}


# NFTs

NFTs are a core part of Underdog — the very reason Underdog exists is so you can seamlessly manage NFTs with your own products.

On this page, we'll dive into the different NFT endpoints you can use to manage NFTs programmatically. We'll look at how to query, create, and update NFTs.

Related NFTs can be part of a Collection. For example, a community can create a Collection and NFTs in that Collection can be Membership NFTs.

## The NFT Model

The NFT model contains all the information about your NFT, such as their mint address, name, and image.

| Property       | Description                                            | Type   |
| -------------- | ------------------------------------------------------ | ------ |
| `mintAddress`  | The mint address of the NFT                            | string |
| `name`         | The on-chain name of the NFT                           | string |
| `description`  | Description of the NFT                                 | string |
| `image`        | Image for the NFT                                      | string |
| `ownerAddress` | The wallet address of the owner of the NFT             | string |
| `attributes`   | Object with traits and values  of the NFT's attributes | object |

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>List all NFTs</strong></td><td></td><td><a href="/pages/ztiSek1hNPPlTfZnamVA">GET -></a></td><td><a href="/pages/ztiSek1hNPPlTfZnamVA">/pages/ztiSek1hNPPlTfZnamVA</a></td></tr><tr><td><strong>Create an NFT</strong></td><td></td><td><a href="/pages/NG5zJS4a4WEewOxxcZEV">POST -></a></td><td><a href="/pages/NG5zJS4a4WEewOxxcZEV">/pages/NG5zJS4a4WEewOxxcZEV</a></td></tr><tr><td><strong>Retrieve an NFT</strong></td><td></td><td><a href="/pages/euiBjPut1CVoRJM7Rhsj">GET -> </a></td><td><a href="/pages/euiBjPut1CVoRJM7Rhsj">/pages/euiBjPut1CVoRJM7Rhsj</a></td></tr><tr><td><strong>Update an NFT</strong></td><td></td><td><a href="/pages/8tSygz72C2vTD4TyED5F">PUT -></a></td><td><a href="/pages/8tSygz72C2vTD4TyED5F">/pages/8tSygz72C2vTD4TyED5F</a></td></tr></tbody></table>


# List all NFTs

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/nfts?limit=2" \
        -H "Authorization: Bearer {token}"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import axios from 'axios';

const getNfts = async () => {
  try {
    const response = await axios.get('https://api.underdogprotocol.com/v1/nfts', {
      params: {
        limit: 2
      },
      headers: {
        'Authorization': `Bearer ${token}`
      }
    });

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

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
  "results": [
    {
      "mintAddress": "FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
      ...
    },
    {
      "mintAddress": "7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB",
      ...
    },
    {
      "mintAddress": "61YbMJWQbboN3PUQen9MrxF53eMkGcnhEVrkX24TcTqK",
      ...    
    }
  ],
  "limit": 3,
  "page": 1,
  "totalPages": 3,
  "totalResults": 8
}
```

{% endcode %}


# Create an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts" method="post" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl --request POST \
  --url https://api.underdogprotocol.com/v1/nfts \
  --header "Content-Type: application/json" \
  --header "Authorization: Bearer {token}" \
  --data '
{
        "collectionAddress": "6TpvoRVJfJe6VdqfML4yjvp9Qc49LuVNb7uzWtPRZzVV",
        "name": "Degenerate Ape",
        "image": "https://arweave.net/6TnZgDc7xDFV_0UFyPgfq2wn6UfRv8-DJgwVwoHfLG4"
}'
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import axios from 'axios';

const createNft = async () => {
  try {
    const response = await axios.post('https://api.underdogprotocol.com/v1/nfts', {
      collectionAddress: '6TpvoRVJfJe6VdqfML4yjvp9Qc49LuVNb7uzWtPRZzVV',
      name: 'Degenerate Ape',
      image: 'https://arweave.net/6TnZgDc7xDFV_0UFyPgfq2wn6UfRv8-DJgwVwoHfLG4'
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }
    });

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

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
    "mintAddress": "DBqMFAaE8rxJ5emotUywQLWJStGMgGRo3vH52dcKApe6",
    "transactionId": "2eebff8e-67a6-4a30-b7e3-7cec2d3f2160"
}
```

{% endcode %}


# Retrieve an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts/:mintAddress" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.underdogprotocol.com/v1/nfts/7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB" \
        -H "Authorization: Bearer {token}"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
import axios from 'axios';

const mintAddress = '7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB';

const getNft = async () => {
  try {
    const response = await axios.get(`https://api.underdogprotocol.com/v1/nfts/${mintAddress}`, {
      headers: {
        'Authorization': `Bearer ${token}`
      }
    });

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

```

{% endtab %}
{% endtabs %}

{% code title="Response" %}

```json
{
  "mintAddress": "7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB",
  "name": "Sacramento Kings",
  "description": "",
  "image": "https://arweave.net/U0PFVZ_LszARt7OgfSiLl--OrRmczn0cNAjw4tYerVQ",
  "attributes": [
    {
      "trait_type": "best player",
      "value": "Chris Webber"
    }
  ],
  "collectionAddress": "FrvZAJ1qZ2vhV17nFdEmw66N3FW5QiHFt6HdqsEh8QNq",
  "ownerAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp"
}
```

{% endcode %}


# Update an NFT

There are two API methods to update an NFT.

* PATCH allows for partial updates so you can just pass in the image or the attribute you want to update
* PUT requires the full NFT metadata to be passed in and updates the full metadata&#x20;

If you just want to make a change to a single attribute or just update the image, the PATCH endpoint should be sufficient.&#x20;

If you are trying to remove attributes, you'll need to use the PUT endpoint to pass in the new attribute body.&#x20;

## Partial Update an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts/:mintAddress" method="put" expanded="false" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

### Example

{% tabs %}
{% tab title="cURL" %}
{% code title="" %}

```bash
curl -X PATCH \
      --url https://api.underdogprotocol.com/v1/nfts/7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer {token}" \
      -d '
{
  "attributes": {
    "best player": "Tyrese Haliburton"
  }
}'

```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code title="" %}

```javascript
import axios from 'axios';

const mintAddress = '7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB';

const partialUpdateNft = async () => {
  try {
    const response = await axios.patch(`https://api.underdogprotocol.com/v1/nfts/${mintAddress}`, {
      attributes: {
        'best player': 'Tyrese Haliburton'
      }
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }
    });

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

{% endcode %}
{% endtab %}
{% endtabs %}

## Update an NFT

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts/:mintAddress" method="patch" expanded="false" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}

### Example

{% tabs %}
{% tab title="cURL" %}
{% code title="" %}

```bash
curl -X PUT \
      --url https://api.underdogprotocol.com/v1/nfts/7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer {token}" \
      -d '
{
  "name": "Sacramento Kings",
  "description": "",
  "image": "https://arweave.net/U0PFVZ_LszARt7OgfSiLl--OrRmczn0cNAjw4tYerVQ",
  "attributes": {
    "best player": "Tyrese Haliburton"
  }
}'

```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code title="" %}

```javascript
import axios from 'axios';

const mintAddress = '7eYfyPfnGzxp8A9TrQJEpKwVCC8nP9viHRRGJ89WzFJB';

const updateNft = async () => {
  try {
    const response = await axios.put(`https://api.underdogprotocol.com/v1/nfts/${mintAddress}`, {
      name: 'Sacramento Kings',
      description: '',
      image: 'https://arweave.net/U0PFVZ_LszARt7OgfSiLl--OrRmczn0cNAjw4tYerVQ',
      attributes: {
        'best player': 'Tyrese Haliburton'
      }
    }, {
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${token}`
      }
    });

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

{% endcode %}
{% endtab %}
{% endtabs %}


# Managed NFTs

Managed NFTs allow you to mint NFTs in a token manager so you have

To create a Managed NFT, set the `managed` parameter to true.&#x20;

### Claimable

The NFT is initially held in an escrow account until someone claims it. There are two ways Managed NFTs can be claimed.&#x20;

1. Setting the `walletAddress` parameter specifies who can claim the NFT.&#x20;
2. Without setting the `walletAddress` parameter, you can generate a private claim link with a one-time keypair.&#x20;

### Revokable

The NFT can be taken back from the holder of the NFT.&#x20;

### Non-Transferable

Unlike NFTs minted directly to a wallet, the holder of the NFT cannot transfer the NFT to another wallet.&#x20;


# Claim

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts/:mintAddress/claim" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}


# Revoke

{% openapi src="/files/Pk3kQO4TRFPtHxdRaylw" path="/v1/nfts/:mintAddress/revoke" method="get" expanded="true" %}
[swagger.json](https://1812349639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMfCqNbNtOQjchD3WfXFA%2Fuploads%2FgiPrImYB9aPmeW2JefRr%2Fswagger.json?alt=media\&token=ba7a249c-f47f-488d-8358-e430bd040504)
{% endopenapi %}


# Zapier Integrations

## Hello. Dive into this.


# Zapier + Viral Loops

How to Integrate Viral Loops with Underdog Protocol Using Zapier

By doing so, you can automatically create a non-transferrable NFT and send a claim link via Gmail every time a new participant joins a campaign on Viral Loops. Additionally, you'll get the participant's referrer number and update the NFT in Underdog Protocol.

<figure><img src="/files/moVPe8BydpI3jfvMkP9P" alt=""><figcaption></figcaption></figure>

Step 1: Trigger When New Participant in Viral Loops The first step in this integration is to set up the trigger. In Zapier, select Viral Loops as the trigger app and choose "New Participant" as the trigger event. Then, follow the prompts to connect your Viral Loops account to Zapier and select the campaign you want to track new participants.

<figure><img src="/files/N35L3frlBY3DVCTW52bx" alt=""><figcaption></figcaption></figure>

Step 2: Create Non-Transferrable NFT in Underdog Next, you'll need to create a non-transferrable NFT in Underdog Protocol. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send to your new participants.

<figure><img src="/files/w8Qj08Gv0dMVWOcFo9F4" alt=""><figcaption></figcaption></figure>

Step 3: Get Claim Link from Underdog for an Email After creating the NFT, you'll need to get the claim link from Underdog Protocol. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send.

<figure><img src="/files/KasRNoTkeXcYb7WJMLak" alt=""><figcaption></figcaption></figure>

Step 4: Send Email in Gmail The next step in this integration is to send an email containing the claim link using Gmail. In Zapier, select Gmail as the action app and choose "Send Email" as the action event. Follow the prompts to connect your Gmail account to Zapier and fill in the required fields, such as the recipient email address, the claim link, and the content of the email.

<figure><img src="/files/8EuecSUkB9tarDfux9Yg" alt=""><figcaption></figcaption></figure>

Step 5: Get Participant's Referrer in Viral Loops Now, you'll need to get the participant's referrer number from Viral Loops. In Zapier, select Viral Loops as the action app again and choose "Find Participant" as the action event. Follow the prompts to connect your Viral Loops account to Zapier and fill in the required fields, such as the participant's email address.

<figure><img src="/files/idKiQosvssaSfNT3S9mn" alt=""><figcaption></figcaption></figure>

Step 6: Update NFT in Underdog Protocol Finally, you'll need to update the NFT in Underdog Protocol with the participant's referrer number. In Zapier, select Underdog Protocol as the action app once more and choose "Update NFT" as the action event. Fill in the required fields, such as the NFT ID, the new point value (based on the referrer number), and any other relevant information.

Congratulations, you've successfully integrated Viral Loops with Underdog Protocol using Zapier! Now, every time a new participant joins a campaign on Viral Loops, they'll receive a non-transferrable NFT claim link via email, and their NFT will be updated with their referrer number.


# Zapier + Github + OpenAI

In this guide, we'll show you how to integrate OpenAI, GitHub, and Underdog Protocol using Zapier. By doing so, you can automatically generate content using OpenAI's GPT-3, DALL·E, or Whisper, create a comment in a GitHub issue, find and update the issue, and update the NFT in Underdog Protocol.

<figure><img src="/files/YEMvhL2gElWKQCDEHvyY" alt=""><figcaption></figcaption></figure>

Step 1: Trigger When New Issue in GitHub The first step in this integration is to set up the trigger. In Zapier, select GitHub as the trigger app and choose "New Issue" as the trigger event. Then, follow the prompts to connect your GitHub account to Zapier and select the repository you want to track new issues.

<figure><img src="/files/g74Lbg5zNAC26MKOhKgC" alt=""><figcaption></figcaption></figure>

Step 2: Send Prompt in OpenAI (GPT-3, DALL·E, Whisper) Next, you'll need to send a prompt to OpenAI's GPT-3, DALL·E, or Whisper. In Zapier, select OpenAI as the action app and choose the appropriate action event based on the OpenAI model you want to use (e.g., "Generate GPT-3 Text").  You will want to use the Body as a way to identify the Problem to get help on from ChatGPT.&#x20;

<figure><img src="/files/SlTQn7iejBiNVMrIHSSF" alt=""><figcaption></figcaption></figure>

Step 3: Create Comment in GitHub After generating content using OpenAI, create a comment in the GitHub issue. In Zapier, select GitHub as the action app again and choose "Create Issue Comment" as the action event. Follow the prompts to connect your GitHub account to Zapier and fill in the required fields, such as the repository, issue number, and the content of the comment, which should include the generated content from OpenAI.

<figure><img src="/files/rQG5yNpHOnLLSGUkalku" alt=""><figcaption></figcaption></figure>

Step 4: Find Issue in GitHub Next, find the issue in GitHub to update it. In Zapier, select GitHub as the action app once more and choose "Find Issue" as the action event. Fill in the required fields, such as the repository and issue number, and follow the prompts to connect your GitHub account to Zapier.

<figure><img src="/files/m3FeS3v8E09mC0Za7F2X" alt=""><figcaption></figcaption></figure>

Step 5: Update Issue in GitHub Now that you've found the issue, update it in GitHub. In Zapier, select GitHub as the action app again and choose "Update Issue" as the action event. Fill in the required fields, such as the repository, issue number, and any updates to the issue title or body, and follow the prompts to connect your GitHub account to Zapier.

<figure><img src="/files/Sv2m9kaF3o6L7oJnuRPb" alt=""><figcaption></figcaption></figure>

Step 6: Update NFT in Underdog Protocol Finally, update the NFT in Underdog Protocol based on the content generated by OpenAI. In Zapier, select Underdog Protocol as the action app and choose "Update NFT" as the action event. Fill in the required fields, such as the NFT ID, the new point value, and any other relevant information, and follow the prompts to connect your Underdog Protocol account to Zapier.

Congratulations, you've successfully integrated OpenAI, GitHub, and Underdog Protocol using Zapier! Now, every time a new issue is created in GitHub, content will be generated using OpenAI, a comment will be added to the issue, the issue will be found and updated, and the NFT in Underdog Protocol will be updated accordingly.


# Zapier + Github

How to Integrate GitHub with Underdog Protocol Using Zapier

In this guide, we'll show you how to integrate GitHub with Underdog Protocol using Zapier. By doing so, you can automatically create a non-transferrable NFT and post a claim link as a comment in a GitHub issue every time a new collaborator joins a repository.

<figure><img src="/files/bTrY6bnpP2iRzpdFJbPu" alt=""><figcaption></figcaption></figure>

Step 1: Trigger When New Collaborator in GitHub The first step in this integration is to set up the trigger. In Zapier, select GitHub as the trigger app and choose "New Collaborator" as the trigger event. Then, follow the prompts to connect your GitHub account to Zapier and select the repository you want to track new collaborators.

<figure><img src="/files/KDqyNkQAEJyjDFI3PBkf" alt=""><figcaption></figcaption></figure>

Step 2: Create Non-Transferrable NFT in Underdog Next, you'll need to create a non-transferrable NFT in Underdog Protocol. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send to your new collaborators.

<figure><img src="/files/5jThi06DKYLMGHNeJrcT" alt=""><figcaption></figcaption></figure>

Step 3: Get Claim Link from Underdog for an Email After creating the NFT, you'll need to get the claim link from Underdog Protocol. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send.

<figure><img src="/files/mZVVJQxUvH11UJpfJYMD" alt=""><figcaption></figcaption></figure>

Step 4: Create Comment in GitHub The final step in this integration is to create a comment in a GitHub issue. In Zapier, select GitHub as the action app and choose "Create Issue Comment" as the action event. Follow the prompts to connect your GitHub account to Zapier and fill in the required fields, such as the repository, issue number, and the content of the comment, which should include the claim link.

Congratulations, you've successfully integrated GitHub with Underdog Protocol using Zapier! Now, every time a new collaborator joins a repository, an NFT claim link will be posted as a comment in a GitHub issue for them to claim their non-transferrable NFT.


# Zapier + Mailchimp

How to Integrate Mailchimp with Underdog Protocol Using Zapier

In this guide, we'll show you how to integrate Mailchimp with Underdog Protocol using Zapier. By doing so, you can automatically create a non-transferrable NFT and send it to your subscribers' emails every time someone joins your mailing list.

![](/files/OTGmYx84mTysNAuLvco7)

Step 1: Trigger When New Subscriber in Mailchimp The first step in this integration is to set up the trigger. In Zapier, select Mailchimp as the trigger app and choose "New Subscriber" as the trigger event. Then, follow the prompts to connect your Mailchimp account to Zapier and select the desired audience (list) you want to track new subscribers.

![](/files/b5Ebok0X7glOx7XVlFUw)

Step 2: Create Non-Transferrable NFT in Underdog Next, you'll need to create a non-transferrable NFT in Underdog Protocol. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send to your new subscribers.

![](/files/SDmYR9IjjS2ZEzTzMsP9)

Step 3: Get Claim Link from Underdog for an Email After creating the NFT, you'll need to get the claim link from Underdog Protocol for an email. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send.

![](/files/TojKpC8u4aOf5iFNNEOo)

Step 4: Create and Send an Email Using Gmail The final step in this integration is to create and send an email using Gmail. In Zapier, select Gmail as the action app and choose "Send Email" as the action event. Follow the prompts to connect your Gmail account to Zapier and fill in the required fields, such as the recipient email address, the claim link, and the content of the email.

Congratulations, you've successfully integrated Mailchimp with Underdog Protocol using Zapier! Now, every time a new subscriber joins your mailing list, they'll receive a non-transferrable NFT in their email.


# Zapier + Shopify

How to Integrate Shopify with Underdog Protocol Using Zapier

In this guide, we'll show you how to integrate Shopify with Underdog Protocol using Zapier. By doing so, you can automatically send a non-transferrable NFT to your customers' emails every time they make a new paid order.

![](/files/AJmLMab5up9neHE4Ackd)

Step 1: Trigger When Order is Paid The first step in this integration is to set up the trigger. In Zapier, select Shopify as the trigger app and choose "New Paid Order" as the trigger event. Then, follow the prompts to connect your Shopify account to Zapier.\
\
![](/files/Cxg6mK3dfR7bkVBF2eWJ)

Step 2: Create an Action condition to only run if an order is executed and paid on the backend in Shopify.&#x20;

![](/files/y6cgWU3pHOkaJvmyfleU)

Step 3: Create Non-Transferrable NFT in Underdog Next, you'll need to create a non-transferrable NFT in Underdog Protocol. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send to your customers.

![](/files/hA3l8frucei9nKKGL2i8)

Step 4: Get Claim Link from Underdog for an Email After creating the NFT, you'll need to get the claim link from Underdog Protocol for an email. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as the project and NFT that you want to send.

![](/files/OhFgjm8mELBNI1K7ZPZi)

Step 5: Create and Send an Email Using Gmail The final step in this integration is to create and send an email using Gmail. In Zapier, select Gmail as the action app and choose "Send Email" as the action event. Follow the prompts to connect your Gmail account to Zapier and fill in the required fields, such as the recipient email address, the claim link, and the content of the email.

![](/files/RgKU3kyj1M4Z6Jzb4xn1)

Step 6: Update NFT After sending the email, you'll need to update the NFT with a certain amount of points. In Zapier, select Underdog Protocol as the action app once more and choose "Update NFT" as the action event. Fill in the required fields, such as the NFT ID, the new point value, and any other relevant information.

Congratulations, you've successfully integrated Shopify with Underdog Protocol using Zapier! Now, every time a customer makes a new paid order, they'll receive a non-transferrable NFT in their email and have their NFT updated with a certain amount of points.


# Zapier + Calendly

## Zapier + Calendly

<br>

{% embed url="<https://www.loom.com/share/6cd1230aac8747609f1d67f9b193651f>" %}

#### How to Integrate Calendly with Underdog Protocol Using Zapier

In this guide, we'll show you how to integrate Calendly with Underdog Protocol using Zapier. By doing so, you can automatically send a non-transferrable NFT to someone's email every time they book time with you through Calendly.&#x20;

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-Nc5mtU8gut/599d71f9576558a7a1ab0667ed696e9da88ad335a2f84589948d2f1145aeaac2ceabc528af6dc456922ae5bff01a2054b63e2412b3b6885ec9cbaa02d2fa2054c7fb3412b6c03e2c5805ea269c8ed322eae3462ccf45801cede4ff257bd0de20a5d91058" alt=""><figcaption></figcaption></figure>

\
Step 1: Trigger When Eventee SchedulesThe first step in this integration is to set up the trigger. In Zapier, select Calendly as the trigger app and choose "Invitee Created" as the trigger event. Then, follow the prompts to connect your Calendly account to Zapier.<br>

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-h0tpZ18yxF/520859905cb3750a631c2822076a5ea7ba1e1f3dd964a146ac61306fc55f9e1be36730a6206f3919a4db64ccece1a901d21815338648a4cf08bf8282c5a989cf4563d9759f45d74fb0c2520e0af12277ff11194f5d28889f7899a84f6cdb9dbf90c736d6" alt=""><figcaption></figcaption></figure>

\
Step 2: Create Non-Transferrable NFT in UnderdogNext, you'll need to create a non-transferrable NFT in Underdog Protocol at app.underdogprotocol.com. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as choosing the project you want to send.<br>

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-cfT6NCqOzG/9577874ea01920cc00cd54712a60ef4025d199608bb40350aae8f193034c3e47fe098c7f80e19f3f7dc348a5b9191728a065f3f396eba78b8f4e5cc067d47d4b0688f6c2925326bc028b0c47ea05bbab0b5121fccc34fbaf51dae8dbc73bdb8768a5fc53" alt=""><figcaption></figcaption></figure>

Step 3: Get Claim Link from Underdog for an EmailAfter creating the NFT, you'll need to get the claim link from Underdog Protocol for an email. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields - such as the project and NFT that you want to send to in Calendly. You will need to have a created project and NFT for this to work!<br>

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-b796tjCNZ3/624a4ef0bcfd3e638cbe6c041473e5aa9e43920ca8d5260894fca8c7d181e6b0009f124095bcdd5e19eabf2d15cc6d2bb81cc52807f51b2d1e694c2c9244ca56a3248dd6ebfc997de34931d2dddd11dd1a45edb044275986a7f50a800160b70c7fd6cf62" alt=""><figcaption></figcaption></figure>

Step 4: Create and Send an Email Using GmailThe final step in this integration is to create and send an email using Gmail. In Zapier, select Gmail as the action app and choose "Send Email" as the action event. Follow the prompts to connect your Gmail account to Zapier and fill in the required fields, such as the recipient email address, the claim link, and the content of the email.

\
Congratulations, you've successfully integrated Calendly with Underdog Protocol using Zapier! Now, every time someone books time with you through Calendly, they'll receive a non-transferrable NFT in their email.\
\
\ <br>


# Zapier + Hubspot

## Zapier + HubSpot&#x20;

{% embed url="<https://www.loom.com/share/b3b6a6d79bfa4c61a6b10595f7e70169>" %}

#### How to Integrate HubSpot with Underdog Protocol Using Zapier

Introduction: In this guide, we'll show you how to integrate HubSpot with Underdog Protocol using Zapier. By doing so, you can automatically send a non-transferrable NFT to someone's email every time they are added to your CRM in HubSpot.

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-5xb6VYCz89/8fc441c6639a815c9c45414498b0c780b81a33bfdadcb7b80e17225b4e407eef1a2a6c51f79ad4ca935d31be1bcb51fc38a8521b2b2ea51b1a42c9f9069e94184ae6fb9fa42a275e3e9db043135db2c12a4c30e11bb2a1c7f5fa312cb64997a27557a1c0" alt=""><figcaption></figcaption></figure>

#### Step 1: Trigger When Contact Added

The first step in this integration is to set up the trigger. In Zapier, select HubSpot as the trigger app and choose "New Contact" as the trigger event. Then, follow the prompts to connect your HubSpot account to Zapier.

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-AE6ltXo0Lh/fa5f98418cb665a4dfb680b30aa0c69a52f247463596a72e24d44ff992bccdfa8fb64ebb2203705101d16051f6fbb8ed70fc03608e8b28a75bd675eae9a84a85b2047703cdd9e16c52805c22a3468df676a4b78abe592b00bec36160f70395afb18519fc" alt=""><figcaption></figcaption></figure>

#### Step 2: Create Non-Transferrable NFT in Underdog

Next, you'll need to create a non-transferrable NFT in Underdog Protocol at app.underdogprotocol.com. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as choosing the project you want to send.<br>

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-IjTtgCZ7do/eef95834d4462c0e25f9f685e073f3e1381c088545318ebd6dd3e8a2b24abe5e2bdded03a2b8491381f83c7b46036a6e6a823b2ec3897008c1b561f5bea7e67655a3d771862ba343c6e78d16d3766637017d5234b4ffa7ab1d17fbeb71f4182bd1851c35" alt=""><figcaption></figcaption></figure>

#### Step 3: Get Claim Link from Underdog for an Email

After creating the NFT, you'll need to get the claim link from Underdog Protocol for an email. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields - such as the project and NFT that you want to send. You will need to have a created project and NFT for this to work!

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-TvMMPg16dZ/8523563161485576a051e8bebf4d860566b1d76ee036e3282f7d85c82eefbcaf8fee139a7477611de6d21d905240d46cdcaf6488f3be161b5fd1e58ca1c81d233b43e682b88b9bb1fea3df722790e3d718c2f6d1d9166bcd34ce1d511f1e4e107d2135fb" alt=""><figcaption></figcaption></figure>

#### Step 4: Create and Send an Email Using Gmail

The final step in this integration is to create and send an email using Gmail. In Zapier, select Gmail as the action app and choose "Send Email" as the action event. Follow the prompts to connect your Gmail account to Zapier and fill in the required fields, such as the recipient email address, the claim link, and the content of the email.

\
Congratulations, you've successfully integrated HubSpot with Underdog Protocol using Zapier! Now, every time someone is added to your CRM in HubSpot, they'll receive a non-transferrable NFT in their email.


# Zapier + Typeform

#### How to Integrate Typeform with Underdog Protocol Using Zapier

{% embed url="<https://www.loom.com/share/02abc2a0a4ff453ea815aea88f583880>" %}

\
In this guide, we'll show you how to integrate Typeform with Underdog Protocol using Zapier. By doing so, you can automatically send a non-transferrable NFT to someone's email every time they fill out a form in Typeform.

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-LqE7pxwgC0/08d4abee037422e3e11d6b276f2892845cbfad982d369d41e7600a2a5e4915833be0faf0819bd20ac9795a0705315ca2a3a56ef1445be3ea591d1de712cbcfbedd4b0073e1208fb5c0fb20c9e5ad8bdd450efdf29337198cf98040f6b46f71caaa5f8b02" alt=""><figcaption></figcaption></figure>

\
Step 1: Trigger When New Entry in FormThe first step in this integration is to set up the trigger. In Zapier, select Typeform as the trigger app and choose "New Entry" as the trigger event. Then, follow the prompts to connect your Typeform account to Zapier and select the form you want to use for this integration.<br>

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-FFvj6leqjw/a7d58a5608f553a1c64d72a7a215a7c97bc015662886b5ff91e9b159db7d368093f0471b376b7b8b030b37b95cab67dacd9934f6779566695091319daabe01fa397056ec437e7c0bcf0caca7fdd02946d216623276f4d4b0a943e25ed0b70d3a47d63c26" alt=""><figcaption></figcaption></figure>

Step 2: Create Non-Transferrable NFT in UnderdogNext, you'll need to create a non-transferrable NFT in Underdog Protocol at app.underdogprotocol.com. In Zapier, select Underdog Protocol as the action app and choose "Create Non-Transferrable NFT" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields, such as choosing the project you want to send.

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-jpCgxEIwjr/e34502cc94a0122864799861a1181b8c122e5d7944a82945d3dcaf494a38ce8476edbbec98c620abc3aabdc85c44992bcadca97bd558c798dae39c94dd62159c728e78074ff481420dd921f17aa8da87aded743bb13f2155b5876681680c37a67188da2c" alt=""><figcaption></figcaption></figure>

Step 3: Get Claim Link from Underdog for an EmailAfter creating the NFT, you'll need to get the claim link from Underdog Protocol for an email. In Zapier, select Underdog Protocol as the action app again and choose "Get Claim Link" as the action event. Follow the prompts to connect your Underdog Protocol account to Zapier and fill in the required fields - such as the project and NFT that you want to send to the person from Typeform. You will need to have a created project and NFT for this to work!

<figure><img src="https://codahosted.io/docs/KSlfBRd5xE/blobs/bl-UFS2LXxDnJ/978c89035bd651f60804c81f5cd60fe93248e79d24d5737d2e42558035de5eb6193bd3253ba955f235daf6057e82fc3e5c3978a3212aea8f8d125198f04c66c45381ae6b6b1ec95954d64c23a277318a65925d9752d771dcd85b58c726e09a4220579ce3" alt=""><figcaption></figcaption></figure>

\
Step 4: Create and Send an Email Using GmailThe final step in this integration is to create and send an email using Gmail. In Zapier, select Gmail as the action app and choose "Send Email" as the action event. Follow the prompts to connect your Gmail account to Zapier and fill in the required fields,  such as the recipient email address, the claim link, and the content of the email.<br>

Congratulations, you've successfully integrated Typeform with Underdog Protocol using Zapier! Now, every time someone fills out a form in Typeform, they'll receive a non-transferrable NFT in their email.

## <br>

\ <br>


# Underdog with Airtable

Learn how to add Underdog to your Airtable Automations to manage your community with dynamic NFTs

<figure><img src="/files/j1rv1wKdRoSmbQIAYOll" alt=""><figcaption></figcaption></figure>

The guide will walk through how to integrate Underdog into your Airtable setup. By the end of this guide, you'll build a system that:

1. Creates Managed NFTs for your community
2. Emails claim links for your NFT to each user
3. Updates the Managed NFT as you update your Airtable base

## Prerequisites

* [ ] Underdog Protocol API
* [ ] Airtable Account

## Getting Started

The guide will be broken up into four stages.&#x20;


# Create a Project

<figure><img src="/files/h2Zra7P5hMoxxsbF0JxU" alt=""><figcaption></figcaption></figure>

This is the easiest and most straightforward piece. You will want to visit our dashboard to create this project - app.underdogprotocol.com - don't forget to generate your API key.&#x20;


# Create NFT on Form Submission

<figure><img src="/files/2GVcauwQjL8XdSYzhUxt" alt=""><figcaption></figcaption></figure>

In this section, we'll walk through how to create an NFT with the Underdog API when someone submits the Airtable Form.&#x20;

### Prerequisites

* [ ] Project ID
* [ ] Underdog API Key

### Create an Airtable Form

<figure><img src="/files/6xLgf2Ue4Wz7ebAvW9fH" alt=""><figcaption></figcaption></figure>

We'll be using an Airtable form to collect emails to send claim links for our Managed NFT. We've set up an example Airtable Base and Airtable Form to use as a template. You’ll need to copy and set up the automation below or request access to copy the automation from here.

### Create an NFT on Form Submission

<figure><img src="/files/LoIXWGd3NuFQKCo5uU61" alt=""><figcaption></figcaption></figure>

Get the trigger to When a form is submitted which will kick off the automation when someone submits their email address.&#x20;

In this automation, we'll have two steps:

* A script to POST to the Underdog API and create a Managed NFT.&#x20;
* Update the created record from form submission with the NFT's mint address.&#x20;

Here is an example script you can copy-paste into your Airtable Automation. You'll need to replace the parameters PROJECTid, NFT\_NAME, and NFT\_IMAGE\_URL with your own data and add your Underdog API Key

```
const response = await fetch(

'https://dev.underdogprotocol.com/v2/projects/n/1/nfts' , 
{


method: "POST",
body: JSON.stringify ({
name: "The 1990s", 
image: "https://www.gamespot.com/a/uploads/scale_super/1562/15626911/3501525-remembering1999-movies-tv-promo.jpg",
}), 

headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer b4e9ee1d2420d0.ec947c3bfd2049059d3962e74be1959c'

}

});

const responsejson = await response.json();
output.set("mintAddress", responsejson.mintAddress) 


```


# Send a Claim Link

<figure><img src="/files/9s1HgAopOlwmPdkhj7zU" alt=""><figcaption></figcaption></figure>

With our first automation creating an NFT in our Collection set up, we can now create a second automation to send the claim link.&#x20;

Creating an NFT with the Underdog API runs asynchronously as a Transaction. Once that Transaction completes, we can get the claim link for the  NFT and send the email.&#x20;

### Prerequisites

* [ ] Project ID from Stage 1
* [ ] Underdog API Key

There is no need for a webhook. You will only need to know your PROJECTId to generate the nft claim link. This is because of the way we have created our NFT architecture.

Here's an example script that you can run&#x20;

```
const response = await fetch (
'https://dev.underdogprotocol.com/v2/projects/n/1/nfts/1/claim', { 
headers: {'Authorization': 'Bearer b4e9ee1d2420d0.ec947c3bfd2049059d3962e74be1959c'}
})
```


# Updating NFTs

<figure><img src="/files/Jg4VcHWwYda6kq9tlMUs" alt=""><figcaption></figcaption></figure>

## Airtable Automation for Updated Record

Let's start by adding a "Points" column to your Airtable base. For this example, it will be the only attribute on your NFT that we can update whenever one of our users does an action we want to reward.&#x20;

We can now create an Airtable Automation whose trigger is **When record updated** and watch for the **Points** column.&#x20;

<figure><img src="/files/dJ52RSiXVKkQJXhSChvF" alt=""><figcaption></figcaption></figure>

## Updating the NFT

Once we have the updated record, we can take the mint address and points from the record and pass it into our script action.&#x20;

Here is an example script that you can copy-paste into Airtable.&#x20;

```typescript
curl --location --request PATCH 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts/1' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "attributes": {
        "points": "40000"
    }
}'
```

Now whenever you update the **Points** column within Airtable, the changes will automatically be reflected on the corresponding NFT.&#x20;


# Web3 Blog

Create a web3 blog where your readers can collect blog posts as NFTs

The Underdog API makes it easy to build your own web3 blog. Using the API, you can:

* Create Collections for each of your blog posts
* Allow your readers to collect blog posts as NFTs

You can fork an open-source example of a web3 blog to quickly get started. You'll find details on how to set up the repo in the README.&#x20;

{% embed url="<https://github.com/UnderdogProtocol/underdog-nextjs-blog-starter>" %}

In the guide, I'll walk through the three pieces of the repo that use the Underdog API to create NFTs for blog posts.&#x20;

1. [Next.js API Endpoint](#next.js-api-endpoint)
2. [Collect Button](#collect-button)
3. [Markdown Blog Posts](#markdown-blog-posts)

## Next.js API Endpoint

In `pages/api/nfts.ts`, we use two API endpoints

1. `GET /v1/nfts` to get information if the currently connected wallet has an NFT in the blog post's Collection
2. `POST /v1/nfts` to create an NFT in the Collection when a reader collects the blog post

<pre class="language-typescript" data-title="pages/api/nfts.ts" data-line-numbers><code class="lang-typescript"><strong>import { UNDERDOG_API_KEY, UNDERDOG_API_URL } from "@/lib/constants"
</strong>import { metadataImageUrl } from "@/lib/underdog"
import axios from "axios"
import { NextApiRequest, NextApiResponse } from "next"

export default async function handler(
  req: NextApiRequest,
  res: NextApiResponse
) {
  try {
    if (req.method === "GET") {
      const response = await axios.get(
        `${UNDERDOG_API_URL}/v1/nfts?ownerAddress=${req.query.ownerAddress}&#x26;collectionAddress=${req.query.collectionAddress}`,
        {
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${UNDERDOG_API_KEY}`,
          },
        }
      )

      res.status(200).json(response.data)
    }

    if (req.method === "POST") {
      const response = await axios.post(
        `${UNDERDOG_API_URL}/v1/nfts`,
        {
          name: req.body.name,
          description: req.body.description,
          image: metadataImageUrl(req.body.collectionAddress),
          collectionAddress: req.body.collectionAddress,
          ownerAddress: req.body.ownerAddress,
        },
        {
          headers: {
            "Content-Type": "application/json",
            Authorization: `Bearer ${UNDERDOG_API_KEY}`,
          },
        }
      )

      res.status(200).json(response.data)
    }
  } catch (e: any) {
    console.log(e)
    res.status(400).json({ error: e.message })
  }
}
</code></pre>

## Collect Button

Within each blog post, we have a `CollectButton` component that mints the NFT directly to the reader's wallet.&#x20;

The key part of the component is the `handleCollect` function where we take the blog post metadata (title, description, and Collection address) and send that data to our Next.js API endpoint we just created.

{% code title="components/CollectButton/index.tsx" lineNumbers="true" %}

```typescript
...
const handleCollect = async () => {
  if (publicKey) {
    toggleCollecting()
    await axios.post("/api/nfts", {
      name: entry.title,
      description: entry.description,
      collectionAddress: entry.collectionAddress,
      ownerAddress: publicKey?.toString(),
    })
    await refreshNfts()
    toggleCollecting()
  }
}
...
```

{% endcode %}

## Markdown Blog Posts

Within each blog post, we need to include information about our blog post as well as the Collection we want the blog post NFTs to be a part of.&#x20;

{% code title="pages/your-blog-post/index.mdx" %}

```typescript
export const entry = {
  title: "Your Blog Post",
  description: "Add a description for your blog post",
  collectionAddress: "E6H1MYDiFhUkmAWPnxTMS9iEPpJtvMU6za5pvqUt6Hm3"
}
```

{% endcode %}

Within the Underdog dashboard, you can create a new Collection for each blog post and upload unique artwork for each NFT.&#x20;


# Mint NFTs on iPhone

How to use the Underdog API to mint your iPhone photos as an NFT

With the Underdog API, you can make it seamless to mint NFTs on your phone. Using Apple Shortcuts, you can select a photo you can turn into an NFT without buying Solana. If you'd like to test the final version of the Apple Shortcut, you can add it to your phone below.&#x20;

{% embed url="<https://www.icloud.com/shortcuts/7491d601689641f0a8cbc88ae28b9490>" %}

## Prerequisites

* [ ] iPhone with Apple Shortcuts
* [ ] Underdog API Key

## Getting Started

There are three parts to creating an NFT with Apple Shortcuts:

1. Generating an image URL for your photo
2. Prompting a name for your NFT
3. Passing the data to the Underdog API

## Generating an Image URL

<figure><img src="/files/Rmt59P31iIix2njjFZkb" alt=""><figcaption></figcaption></figure>

The Underdog API expects an image URL to be passed into API. The easiest way to get an image URL for a photo on your phone is to upload it to Imgur.&#x20;

Imgur expects a JPEG or PNG (photos on your phone are stored as HEIC). You'll also need to toggle the settings to **Upload Anonymously** and get the **Direct Link** after the Shortcut step completes.&#x20;

## Prompting a Name for your NFT

You can now prompt for user input to name the NFT for your uploaded image. This will give us all the variables we need to create an NFT.&#x20;

## Creating an NFT with the Underdog API

<figure><img src="/files/VMWBe7NsHnMQosbqZtzq" alt=""><figcaption></figcaption></figure>

We'll now POST to the NFT endpoint the name and image URL from the previous steps. Note that you'll an Underdog API Key for this to work which you can generate on our [dashboard](https://app.underdogprotocol.com).&#x20;

The API request will return the mint address (i.e. the unique identifier for the NFT) which you can then use to view on a block explorer like SolScan.&#x20;

## Further Reading

{% content-ref url="/pages/NG5zJS4a4WEewOxxcZEV" %}
[Create an NFT](/resources/v1/nfts/create-an-nft)
{% endcontent-ref %}


# Solana Mobile

<figure><img src="/files/kGUFvsb484p8FQjZLqeF" alt=""><figcaption></figcaption></figure>

Solana Mobile, creators of the SAGA, wanted to develop a unique rewards ecosystem for users who ordered the phone early. They aimed to integrate an identifier for SAGA phone ownership and a loyalty rewards system based on user activities, all within a tight timeline of \~1 month until launch.ChallengeSolana Mobile needed an all-in-one NFT management solution that:

* Could be integrated directly into their phones
* Provided an API for ecosystem partners to verify SAGA ownership
* Tracked user activities and ownership in a non-transferable and updatable NFT

SolutionSolana Mobile partnered with Underdog to implement a dynamic digital collectible for SAGA phone users.

* The Underdog API was integrated into the SAGA phones, verifying ownership and capturing holder activity within the dApp store. Collectible attributes were updated based on user activities, unlocking perks and rewards accordingly.

ResultsWith the Underdog integration, Solana Mobile:

* Launched their rewards ecosystem with partners like Magic Eden, Audius, and Dialect
* Minted 20,000 NFTs and introduced a Solana Mobile Welcome Pack for loyal customers

Implemented the rewards ecosystem within just 2 weeksHow Underdog HelpedUnderdog's Web3 API allowed Solana Mobile to seamlessly integrate NFTs into their phones, enhancing customer loyalty and engagement. Key benefits for Solana Mobile included:

* Rapid implementation of a rewards ecosystem
* Streamlined NFT management with the Underdog NFT API and Management Dashboard
* Successful partnerships with ecosystem partners for a holistic rewards experience
* Ability to identify their early adopters and add apps ways to identify their mobile users

Steps

* Mint SAGA Token: A unique SAGA Token (NFT) is minted for each SAGA smartphone, representing ownership and serving as the foundation for the rewards ecosystem.
* Soulbound to Your Phone: The SAGA Token is "soulbound" to the customer's phone, ensuring it is non-transferable and tied exclusively to that specific device.
* Download and Use Apps: Customer activities, such as downloading and using apps, are tracked and linked to their SAGA Token.
* NFT Updates: The SAGA Token's attributes are updated in real-time based on the customer's app usage and activities, unlocking new rewards tiers.
* Accumulate XP/Points and Unlock Rewards: As users interact with apps on their SAGA smartphone, they accumulate experience points (XP) or other point systems linked to their SAGA Token, unlocking various rewards.

By leveraging Underdog's capabilities, Solana Mobile successfully implemented a unique rewards ecosystem that drove customer loyalty and satisfaction.


# Parcl

<figure><img src="/files/lkvppiquChFm3QviRLTb" alt=""><figcaption></figcaption></figure>

Parcl, a real estate De-Fi platform on Solana, integrated Underdog to enhance user engagement and grow their community. Underdog's NFT capabilities enabled Parcl to reward early adopters, foster exclusive communities, and achieve a successful launch with minimal engineering resources.GoalsParcl aimed to:

* Reward early users for their platform usage
* Offer access to exclusive communities within the platform
* Ensure a quick turnaround of approximately 2 weeks for the launch

Parcl's requirements included:

* Comprehensive NFT management (minting, updating, managing)
* Seamless integration with their app
* Minimal engineering resources for integration

SolutionParcl partnered with Underdog to integrate their API into the platform's dApp, allowing for comprehensive NFT management and a seamless user experience.

* The Dynamic Digital Collectible tracked user trading activity and evolved based on users' actions, granting access to rewards such as NFTs, points, USDC, and more.

ResultsWith the Underdog integration, Parcl:

* Successfully implemented the solution in just 2 weeks
* Onboarded 500 new users during the #SOLMate campaign

How Underdog Helped

* Underdog's Web3 API allowed Parcl to integrate NFTs seamlessly into their platform, with minimal engineering resources required.&#x20;
* This resulted in a boost in user engagement, rewarding users, and fostering a sense of community within the platform.

Key benefits for Parcl:

* Comprehensive NFT management tools
* Simplified NFT integration for a variety of products
* Enhanced user engagement through gamification
* Customizable reward system for user retention

Next Steps

* Parcl plans to launch a recurring Rewards Program using badges and on-chain points, further enhancing user engagement and community growth.

About Parcl

* Parcl is a real estate de-fi platform on Solana that allows traders to invest in different markets around the world. \
  \
  Underdog Features Used
* NFT Management API
* Dynamic Digital Collectibles
* Gamification and Reward Systems

Impressive Results

* 2-week implementation time
* 500 new users onboarded

By leveraging Underdog's capabilities, Parcl achieved its goals of rewarding early adopters, promoting platform usage, and fostering a thriving community.


