CardDAV icon

CardDAV

Interact with CardDAV servers for address book operations

Overview

The node interacts with CardDAV servers to manage address book contacts. Specifically, the Update Contact operation updates an existing contact in a specified address book on a CardDAV server using vCard data.

This node is useful when you want to programmatically maintain or synchronize contact information stored on CardDAV-compatible services (e.g., Nextcloud, ownCloud, or other CardDAV servers). For example, you can update contact details such as phone numbers, emails, or addresses automatically from another system or workflow.

A practical use case: Automatically updating a user's contact information in a shared company address book after they submit changes through a form or HR system.

Properties

Name Meaning
Address Book Path Server-relative path to the address book containing the contact. Must start with "/". Spaces and special characters are auto-encoded. Example: /addressbooks/user/contacts/
Contact ID Unique identifier of the contact to update. This corresponds to the contact's filename without extension. Example: contact-123
Contact Data (vCard) The updated contact data in vCard (.vcf) format. This string contains the full vCard content representing the contact's details

Output

The node outputs a JSON object with the following fields:

  • success (boolean): Indicates whether the update request was successful (HTTP status code 2xx).
  • statusCode (number): The HTTP status code returned by the CardDAV server.
  • contactId (string): The identifier of the contact that was updated.
  • addressBookPath (string): The normalized server-relative path to the address book where the contact resides.

No binary data output is produced by this operation.

Example output JSON:

{
  "success": true,
  "statusCode": 204,
  "contactId": "contact-123",
  "addressBookPath": "/addressbooks/user/contacts/"
}

Dependencies

  • Requires access to a CardDAV server with proper credentials configured in n8n.
  • An API key or authentication token credential must be set up for the CardDAV server connection.
  • The base URL of the CardDAV server must include the protocol (http:// or https://) and be correctly configured in the credentials.
  • The node uses HTTP PUT requests with appropriate headers (Content-Type: text/vcard and If-Match: *) to update contacts.

Troubleshooting

  • Invalid Base URL: If the base URL in credentials is missing protocol or malformed, the node will throw an error. Ensure the URL starts with http:// or https://.
  • Absolute URLs in paths: Paths must be server-relative starting with /. Absolute URLs in path parameters cause errors.
  • Host not found / Connection refused / Timeout: These errors indicate network issues or incorrect server hostname/port. Verify server accessibility and credentials.
  • HTTP errors: Non-2xx responses will result in failure. Check server logs and ensure the contact ID exists and the user has write permissions.
  • vCard formatting: The contact data must be valid vCard format. Invalid vCard content may cause the server to reject the update.

To resolve errors, verify all input parameters, credentials, and network connectivity.

Links and References

Discussion