Media Manager

Upload File (multipart)

POST/api/v1/media-manager/files/upload

Upload a file to the Media Manager as multipart/form-data. The file is streamed straight to storage, so large files aren't held in a JSON body.

  • One file part per request, max 25 MB. Larger files return 413.
  • File names in any language (e.g. Thai) are preserved.
  • Use the returned data.id as mediaFileId in Send message.

For very small files you can also send Base64 in a JSON body with Create File (about 700 KB or less).

curl -X POST https://apigw.klinkcx.com/api/v1/media-manager/files/upload \
  -H "Authorization: Bearer <YOUR_API_TOKEN>" \
  -F "file=@report.pdf;type=application/pdf" \
  -F "title=Monthly report"

Request

Authorization

Bearer Token

Provide your API token in the Authorization header. See Authentication to issue one.

Example:Authorization: Bearer ********************

Body Paramsmultipart/form-data
  • filestring<binary>required

    The file to upload (max 25 MB).

  • fileNamestringoptional

    Override the stored file name. Defaults to the uploaded file's name.

  • titlestringoptional

    Title shown in the Media Manager.

    Example:Monthly report

  • descriptionstringoptional

    Description.

  • folderIdstringoptional

    Target folder ID (UUID).

  • isFavoritebooleanoptional

    true or false.

    Example:false

  • isPrivatebooleanoptional

    true or false.

    Example:false

Responses

200

OK

  • dataobjectrequired
    Child attributes
    • idstringrequired
    • uploadIdstringrequired
    • folderIdnullrequired
    • titlestringrequired
    • descriptionstringrequired
    • altTextstringrequired
    • sortOrderintegerrequired
    • isFavoritebooleanrequired
    • isPrivatebooleanrequired
    • createdAtstringrequired
    • updatedAtstringrequired
    • uploadobjectrequired
      Child attributes
      • idstringrequired
      • fileNamestringrequired
      • fileSizeintegerrequired
      • fileUrlstringrequired
400

Missing file part or invalid field (e.g. folderId not a UUID).

  • messageanyoptional
  • errorstringoptional
  • statusCodeintegeroptional
413

The file exceeds 25 MB.

  • messagestringoptional
  • errorstringoptional
  • statusCodeintegeroptional