> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mint NFT with ID

> This pathway allows you to mint NFTs and guarantee idempotency
to ensure you never double mint for the same NFT. 

**API scope required**: `nfts.create`


Subsequent requests to this endpoint with the same `id` in the path will ***not*** mint additional NFTs.

Furthermore, the success responses (with status code 200) will be different once the initial request has completed and includes the metadata for the minted NFT.

<Accordion title="200 response examples for subsequent requests">
  <CodeGroup>
    ```json EVM theme={null}
    {
      "id": "<string>",
      "metadata": {
        "name": "<string>",
        "image": "<string>",
        "description": "<string>"
      },
      "onChain": {
        "status": "<string>",
        "tokenId": "<string>",
        "owner": "<string>",
        "txId": "<string>",
        "contractAddress": "<string>",
        "chain": "<string>"
      },
      "actionId": "<string>"
    }
    ```

    ```json Solana theme={null}
    {
        "id": "<string>",
        "metadata": {
            "name": "<string>",
            "symbol": "<string>",
            "description": "<string>",
            "seller_fee_basis_points": 0,
            "image": "<string>",
            "attributes": [],
            "properties": {}
        },
        "onChain": {
            "status": "success",
            "mintHash": "<string>",
            "txId": "<string>",
            "owner": "<string>",
            "chain": "solana"
        },
        "actionId": "<string>"
    }
    ```
  </CodeGroup>
</Accordion>

<ResponseExample>
  <Snippet file="mint-responses.mdx" />

  <Snippet file="mintapi-400-503-responses.mdx" />
</ResponseExample>


## OpenAPI

````yaml put /2022-06-09/collections/{collectionId}/nfts/{id}
openapi: 3.0.1
info:
  description: N/A
  version: 1.0.0
  title: NFT Minting
  contact:
    name: Crossmint NFT Minting APIs
    url: https://www.crossmint.com
    email: support@crossmint.com
servers:
  - url: https://staging.crossmint.com/api
    description: Staging environment (testnets)
  - url: https://www.crossmint.com/api
    description: Production environment (mainnets)
security:
  - apiKey: []
paths:
  /2022-06-09/collections/{collectionId}/nfts/{id}:
    put:
      tags:
        - NFTs
      summary: Mint NFT with ID
      description: |
        This pathway allows you to mint NFTs and guarantee idempotency
        to ensure you never double mint for the same NFT. 

        **API scope required**: `nfts.create`
      operationId: mint-nft-idempotent
      parameters:
        - $ref: '#/components/parameters/collectionId'
        - name: id
          in: path
          description: Custom ID of the NFT, which is used as an idempotency key
          required: true
          example: default
          schema:
            type: string
            example: my-idempotency-key
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                metadata:
                  $ref: '#/components/schemas/NFTMetadataOptions'
                recipient:
                  $ref: '#/components/schemas/Recipient'
                sendNotification:
                  $ref: '#/components/schemas/SendNotification'
                locale:
                  $ref: '#/components/schemas/Locale'
                reuploadLinkedFiles:
                  $ref: '#/components/schemas/ReuploadLinkedFiles'
                compressed:
                  $ref: '#/components/schemas/Compressed'
              required:
                - recipient
                - metadata
      responses:
        '200':
          description: The request has been accepted.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/MintResponseSolana200'
                  - $ref: '#/components/schemas/MintResponseSolana200Subsequent'
                  - $ref: '#/components/schemas/MintResponseEVM200'
                  - $ref: '#/components/schemas/MintResponseEVM200Subsequent'
        '400':
          description: >-
            Invalid arguments, please make sure you're following the api
            specification.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400Response'
        '403':
          description: Forbidden error, please ensure the credentials are correct.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403Response'
        '404':
          description: Not found error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404Response'
        '503':
          description: >-
            Please try again in a few minutes. If the issue still persists,
            contact Crossmint support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/503Response'
components:
  parameters:
    collectionId:
      name: collectionId
      in: path
      description: >
        This is the identifier for the collection related to the request. Every
        project has default collections: `default-solana` and
        `default-polygon`. 


        The
        [create-collection](/api-reference/minting/collection/create-collection)
        API will result in collections with UUID formatted `collectionId`. 

        **Example:** `9c82ef99-617f-497d-9abb-fd355291681b`


        The
        [create-collection-idempotent](/api-reference/minting/collection/create-collection-idempotent)
        API allows you to specify an arbitrary identifier during the initial
        request.

        **Example:** `your-custom-identifier`
      required: true
      example: default-solana
      schema:
        type: string
  schemas:
    NFTMetadataOptions:
      description: >-
        Optional if [baseURI](/api-reference/minting/collection/set-base-uri) is
        set.
      oneOf:
        - $ref: '#/components/schemas/NFTMetadata'
          title: '[EVM] Metadata Object'
        - title: '[EVM] Metadata URL'
          description: Enter a URL to a JSON file containing the metadata contents
          type: string
          example: >-
            https://bafkreici2rl4k4kvnag6gjykuzaaqznveg7bip4y6qx4ekwzukqul23xba.ipfs.nftstorage.link/
        - $ref: '#/components/schemas/NFTMetadataSolana'
          title: '[Solana] Metadata Object'
        - title: '[Solana] Metadata URL'
          description: Enter a URL to a JSON file containing the metadata contents
          type: object
          additionalProperties: false
          properties:
            uri:
              description: Enter a URL to a JSON file containing the metadata contents
              type: string
              example: >-
                https://bafkreiccjhsemz4jhunfnrw4icx2vqr5ms4ycx5v3ecqvb2uckkgqf5ep4.ipfs.nftstorage.link/
            name:
              type: string
              description: 'The name of your NFT (Max length: 32)'
              example: Solana Test NFT
              maxLength: 32
          required:
            - uri
            - name
    Recipient:
      type: string
      example: email:testy@crossmint.com:polygon
      description: |
        Allowed formats: 

        `<chain>:<address>` or 

        `email:<email_address>:<chain>` or

        `userId:<userId>:<chain>` or

        `twitter:<twitter_handle>:<chain>`

        [see here for more info](/minting/nfts/integrate/manage-delivery)
    SendNotification:
      type: boolean
      description: >-
        Notify recipient via email notification about successful mint [Default:
        true]. For legacy projects created before Sep 16, 2024, this is set to
        false by default.
    Locale:
      type: string
      example: en-US
      description: 'Specify the locale for the email content [Default: en-US]'
    ReuploadLinkedFiles:
      type: boolean
      description: >-
        Any URLs in the metadata object will be resolved and reuploaded to IPFS
        [Default: true]
    Compressed:
      type: boolean
      description: >
        **Solana only** Use NFT compression for cheaper mint costs [Default:
        true]
    MintResponseSolana200:
      type: object
      properties:
        id:
          type: string
        onChain:
          type: object
          properties:
            status:
              type: string
            chain:
              type: string
        actionId:
          type: string
    MintResponseSolana200Subsequent:
      allOf:
        - $ref: '#/components/schemas/NFTObjectSolana'
        - type: object
          properties:
            actionId:
              type: string
              description: actionId for the request
    MintResponseEVM200:
      type: object
      properties:
        id:
          type: string
        onChain:
          type: object
          properties:
            status:
              type: string
            chain:
              type: string
            contractAddress:
              type: string
            subscription:
              type: object
              properties:
                expiresAt:
                  type: string
                  description: The date and time when the subscription expires
                  format: date-time
        actionId:
          type: string
    MintResponseEVM200Subsequent:
      allOf:
        - $ref: '#/components/schemas/NFTObjectEVM'
        - type: object
          properties:
            actionId:
              type: string
              description: actionId for the request
    400Response:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: Invalid arguments or empty parameter <missing parameter>.
    403Response:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: Malformed API key. / API key provided doesn't have required scopes.
    404Response:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: Not found
    503Response:
      type: object
      properties:
        error:
          type: boolean
          example: true
        message:
          type: string
          example: >-
            Please try again in a few minutes. If the issue still persists,
            contact Crossmint support.
    NFTMetadata:
      type: object
      additionalProperties: false
      required:
        - name
        - image
        - description
      properties:
        name:
          type: string
          description: 'The name of your NFT (Max length: 32)'
          example: Crossmint Example NFT
          maxLength: 32
        image:
          type: string
          description: Direct link to your NFT image
          example: https://www.crossmint.com/assets/crossmint/logo.png
        description:
          type: string
          description: 'A brief description of the NFT (Max length: 64)'
          example: My NFT created via the mint API!
          maxLength: 64
        animation_url:
          type: string
          example: ''
          description: |
            **EVM only**

            [See more info here](/minting/nfts/integrate/define-metadata)
        attributes:
          type: array
          description: Add attributes to your NFT
          items:
            type: object
            additionalProperties: false
            required:
              - trait_type
              - value
            properties:
              display_type:
                type: string
                description: Display name of your attribute
                enum:
                  - boost_number
                  - boost_percentage
                  - number
              trait_type:
                type: string
                description: The name of the trait
              value:
                type: string
                description: The value of the trait
    NFTMetadataSolana:
      type: object
      additionalProperties: false
      required:
        - name
        - image
        - description
      properties:
        name:
          type: string
          description: 'The name of your NFT (Max length: 32)'
          example: Crossmint Example NFT
          maxLength: 32
        image:
          type: string
          description: Direct link to your NFT image
          example: https://www.crossmint.com/assets/crossmint/logo.png
        description:
          type: string
          description: 'A brief description of the NFT (Max length: 64)'
          example: My NFT created via the mint API!
          maxLength: 64
        symbol:
          type: string
          example: MTK
          maxLength: 10
          description: |
            **Solana only**

            A shorthand identifier for the token (Max length: 10)
        attributes:
          type: array
          description: Add attributes to your NFT
          items:
            type: object
            additionalProperties: false
            required:
              - trait_type
              - value
            properties:
              display_type:
                type: string
                description: Display name of your attribute
                enum:
                  - boost_number
                  - boost_percentage
                  - number
              trait_type:
                type: string
                description: The name of the trait
              value:
                type: string
                description: The value of the trait
    NFTObjectSolana:
      type: object
      properties:
        id:
          type: string
        metadata:
          type: object
          properties:
            name:
              type: string
            symbol:
              type: string
            seller_fee_basis_points:
              type: integer
              example: 0
            properties:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: object
                    properties:
                      uri:
                        type: string
                      type:
                        type: string
                category:
                  type: string
                creators:
                  type: array
                  items:
                    type: object
                    properties:
                      address:
                        type: string
                      verified:
                        type: boolean
                      share:
                        type: integer
            description:
              type: string
            image:
              type: string
            attributes:
              type: array
              items:
                type: object
                properties:
                  trait_type:
                    type: string
                  value:
                    type: string
        onChain:
          type: object
          properties:
            status:
              type: string
              example: success
            mintHash:
              type: string
            txId:
              type: string
            owner:
              type: string
            chain:
              type: string
              example: solana
    NFTObjectEVM:
      type: object
      properties:
        id:
          type: string
        metadata:
          type: object
          properties:
            name:
              type: string
            image:
              type: string
            description:
              type: string
        onChain:
          type: object
          properties:
            status:
              type: string
            tokenId:
              type: string
            owner:
              type: string
            txId:
              type: string
            contractAddress:
              type: string
            chain:
              type: string
            subscription:
              type: object
              properties:
                expiresAt:
                  type: string
                  description: The date and time when the subscription expires
                  format: date-time
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Obtained in the Crossmint developer console

````