Upload Asset
/v1/assetsUpload a file into the current user's asset library.
Use this endpoint for both standard asset-library uploads and provider-based uploads. The response always uses the unified asset schema.
Authentication
Authorization Bearer
API key as bearer token in Authorization header.
Choose one upload source:
- Upload a local file: send a file from your machine or server.
- Import from a URL: provide a public HTTPS
sourceUrl; Token360 downloads and stores it. - Upload Base64 content: provide
contentBase64when you already have encoded file bytes.
assetGroupId (or groupId with legacy legacy_rf_ prefix) uses the provider-based upload path.
Upload a local file
Use this source when the file is available on your machine or server.
The legacy /api/v1/assets alias supports this local-file source only.
Request Body
filefilerequiredFile to upload.
namestringOptional display name.
groupIdstringOptional unified group ID from GET /v1/asset-groups.
assetGroupIdintegerLegacy upload group ID.
modelstringOptional target model name for Real Face or Virtual Portrait validation.
Response
codeintegerResponse status code.
dataobjectUploaded asset record in unified schema.
data.idintegerInternal asset ID (external uploads return a legacy asset ID).
data.assetIdstringAsset public ID.
data.token360AssetIdstringBackward-compatible alias of assetId.
data.tenantIdintegerTenant ID.
data.userIdintegerOwner user ID.
data.userNamestringOwner display name.
data.sharedbooleanWhether the asset is shared with the caller.
data.sharePermissionstringShare permission when shared.
data.shareExpiresAtstringShare expiry time when shared.
data.assetGroupIdstringAsset group public ID.
data.groupNamestringAsset group name.
data.mediaTypestringDetected media type.
data.assetKindstringAsset kind.
data.sourceTypestringAsset source type.
data.statusstringInitial status.
data.namestringDisplay name.
data.assetTypestringAsset type label.
data.filenamestringStored filename.
data.mimeTypestringAsset MIME type.
data.sizeBytesintegerAsset size in bytes.
data.fileTypestringAsset extension or format.
data.widthintegerImage/video width in pixels when available.
data.heightintegerImage/video height in pixels when available.
data.aspectRatiostringImage/video aspect ratio when available.
data.durationSecondsnumberAsset duration in seconds when available.
data.frameRatenumberVideo frame rate when available.
data.providerLastErrorobjectExternal error details, if any.
data.urlstringAccessible content URL.
data.thumbnailUrlstringThumbnail URL, if available.
data.expiresAtstringAsset expiry timestamp, if any.
data.requestIdstringRequest ID from generation provenance.
data.modelNamestringModel name used to produce the asset.
data.modelTypestringModel type used to produce the asset.
data.byteplusAssetIdstringBYTEPLUS asset identifier.
data.providerRefsobjectExternal references keyed by service and ref type.
data.originalFilenamestringOriginal uploaded filename.
data.createdAtstringCreate timestamp.
data.updatedAtstringUpdate timestamp.
msgstringResponse message.
serviceCodestring | nullService error code on failure.
Error Handling
Local file uploads use the standard response envelope. Missing file returns a validation error. Size rejection uses ASSET_FILE_TOO_LARGE.
Common serviceCode values:
UNIFIED_ASSET_FILE_REQUIREDUNIFIED_ASSET_GROUP_REQUIREDUNIFIED_ASSET_GROUP_NOT_FOUNDASSET_GROUP_NOT_FOUNDASSET_GROUP_ACCESS_DENIEDASSET_GROUP_NOT_ACTIVEASSET_GROUP_TYPE_UNSUPPORTEDASSET_GROUP_PROVIDER_REF_MISSINGASSET_FILE_REQUIREDASSET_FILE_TYPE_UNSUPPORTEDASSET_FILE_TOO_LARGEASSET_PROVIDER_REJECTEDASSET_PROVIDER_UNAVAILABLE