Infra > Create Asset
Create Asset
Record an uploaded file as an asset.
Examples
curl -X POST https://medux-server-api-dev.lingverse.co/api/app/v1/assets \
-H 'Authorization: Bearer $MEDUX_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"category":"MEDIA","file_size_bytes":1,"name":"NAME","storage_object":{"key":"STORAGE_OBJECT_KEY","url":"https://example.com/callback"}}'Auth Requirements
Authentication is required via Authorization header.
Preconditions
Requires reusable asset metadata.
Uploaded MEDIA files use file_id directly and do not need this endpoint.
Request
Body
application/jsonAuthorizationstringrequiredBearer token or API key.
Location: HEADER
categorystringoptionalAsset category, used for validation and later rendering.
. assethpb.Category:
... enums:
..... CATEGORY_UNDEFINED
..... MEDIA
..... AVATAR
..... VOICE
Available options: CATEGORY_UNDEFINED MEDIA AVATAR VOICE
Location: BODY
file_size_bytesint64optionalOriginal file size in bytes.
Location: BODY
namestringoptionalUser-provided display name. It may be empty.
Location: BODY
storage_object.keystringoptionalNo description provided.
Location: BODY
storage_object.urlstringoptionalNo description provided.
Location: BODY
Response
Response
application/jsoncodeint32optionalresponse code enums:
.. 0: ok
.. 12: invalid input
.. 1406: asset limit reached
.. 13: unauthenticated
.. 16: rate limit
.. 99: server error
Available options: 0 12 1406 13 16 99
Location: RESPONSE
data.assetobjectoptionalNo description provided.
Location: RESPONSE
messagestringoptionalNo description provided.
Available options: ok invalid input asset limit reached unauthenticated rate limit server error
Location: RESPONSE
On this page