MeduxMedux

Infra > Create Asset

Create Asset

Create an asset record from a file that was uploaded through a direct upload URL.

POST/api/app/v1/assets

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/json
Authorizationstringrequired

Bearer token or API key.

Location: HEADER

categorystringoptional

Asset 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_bytesint64optional

Original file size, in bytes.

Location: BODY

namestringoptional

Display name provided by the user. This value may be empty.

Location: BODY

storage_object.keystringoptional

No description provided.

Location: BODY

storage_object.urlstringoptional

No description provided.

Location: BODY

Response

Response

application/json
codeint32optional

Application response code.

CodeMeaning
0OK
12Invalid input
16Rate limit exceeded
99Server error

Available options: 0 12 1406 13 16 99

Location: RESPONSE

data.assetobjectoptional

No description provided.

Location: RESPONSE

messagestringoptional

No description provided.

Available options: ok invalid input asset limit reached unauthenticated rate limit server error

Location: RESPONSE