Create an asset
/assetsCosts 2 rate-limit points · Rate limits
Create a new asset. Supports three types:
internal: a file stored in Filemonk storage. The asset row is created together with a single presignedPUTURL in one call. Upload the file body to that URL to finish.external: a file hosted at an external URL.licence: a licence key asset.
Plan storage / asset-count quotas are enforced before the upload URL is issued. The per-file ceiling is 2 GB.
Headers
X-Auth-TokenstringRequiredAPI key for authentication
Request body
assetobjectRequiredShow 8 child attributesHide child attributes
typestringRequiredExample:internalOne ofinternalexternallicencenamestringA display name for the asset. Required for
licencetype.external_urlstringThe URL of the external file. Required when
typeisexternal.filenamestringRequired when
typeisinternal. Suggested attachment name on download.byte_sizeintegerRequired when
typeisinternal. Size of the file in bytes. Must be positive and at most 2 GB.content_typestringOptional MIME type for
internalassets. Defaults toapplication/octet-stream.watermark_assetbooleanWhether to apply watermarking to this asset (PDFs only).
Defaultfalseautogenerate_licence_keybooleanWhether to auto-generate a licence key when this asset is purchased. Only applicable to
licencetype.Defaultfalse
Returns
assetobjectShow 11 child attributesHide child attributes
idstringUnique asset identifier
typestringThe asset type.
internalfor uploaded files,externalfor URL-based assets,licencefor licence key assets.One ofinternalexternallicencenamestring, nullableDisplay name of the asset.
filenamestring, nullableFilename of the asset (derived from the file or URL).
external_urlstring, nullableThe external URL for
externaltype assets.nullfor other types.content_typestring, nullableMIME type of the asset.
byte_sizeintegerFile size in bytes.
0for external and licence assets.watermark_assetbooleanWhether watermarking is enabled for this asset (PDFs only).
autogenerate_licence_keybooleanWhether a licence key is auto-generated when this asset is purchased.
created_atstringWhen the asset was created.
updated_atstringWhen the asset was last updated.
uploadobjectOnly present when
typeisinternal. Single-PUT upload handle.Show 4 child attributesHide child attributes
methodstringExample:PUTOne ofPUTurlstringExample:https://example.comheadersobjectexpires_atstringExample:2026-01-15T09:30:00Z
Errors
Validation failed
curl -X POST "https://app.filemonk.io/api/v1/external/assets" \
-H "X-Auth-Token: $FILEMONK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"asset": {
"type": "internal",
"name": "string",
"external_url": "https://example.com",
"filename": "string",
"byte_size": 1,
"content_type": "string",
"watermark_asset": false,
"autogenerate_licence_key": false
}
}'const res = await fetch("https://app.filemonk.io/api/v1/external/assets", {
method: "POST",
headers: {
"X-Auth-Token": process.env.FILEMONK_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"asset": {
"type": "internal",
"name": "string",
"external_url": "https://example.com",
"filename": "string",
"byte_size": 1,
"content_type": "string",
"watermark_asset": false,
"autogenerate_licence_key": false
}
}),
});
const data = await res.json();import os
import requests
res = requests.post(
"https://app.filemonk.io/api/v1/external/assets",
headers={"X-Auth-Token": os.environ["FILEMONK_API_KEY"]},
json={
"asset": {
"type": "internal",
"name": "string",
"external_url": "https://example.com",
"filename": "string",
"byte_size": 1,
"content_type": "string",
"watermark_asset": False,
"autogenerate_licence_key": False
}
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.filemonk.io/api/v1/external/assets")
req = Net::HTTP::Post.new(uri, "X-Auth-Token" => ENV["FILEMONK_API_KEY"], "Content-Type" => "application/json")
req.body = {
asset: {
type: "internal",
name: "string",
external_url: "https://example.com",
filename: "string",
byte_size: 1,
content_type: "string",
watermark_asset: false,
autogenerate_licence_key: false
}
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"asset": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "external",
"name": "Photoshop Brushes Pack",
"filename": "brushes-pack-v2.zip",
"external_url": "https://cdn.example.com/files/brushes-pack-v2.zip",
"content_type": "application/zip",
"byte_size": 0,
"watermark_asset": false,
"autogenerate_licence_key": false,
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z"
},
"upload": {
"method": "PUT",
"url": "https://example.com",
"headers": {},
"expires_at": "2026-01-15T09:30:00Z"
}
}{
"error": "API key is required"
}