Module Development

JSON:API PATCH Requests: Update an Entity for Drupal 8, 9, and 10

Whenever we need our consumer application to change the contents of an entity we will need to issue a PATCH request. The JSON:API module will process that request and update the entity with the provided values.

In this tutorial, we'll:

  • Define the appropriate HTTP headers for a PATCH request
  • Construct the JSON object used to update an entity
  • Issue a PATCH request that will update an entity in our Drupal backend

By the end of this tutorial, you should know how to update content via the JSON:API.