Log activity
civicrm_log_activityLog a new activity for a target contact in CiviCRM. Requires contact ID, activity type, and subject.
Instructions
Record an Activity against a target contact. Requires CIVICRM_ALLOW_WRITES=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Activity status name, e.g. Completed, Scheduled, Cancelled. | Completed |
| details | No | Long-form activity body (HTML allowed). | |
| subject | Yes | Short subject line for the activity. | |
| activity_date | No | ISO-8601 datetime, e.g. '2026-04-23 14:30:00'. Defaults to now. | |
| activity_type | Yes | Activity type name (machine label), e.g. 'Phone Call', 'Meeting', 'Email', or a custom type. Use civicrm_api4 OptionValue.get option_group='activity_type' to list. | |
| source_contact_id | No | Contact recorded as the author of the activity. Defaults to the API user. | |
| target_contact_id | Yes | Primary contact the activity is about (target). | |
| assignee_contact_id | No |