Edit asset
Important:
Request headers are required. See API basics introduction for more information.
Endpoint
PUT /asset/{uid}
- Creates a new
Edit
asynchronous request for an asset associated with the given App (set by the X-API-KEY). - Returns no data
Important:
This endpoint is only available if you chose that Assets can be edited when you create a collection
Note:
To know when the edit has been executed, you can subscribe to the Webhook events.
Request body
Request body fields | Type | Description | Required/Optional |
---|---|---|---|
data | Object | The data associated with the asset. | Required |
- name | String | The name of the asset. | Required |
- unique_name | Boolean | Whether the asset name should be unique or not. * | Required |
- image_url | String (URL) | The image url of the asset. | Required |
- description | String | A description of the asset. | Optional |
- external_url | String (URL) | An external URL for additional information. | Optional |
- attributes | Array of Objects | Additional attributes describing the asset. | Optional |
-- trait_type | String | The type of trait or attribute. | Required |
-- value | String | The value of the trait or attribute. | Required |
-- display_type | String | The display type for the attribute value. | Optional |
Note
*unique_name:
- If set to True, we will check for existing names and return an error "Asset with this name already exists" as a guard from creating two assets with the same name for the same collection.
- If set to False, we will append
#TOKEN_ID
to the name.
All required asset data fields will be overwritten. Not passed optional asset data fields will not be part of the edited asset Metadata. Make sure to include all fields even those that will remain unchanged.
Request example
Sample: request body
{
"data": {
"name": "Dave Starbelly",
"unique_name": true,
"image_url": "https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png",
"description": "Friendly OpenSea Creature that enjoys long swims in the ocean.",
"external_url": "https://openseacreatures.io/3",
"attributes": [
{
"trait_type": "Base",
"value": "Starfish"
},
{
"trait_type": "Eyes",
"value": "Big"
},
{
"trait_type": "Aqua Power",
"display_type": "boost_number",
"value": 40
},
{
"trait_type": "Stamina Increase",
"display_type": "boost_percentage",
"value": 10
},
]
}
}
Response
Response example
Sample: 200 OK Response
No data is returned, edit will be executed asynchronously.
{
"success": true,
"data": null
}
Example
The following example edits an asset for asset 111111111111.
# API_KEY is your api key
# TOKEN is the access token generated with your api key secret
curl -i \
-X PUT \
-d "{\"data\":...}" \
-H "Content-Type: application/json" \
-H "X-Api-Key: API_KEY" \
-H "Authorization: Bearer TOKEN" \
"https://api.getoriginal.com/v1/asset/111111111111"
Updated 5 months ago