Create Calendar Event
Creates either a Task or an Appointment for the target lead, selected by the ‘type’ field (case-insensitive TASK / APPOINTMENT).
Notes:
- Caller must have manage permission on the lead; otherwise 400 PERMISSION_DENIED (20017).
- type, leadId, content, startAt and endAt are required. taskWay is additionally required when type = TASK.
- startAt and endAt must be later than the current server time.
- The returned data.id is a composite string (‘
<numericId>-task’ or ‘<numericId>-appointment’) and must be used as-is when updating, finishing or deleting this entry. - When startAt and endAt are both exactly midnight (00:00:00) in their declared offsets, an appointment is automatically marked as all-day.
Body
Calendar payload. type decides whether a Task or Appointment is created.
Calendar type: TASK or APPOINTMENT
"TASK"
Content/Description of the calendar event
"Follow up with client about property"
Lead ID associated with this calendar event
563172647619608
Timezone code
"America/Los_Angeles"
Start time in ISO8601 format with timezone. Preferred over startAtMs when both are provided.
"2026-03-01T14:00:00-08:00"
End time in ISO8601 format. Preferred over endAtMs when both are provided.
"2026-03-01T15:00:00-08:00"
Start time as Unix timestamp in milliseconds. Used when startAt is not provided.
1740866400000
End time as Unix timestamp in milliseconds. Used when endAt is not provided.
1740870000000
Task way type: Call, Email, Text, Other (only for TASK)
"Call"
Assigned role: Agent or Assistant (only for TASK)
"Agent"
Location/Address (only for APPOINTMENT)
"123 Main St, Los Angeles, CA"
Response
Calendar created. The response wraps CalendarCreateResult under the 'data' key.
Calendar creation response envelope
Calendar creation result