---
agentTools:
  projectIndex: https://somnio.readme.io/llms.txt
---

# Create an Item

The `POST` route under the Item resource facilitates the creation of a new Item within a specified Metafuse project. By providing necessary parameters in the request body, users can precisely define the characteristics of the new Item. The required fields for this operation include `projectId`, `tokenId`, and `visibility`. Here’s an insight into the parameters:

- `projectId`: A unique identifier for the project, ensuring the new Item is associated with the correct project.
- `tokenId`: A numerical identifier starting from 1, providing a unique identity to the new Item within the project.
- `visibility`: Dictates the visibility of the Item's image and metadata, accepting values of either `PUBLIC` or `PRIVATE`.

Additional parameters include:

- `image`: A base64 encoded string that represents the image associated with the Item.
- `allowDuplicatesOverride`: A boolean flag, defaulted to `false`, allowing the ability to create a duplicate of an item that may already exist.
- `traits`: An array of objects defining various traits of the Item. Each object contains two properties:
  - `value`: The value of the trait, which can be either a string or a number.
  - `trait_type`: A string representing the type of trait.

Utilizing this route, developers can meticulously craft new Items, embedding necessary traits and attributes aligning with the project’s requirements. Each parameter plays a pivotal role in delineating the Item’s properties, ensuring a structured and coherent creation process within the Metafuse platform.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Metafuse Gateway",
    "description": "This API is a comprehensive service designed to enable smooth interaction with our asset management system. This includes operations at the project, item, and layer levels, catering to a wide array of functionalities ranging from image uploading to specific attribute modifications. It's particularly crafted for handling digital assets, especially images, providing users with the flexibility to manage their resources efficiently.",
    "version": "2023-06-20T18:00:42Z"
  },
  "servers": [
    {
      "url": "https://gateway.metafuse.me"
    }
  ],
  "paths": {
    "/v1/item": {
      "summary": "Create a New Item",
      "description": "The `POST` route under the Item resource facilitates the creation of a new Item within a specified Metafuse project. By providing necessary parameters in the request body, users can precisely define the characteristics of the new Item. The required fields for this operation include `projectId`, `tokenId`, and `visibility`. Here’s an insight into the parameters:\n\n- `projectId`: A unique identifier for the project, ensuring the new Item is associated with the correct project.\n- `tokenId`: A numerical identifier starting from 1, providing a unique identity to the new Item within the project.\n- `visibility`: Dictates the visibility of the Item's image and metadata, accepting values of either `PUBLIC` or `PRIVATE`.\n\nAdditional parameters include:\n\n- `image`: A base64 encoded string that represents the image associated with the Item.\n- `allowDuplicatesOverride`: A boolean flag, defaulted to `false`, allowing the ability to create a duplicate of an item that may already exist.\n- `traits`: An array of objects defining various traits of the Item. Each object contains two properties:\n  - `value`: The value of the trait, which can be either a string or a number.\n  - `trait_type`: A string representing the type of trait.\n\nUtilizing this route, developers can meticulously craft new Items, embedding necessary traits and attributes aligning with the project’s requirements. Each parameter plays a pivotal role in delineating the Item’s properties, ensuring a structured and coherent creation process within the Metafuse platform.\n",
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetafuApiDeLnogz7EaTQPt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "200 response",
            "content": {}
          },
          "400": {
            "description": "400 response",
            "content": {}
          }
        },
        "security": [
          {
            "MetafuseDeveloperApiStackRequestAuthorizer1C886840": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "MetafuApiDeLnogz7EaTQPt": {
        "required": [
          "projectId",
          "tokenId",
          "visibility"
        ],
        "type": "object",
        "properties": {
          "image": {
            "type": "string",
            "description": "A base64 encoded string representing the image.",
            "format": "base64"
          },
          "allowDuplicatesOverride": {
            "type": "boolean",
            "default": false
          },
          "traits": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "trait_type": {
                  "type": "string"
                }
              }
            }
          },
          "visibility": {
            "type": "string",
            "description": "A visibility value of either PUBLIC or PRIVATE that determines if the public can view an assets image and metadata",
            "enum": [
              "PUBLIC",
              "PRIVATE"
            ]
          },
          "tokenId": {
            "minimum": 1,
            "type": "number"
          },
          "projectId": {
            "type": "string",
            "description": "The unique id assigned to the project."
          }
        }
      }
    },
    "securitySchemes": {
      "MetafuseDeveloperApiStackRequestAuthorizer1C886840": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "x-amazon-apigateway-authtype": "custom"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 100,
      "1": 144,
      "2": 178,
      "3": 32,
      "4": 71,
      "5": 34,
      "6": 16,
      "7": 7,
      "8": 88,
      "9": 94,
      "10": 157,
      "11": 150
    }
  }
}
```