Skip to main content

Create a collection

Issue a POST request to the collections endpoint to create a collection. The collections endpoint takes an optional deployment_request if you want to create and deploy the collection within one request.

POST https://admin-api.phosphor.xyz/v1/collections

The following is an example payload and a description of the parameters.

Example payload
{
"name": "Collection ABC",
"default_item_type_id": null,
"image_url": null,
"reveal_strategy": "INSTANT",
"preview_metadata": null,
"editable_metadata": false,
"deployment_request": {
"type": "PLATFORM",
"token_id_assignment_strategy": "AUTOMATIC",
"platform": {
"symbol": "ABC",
"variant": "FlexibleERC721"
},
"network_id": 59140
}
}
ParameterRequired?Description
nameYesThe name of the collection. Should be unique in your organization.
default_item_type_idNoID of the item type commonly associated with this collection.
image_urlNoURL of an image to be used as a cover image for the collection.
reveal_strategyNoReveal style for items. Whether items' metadata will be revealed instantly after mint or delayed for reveal. Accepted values are INSTANT or DELAYED. Default to INSTANT.
preview_metadataNoCollection preview metadata shown on all items prior to triggering the reveal. Required when reveal_strategy=DELAYED
editable_metadataNoWhether items' metadata are allowed to change after minted. Default to false.
deployment_requestNoWhether to deploy the collection contract at the time of creating the collection. See more details in configuring contracts.
Example response
{
"default_item_type_id": null,
"deployment": {
"address": null,
"capabilities": [],
"network_id": null,
"symbol": "ABC",
"token_id_assignment_strategy": "AUTOMATIC",
"token_type": "ERC721",
"transaction_id": "a2556a16-bd64-4afd-bdbc-e8354d27169f"
},
"functions_enabled": false,
"id": "cba8a297-0f8b-43ee-8481-83669393d874",
"image_url": null,
"name": "Collection ABC",
"royalty_info": null,
"reveal_strategy": "INSTANT",
"preview_metadata": null,
"reveal_hidden": false,
"editable_metadata": false
}

Note the following in the response:

  • If the address and capabilities properties don't have a value, there's still a pending transaction (transaction_id) awaiting execution. This means the smart contract is waiting to be deployed.
  • royalty_info has no default setting for the contract. This can be modified through editing a collection.
  • functions_enabled is set to false by default; there can be no manual interaction with the contract through API calls. This can be modified through editing a collection.
  • reveal_hidden is false by default for all collections with an INSTANT reveal strategy. For collections with DELAYED reveal, it is true by default, and can be manually set to false to enable metadata reveal through editing a collection. Once false, it cannot be set to true again.
  • preview_metadata is null for Instant reveal strategy. For Delayed reveal strategy, preview_metadata is contents of the original payload for preview_metadata.
  • editable_metadata is false by default for all collections, unless it is set to be true in the original payload. It can be disabled through editing a collection. Once false, it cannot be set to true again.