Create an asset

This method creates an asset by uploading an image file or providing a publicly accessible URL.

Note the following about creating assets:

  • The platform will automatically delete assets not associated with any entity 72 hours after creation.
  • You can associate a single asset with multiple entities.

The images you wish to use must meet the following requirements:

  • Format: JPEG and PNG.
  • Dimension: Must be at least 64 x 64 pixels.
  • Size: Must not exceed 5MB.

Ensure URLs point directly to the raw image file without requiring user interaction.

Upload options:

  • Local file: Set the method parameter to direct and use the file parameter to specify the image file.
  • Publicly accessible URL: Set the method parameter to url and use the url parameter to specify the URL of your image file.

Headers

x-api-keystringRequired

Request

This endpoint expects a multipart form containing an optional file.
methodenumRequired

Specifies the upload method for the asset. Use direct to upload a local image file or url for a publicly accessible URL.

Allowed values:
filefileOptional

Specify this parameter to upload a file from your local file system. This parameter is required when method is set to file.

urlstringOptional

Specify this parameter to upload a file from a publicly accessible URL. This parameter is required when method is set to url.

Response

The asset has been successfully created.
_idstring or null
The unique identifier of the asset.
methodenum or null
The method used to upload the asset.
Allowed values:
statusenum or null
The status of the upload process.
Allowed values:
filenamestring or null
The filename of the asset.
file_typestring or null
The MIME type of the asset.
urlstring or null
The URL where the asset can be accessed.
url_expires_atstring or nullformat: "date-time"
The date and time, in RFC 3339 format, when the URL expires.
created_atstring or nullformat: "date-time"

The date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the asset was created.

Errors