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
  }
}
| Parameter | Required? | Description | 
|---|---|---|
name | Yes | The name of the collection. Should be unique in your organization. | 
default_item_type_id | No | ID of the item type commonly associated with this collection. | 
image_url | No | URL of an image to be used as a cover image for the collection. | 
reveal_strategy | No | Reveal 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_metadata | No | Collection preview metadata shown on all items prior to triggering the reveal. Required when reveal_strategy=DELAYED | 
editable_metadata | No | Whether items' metadata are allowed to change after minted. Default to false. | 
deployment_request | No | Whether 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 
addressandcapabilitiesproperties 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_infohas no default setting for the contract. This can be modified through editing a collection.functions_enabledis set tofalseby default; there can be no manual interaction with the contract through API calls. This can be modified through editing a collection.reveal_hiddenisfalseby default for all collections with anINSTANTreveal strategy. For collections withDELAYEDreveal, it istrueby default, and can be manually set tofalseto enable metadata reveal through editing a collection. Oncefalse, it cannot be set totrueagain.preview_metadataisnullfor Instant reveal strategy. For Delayed reveal strategy,preview_metadatais contents of the original payload forpreview_metadata.editable_metadataisfalseby default for all collections, unless it is set to betruein the original payload. It can be disabled through editing a collection. Oncefalse, it cannot be set totrueagain.