diff --git a/docs/hub/Guides/switch-collection.md b/docs/hub/Guides/switch-collection.md new file mode 100644 index 0000000..caebc1e --- /dev/null +++ b/docs/hub/Guides/switch-collection.md @@ -0,0 +1,46 @@ +--- +sidebar_position: 10 +--- + +# Move an NFT from one collection to another + +The Hub API can be used to move an NFT from one collection to another. In order to use the `switchCollection` mutation, the following must be true: +- The NFT to be moved was created in Hub (or imported into Hub and has the Hub project treasury as its update authority) +- The NFT is on Solana +- The NFT is *not* compressed +- The destination collection belongs to the same Hub project as the original collection +- The destination collection was created in Hub (or imported into Hub and has the Hub project treasury as its update authority) + +Upon switching collections, credits will be deducted from your organization's account. To view the number of credits charged for this or any action, view your organization's credit page: [https://hub.holaplex.com/credits/costs](https://hub.holaplex.com/credits/costs) + +## Example + +```graphql +mutation SwitchCollection($input: SwitchCollectionInput!) { + switchCollection(input: $input) { + collectionMint { + id + address + owner + } + } +} +``` +Variables: +```json +{ + "input": { + "mint": "", + "collectionAddress": "" + } +} +``` +Replace `` with the id of the mint to be moved and `` with the on-chain address of the destination collection. + +As with all Hub API calls, you'll need an access token that can be generated on your organization's Credentials tab: [https://hub.holaplex.com/credentials](https://hub.holaplex.com/credentials) +For all API requests to Hub, you'll need to include an authentication header of the form. This token should be included in the call's header: +```json +{ + "Authorization": "" +} +``` \ No newline at end of file