Upload Asset
/v1/assetsUpload a file into the current user's asset library.
Use this endpoint for standard asset-library uploads and uploads to Real Face or Virtual Portrait groups. Every upload source returns the same public asset object.
Authentication
Authorization Bearer — JWT session or sk-* API key.
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.
To upload to a group, pass the assetGroupId returned by the asset-group API in the groupId field.
Upload a local file
Use this source when the file is available on your machine or server.
Request Body
filefilerequiredFile to upload.
namestringOptional display name.
groupIdstringOptional asset group ID returned by GET /v1/asset-groups.
modelstringOptional target model name for Real Face or Virtual Portrait validation.
Response
codeintegerResponse status code.
dataobjectUploaded asset.
data.assetIdstringAsset public ID.
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.mediaTypestringMedia type: IMAGE, VIDEO, AUDIO, or OTHER.
data.assetKindstringAsset kind, such as USER_UPLOAD, REAL_FACE, or VIRTUAL_PORTRAIT.
data.sourceTypestringAsset source: UPLOAD, AI_GENERATION, or ASSET_LIFECYCLE.
data.statusstringInitial status.
data.namestringDisplay name.
data.assetTypestringAsset type label.
data.filenamestringStored filename.
data.mimeTypestringAsset MIME type.
data.sizeBytesstringAsset 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.providerLastErrorobjectStable public error code and message, if available.
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.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