Payload CMS icon

Payload CMS

Consume the Payload CMS REST API

Actions5

Overview

This node integrates with the Payload CMS REST API to manage entries within collections. Specifically, the "Update" operation allows users to modify an existing document in a specified collection by providing its ID and the new data in JSON format.

Common scenarios include:

  • Updating content or metadata of a specific entry in a CMS collection.
  • Automating content updates based on external triggers or workflows.
  • Synchronizing data between Payload CMS and other systems.

For example, you might use this node to update a blog post's title and body after receiving updated content from another service.

Properties

Name Meaning
Collection Slug The unique identifier (slug) of the collection in Payload CMS where the entry exists.
Entry ID The ID of the document/entry to update within the specified collection.
JSON Data The JSON-formatted data representing the fields and values to update in the entry.

Output

The node outputs the updated entry as JSON in the json field of the output item. The structure corresponds directly to the updated document returned by the Payload CMS API, including all fields of the entry after modification.

No binary data is output by this operation.

Dependencies

  • Requires an active connection to Payload CMS via an API key credential configured in n8n.
  • The node uses the Payload CMS REST API endpoint corresponding to the specified collection and entry.
  • Proper permissions for updating entries in the target collection are necessary.

Troubleshooting

  • Missing or incorrect Entry ID: If the Entry ID is not provided or invalid, the API will fail to locate the document, resulting in an error. Ensure the correct ID is used.
  • Invalid JSON Data: Malformed JSON or data that does not conform to the collection schema may cause the update to fail. Validate JSON input before execution.
  • Permission errors: Insufficient API credentials or permissions can lead to authorization errors. Verify API key scopes and access rights.
  • Unknown operation error: This node only supports predefined operations; ensure "update" is selected correctly.
  • Network or API errors: Connectivity issues or Payload CMS downtime will prevent successful requests.

Links and References

Discussion