CiviCRM icon

CiviCRM

Interact with CiviCRM API v4 to manage contacts, memberships, groups, and more.

Relationship → Create

AI-generated

Summary

Create a CiviCRM relationship using the supplied field names and values, then fetch and return the created relationship. The request uses the configured credential unless a runtime bearer token or base URL override is supplied.

Inputs

  • Fields — Add one or more field name/value pairs for the relationship. Values are converted from strings to booleans, numbers, or JSON objects/arrays when possible; empty values are omitted. Supply the fields required by your CiviCRM instance, such as the relationship’s contact IDs and relationship type.
  • Runtime Bearer Token (Optional) — Optionally provide an already-issued JWT, commonly from an input expression such as ={{ $json.user_jwt }}. It is sent as the bearer token for the API calls and bypasses credential-based authentication; errors or empty results do not trigger an API key retry.
  • Base URL Override — Optionally replace the credential’s base URL for this item. Supply the site root without /civicrm; a missing scheme defaults to HTTPS, and only HTTP or HTTPS URLs are accepted.

Output shape

A single item per input item, containing the created relationship record as JSON.

After creation, the node retrieves the record by its returned ID. If creation yields no ID, it raises an error. With Continue On Fail enabled, an item error is returned as { "error": "..." } instead.

Links

Discussion