You do not have the appropriate permissions

Trying to upload a file to a channel but gets:


{“id”:“api.context.permissions.app_error”,“message”:“You do not have the appropriate permissions.”,“detailed_error”:"",“request_id”:“9okgg18rkjnn3gc3o79cocpehc”,“status_code”:40

I am clearly missing something but can’t figure out what it is?

The call is this:

curl -s --location --request POST ‘https://chat.stil.dk/api/v4/files?channel_id=xxxxxxxxxxxxx’ --header ‘Authorization: Bearer yyyyyyyyy’ --header ‘Content-Type: multipart/form-data’ --form files=@test.txt

The test.txt are just a small test file.

Where xxxxx is the channel_id for town square and yyyy is the token from a newly created BOT.

Thanks and best