Assets mAPI reference
Complete reference documentation for the Assets resource.
Assets
#Assets are files you upload to Knock for use in your notification templates. Assets are account-wide and are not scoped to an environment.
List assets
#Returns a paginated list of active account assets. Assets are account-wide and do not require an environment parameter.
Endpoint
Query parameters
The cursor to fetch entries after.
The cursor to fetch entries before.
The number of entries to fetch per-page.
Returns
A paginated list of Asset. Contains a list of entries and page information.
A list of entries.
The type of asset.
The timestamp of when this asset was created.
The human-readable filename for this asset.
The unique ID for this asset.
The MIME type for this asset.
The timestamp of when this asset was last updated.
The public URL for this asset.
The information about a paginated result.
The cursor to fetch entries after. Will only be present if there are more entries to fetch.
The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
The number of entries to fetch per-page.
Archive an asset
#Archives a library or template image asset by id. The stored file remains at its URL. Other asset types, unknown ids, and already archived assets are not found. Assets are account-wide and do not require an environment parameter.
Endpoint
Path parameters
The id of the asset to archive.
Returns
The response from archiving an asset.
The result of the archive operation.
Create an asset
#Records a library asset after the file has been uploaded to the key from an upload request. The asset is always a library asset. Assets are account-wide and do not require an environment parameter.
Endpoint
Request body
The display name for this asset.
The storage key from the upload request. The file must already be uploaded.
Returns
An uploaded asset file for an account.
The type of asset.
The timestamp of when this asset was created.
The human-readable filename for this asset.
The unique ID for this asset.
The MIME type for this asset.
The timestamp of when this asset was last updated.
The public URL for this asset.
Request an asset upload
#Returns a time-limited URL for uploading an asset file. PUT the file bytes to upload_url with Content-Type and Content-Length from this response, then create the asset with the returned key. This request does not store an asset. Assets are account-wide and do not require an environment parameter.
Endpoint
Request body
The file size in bytes. Maximum is 5 MB. The upload URL is signed for this length.
The display name to echo back. The upload request does not store it. Send it again when creating the asset.
The MIME type of the file. One of image/jpeg, image/png, or image/gif.
Returns
A time-limited permission to upload an asset file directly to storage.
The byte length the PUT must send as Content-Length.
Seconds until the upload URL expires.
The filename from the request, when one was sent.
The storage key to send when creating the asset.
The MIME type the PUT must send as Content-Type.
The URL to PUT the file bytes to. The signature covers Content-Type and Content-Length, and the PUT must send both.
Asset
#An uploaded asset file for an account.
Attributes
The type of asset.
The timestamp of when this asset was created.
The human-readable filename for this asset.
The unique ID for this asset.
The MIME type for this asset.
The timestamp of when this asset was last updated.
The public URL for this asset.