Removing existing resources (DELETE)

Last updated on
31 March 2019

This page shows examples of DELETE requests for the JSON:API module.

Enabling delete operation

Visit /admin/config/services/jsonapi
and check the "Accept all JSON:API create, read, update, and delete operations." option.

jsonapi-accept-create-read-update-delete

Authentication

Typically some form of authentication is used for DELETE requests. The examples below all use Basic Authentication. Enable the HTTP Basic Authentication module, set the permission for the API user (and role) and add set the encoded username and password to the 'Authorization' request header.

The example header on this page requires a Drupal user 'api' with password 'api'. This user must have permission to delete the requested content.

Headers

All DELETE request examples use the following headers:

  • Content-Type:application/vnd.api+json
  • Authorization:Basic YXBpOmFwaQ==

Basic DELETE request

URL: http://example.com/jsonapi/node/article/{{article_uuid}}

Response

HTTP 204 (No content) response. Empty response body.
The article {{article_uuid}} is now deleted.

Help improve this page

Page status: No known problems

You can: