POST
/
public
/
v1
/
assets
/
asset
Create Asset
curl --request POST \
  --url https://api.topsort.com/public/v1/assets/asset \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "brands": [
    "<string>"
  ],
  "collectionIds": [
    "<string>"
  ],
  "externalUrl": "<string>",
  "metadata": {},
  "mimetype": "image/jpeg",
  "name": "<string>",
  "productIds": [
    "<string>"
  ]
}'
{
  "brands": [
    "<string>"
  ],
  "fields": {},
  "id": "<string>",
  "isExternal": true,
  "metadata": {},
  "mimetype": "<string>",
  "name": "<string>",
  "productIds": [
    "<string>"
  ],
  "status": "pending_upload",
  "uploadUrl": "<string>",
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Query Parameters

vendor_id
string
required

Vendor ID.

Body

application/json
name
string
required

The name of the asset.

Maximum length: 64
brands
string[]

The brands that the asset is associated with.

Maximum length: 10
collectionIds
string[]

The collections that the asset is associated with.

Maximum length: 10
externalUrl
string<uri>

URL of an externally hosted asset. If this value is provided, then the asset will not be hosted by Topsort.

Required string length: 1 - 2083
metadata
object

The metadata associated with the asset. Max key length is 32 characters and max value length is 64 characters.

mimetype
enum<string>

The mimetype of the asset.

Available options:
image/jpeg,
image/png,
image/gif,
image/webp,
text/html,
video/mp4,
video/quicktime,
application/json
productIds
string[]

The product ids that the asset is associated with.

Maximum length: 10

Response

Successful Response

brands
string[]
required

The brands that the asset is associated with.

id
string
required

The id of the asset.

isExternal
boolean
required

Indicates if the asset is externally hosted.

metadata
object
required

The metadata associated with the asset.

name
string
required

The name of the asset.

productIds
string[]
required

The product ids that the asset is associated with.

status
enum<string>
required

Approval status of the asset

Available options:
pending_upload,
pending_approval,
upload_error,
approved,
rejected
fields
object

The fields to send with the pre-signed url. Can be empty if this is an external asset.

mimetype
string

The mimetype of the asset.

uploadUrl
string<uri>

The upload url the asset needs to be uploaded to.

Minimum length: 1
url
string<uri>

The url of the asset.

Required string length: 1 - 2083