---
title: "Upload a File to a project and pin it to IPFS"
method: POST
path: "/UploadNft/{apikey}/{nftprojectid}"
tags: ["UploadNft"]
---

# Upload a File to a project and pin it to IPFS

`POST /UploadNft/{apikey}/{nftprojectid}`

With this API you can upload a file to IPFS and add it to a project. You can upload the file as BASE64 Content or as URL Link or as IPFS Hash.
If you submit Metadata, this Metadata will be used instead of the Metadatatemplate from the project. You can either submit Metadata or MetadataPlaceholder, but not both (because it makes no sense).
The Metadata field is optional and if you dont use it, it will use the Template from your project. It is poosible to mix both versions in one project. You can have one nft with own metadata and other nfts
with the template.

## Path parameters

- `apikey` string, required
- `nftprojectid` integer, required

## Request body

- UploadNftClass
  - `assetName` string, nullable
  - `previewImageNft` NftFile
    - `mimetype` string, nullable
    - `fileFromBase64` string, nullable
    - `fileFromsUrl` string, nullable
    - `fileFromIPFS` string, nullable
    - `description` string, nullable
    - `displayname` string, nullable
    - `metadataPlaceholder` MetadataPlaceholderClass[], nullable
      - `name` string, nullable
      - `value` string, nullable
  - `subfiles` NftFile[], nullable
    - `mimetype` string, nullable
    - `fileFromBase64` string, nullable
    - `fileFromsUrl` string, nullable
    - `fileFromIPFS` string, nullable
    - `description` string, nullable
    - `displayname` string, nullable
    - `metadataPlaceholder` MetadataPlaceholderClass[], nullable
      - `name` string, nullable
      - `value` string, nullable
  - `metadata` string, nullable
  - `metadataCip68` string, nullable

## Response `200`

Returns the UploadNftResult Class

- UploadNftResultClass
  - `nftId` integer
  - `nftUid` string, nullable
  - `ipfsHashMainnft` string, nullable
  - `ipfsHashSubfiles` string[], nullable
  - `metadata` string, nullable
  - `assetId` string, nullable
  - `metadataAptos` string, nullable
  - `metadataSolana` string, nullable

## Other responses

- `401` — The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)
- `404` — No Image Content was provided. Send a file either as Base64 or as Link or IPFS Hash
- `406` — See the errormessage in the resultset for further information
- `409` — There is a conflict with the provided images. Send a file either as Base64 or as Link or IPFS Hash
- `500` — Internal server error - see the errormessage in the resultset

---

[API](https://skmtc.net/nmkr/apis/nmkr-studio-api-mainnet-deprecated.md) · [All operations](https://skmtc.net/nmkr/apis/nmkr-studio-api-mainnet-deprecated/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nmkr/nmkr-studio-api-mainnet-deprecated/revisions/e8a273d527a4/schema)
