Skip to content

REST Integration

CRM ships optional REST configuration for the contact entity. Resource plugin ID: entity:crm_contact; config in config/optional/rest.resource.entity.crm_contact.yml. For JSON:API, see JSON:API Integration.

Requirements

  • CRM module enabled.
  • Drupal core REST module enabled (drush pm:enable rest).
  • Optional config imported (see below).
  • Authentication configured for your site (cookie auth is in the default optional config; production sites typically use additional auth plugins).

What you get

When configured, the contact entity supports REST operations:

Method Formats
GET json, xml
POST json, xml
PATCH json, xml
DELETE json, xml

Default optional config uses cookie authentication. Adjust formats and auth in the REST UI at Admin > Configuration > Web services > REST or by editing the REST resource config entity.

Enabling REST alongside CRM

  1. Enable the REST module:
ddev drush pm:enable rest -y
  1. Import CRM optional REST config if not already present:
ddev drush config:import --partial --source=modules/contrib/crm/config/optional -y
  1. Clear caches:
ddev drush cache:rebuild
  1. Grant permissions — REST requires appropriate entity permissions (for example view any crm contact, create any crm contact) plus REST-specific permissions from the REST module.

Limitations

  • Only crm_contact has optional REST config in CRM core; other CRM entities are not pre-configured.
  • CRM optional REST config lists a dependency on the user module only; the REST module must be enabled separately.
  • No custom CRM REST endpoints beyond the standard entity resource plugin.