Infra > Create Asset
Create Asset
Create an asset record from a file that was uploaded through a direct upload URL.
Examples
curl -X POST https://api.medux.io/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.
Allowed values:
CATEGORY_UNDEFINED- Not specified.MEDIA- Uploaded source media.AVATAR- Reusable avatar asset.VOICE- Reusable voice asset.
Available options: CATEGORY_UNDEFINED MEDIA AVATAR VOICE
Location: BODY
file_size_bytesint64optionalOriginal file size, in bytes.
Location: BODY
namestringoptionalDisplay name provided by the user. This value may be empty.
Location: BODY
storage_object.keystringoptionalNo description provided.
Location: BODY
storage_object.urlstringoptionalNo description provided.
Location: BODY
Response
Response
application/jsoncodeint32optionalApplication response code.
| Code | Meaning |
|---|---|
0 | OK |
12 | Invalid input |
16 | Rate limit exceeded |
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