POST
/ng-cms/media/{projectId}https://apis-spb.konso.io/ng-cms/media/{projectId}Upload a media asset
Параметры запроса
projectIdstringThe unique identifier of the project (bucket)
filefileThe file to upload. Maximum size is 10 MB. Must be sent as multipart/form-data.
titlestringHuman-readable title for the asset. Defaults to the filename (without extension) if omitted.
descriptionstringOptional description of the media asset.
Ответы
201File uploaded and media asset created successfully. Returns the new asset ID.
тип: ApiResponse<string>
successbooleanIndicates whether the request was successfulresultstringThe ID of the newly created media asseterrorsErrorDetail[]List of errors (empty on success)400Bad Request. No file was provided or the file is empty.
401Unauthorized. A valid bearer token is required.
412Precondition Failed. The project's current plan does not allow access to this resource, or payment is required to proceed.
500Unexpected server error.
тип: ApiResponse<T>
successbooleanAlways falseerrorsErrorDetail[]List of server-side errorscorrelationIdstringUnique ID for tracing the errormessagestringError messagestackstringStack trace (non-production only)Язык:
expand_more
Пример запроса
curl --request POST \
--url https://apis-spb.konso.io/ng-cms/media/{projectId} \
--header 'Authorization: Bearer <token>' \
--form 'file=@/path/to/image.jpg' \
--form 'title=Hero Image' \
--form 'description=Main banner image'Response Example201
{
"success": true,
"result": "ma_f1e2d3c4b5a6",
"errors": []
}KONSO