I have an issue with creating a node via the API. I have the correct permissions setup but it seems like a glitch somewhere in the permissions. An admin can create a content but no other role can. [content type]: Can create new content permission is checked.

Error; access denied - /node?_format=hal_json


enter image description here


return api({
    method: 'post',
    url: 'node?_format=hal_json',
    data: JSON.stringify(_node),
    headers: {
        'Content-Type': 'application/hal+json',
        'X-CSRF-Token': _xscrf_token,

Make sure you check the correct permissions for the roles you want in the "RESTful Web Services" section on the /admin/people/permissions page.

  • The permissions are right. There is an issue with Drupal. If the role is given "Administer content" permission, the issue resolves. But that shouldn't be the case. – Abdul Sadik Yalcin Feb 14 '20 at 10:48

Url should be /entity/node?_format=hal_json

  • What difference does this make in terms of user roles? 'An admin can create a content but no other role can' - that's my issue. – Abdul Sadik Yalcin Jun 2 '20 at 16:37

Refer this link it will help you https://www.agiledrop.com/blog/how-create-node-drupal-8-using-rest

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.