Skip to content

Get a media handle for the header

POST /api/templates/media-handle

Downloads the file from the URL (max. 16 MB; image/jpeg, image/png, video/mp4 or application/pdf), uploads it to Meta and returns a handle for example.header_handle of the HEADER component. Requires the templates:manage scope.

FieldTypeDescription
channel_idstringrequiredchannel_id of the channel (nk_ prefix). Example: "nk_dvzobn7m4h4y".
urlstringrequiredPublic URL of the header example file. Types: image/jpeg, image/png, video/mp4, application/pdf. Maximum 16 MB. Example: "https://cdn.example.com/banner.jpg".
StatusDescriptionSchema
200—MediaHandleResponseDto
Terminal window
curl -X POST https://api.neike.dev/api/templates/media-handle \
-H "x-neike-api-key: whk_live_…" \
-H "Content-Type: application/json" \
-d '{
"channel_id": "nk_dvzobn7m4h4y",
"url": "https://cdn.example.com/banner.jpg"
}'
FieldTypeDescription
externalCodenumberrequiredExample: 200.
header_handlestringoptionalHandle for the template’s example.header_handle. Example: "4::aW1hZ2UvanBlZw==:ARb".
messagestringoptionalError message, if externalCode != 200.