v1

latestOpenAPI 3.0.12026-07-22120163333.7 KB
Calendar V2 API

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.
post/v2.0/calendar

Headers

Authorizationstring required

Bearer [access_token]

Content-Typestring required

application/json

Request body

typestring required

Calendar type: TASK or APPOINTMENT

contentstring required

Content/Description of the calendar event

leadIdinteger required

Lead ID associated with this calendar event

startAtstring

Start time in ISO8601 format with timezone. Preferred over startAtMs when both are provided.

endAtstring

End time in ISO8601 format. Preferred over endAtMs when both are provided.

startAtMsinteger

Start time as Unix timestamp in milliseconds. Used when startAt is not provided.

endAtMsinteger

End time as Unix timestamp in milliseconds. Used when endAt is not provided.

timeZoneCodestring required

Timezone code

taskWaystring

Task way type: Call, Email, Text, Other (only for TASK)

assignedRolestring

Assigned role: Agent or Assistant (only for TASK)

addressstring

Location/Address (only for APPOINTMENT)

Example request

{
  "type": "TASK",
  "content": "Follow up with client about property",
  "leadId": 563172647619608,
  "startAt": "2026-03-01T14:00:00-08:00",
  "endAt": "2026-03-01T15:00:00-08:00",
  "startAtMs": 1740866400000,
  "endAtMs": 1740870000000,
  "timeZoneCode": "America/Los_Angeles",
  "taskWay": "Call",
  "assignedRole": "Agent",
  "address": "123 Main St, Los Angeles, CA"
}

Response

Calendar created. The response wraps CalendarCreateResult under the 'data' key.

Example response

{
  "data": {
    "id": "12345-task",
    "type": "TASK"
  }
}