Unauthorised error when using Content API to POST new Data

We created a new model of type Data. We added an HTML field to that model.
We then tried to use the POST method in the Write API to create new content for that model.

We used the key present in the Environments tab.
Here is the Write call…
curl https://builder.io/api/v1/write/test-generic-html-model
-X POST
-d ‘{ “name”: “imported-html-1”, “data”: { “importedpagehtml”: “

hello

” } }’
-H ‘Authorization: Bearer ’
-H ‘Content-Type: application/json’

where test-generic-html-model is the identifier of the model we have, and importedpagehtml is the name of the HTML field.

However we are getting
{
“status”: 401,
“message”: “Unauthorized”,
“code”: “e462”
}

Hello @salman.qureshi,

You may find help at our forum post Create Private Pages that are accessible only after authorization