Skip to content

MngAddCalendarEvent

Creates a calendar event. The event owner is automatically added as an organizer participant.

Defaults

  • If created_by = 0 or is omitted, backend uses manager id from __access.
  • If owner_manager_id = 0 or is omitted, backend sets owner_manager_id = created_by.
  • Owner is automatically added to participants as role = 0, status = 1.

Validation

  • start_time must be greater than 0.
  • end_time must be greater than or equal to start_time.
  • ast_json can be null, string, object, or array.

Request

{
  "command": "MngAddCalendarEvent",
  "extID": "1",
  "data": {
    "brand": "default",
    "desk": "DESK_RETENTION",
    "owner_manager_id": 10,
    "title": "Retention sync",
    "type": 3,
    "priority": 1,
    "start_time": 1710000000,
    "end_time": 1710003600,
    "ast_json": {
      "type": "doc",
      "content": []
    },
    "participant_manager_ids": [10, 11, 12]
  }
}

Request Data

Field Type Required Description
title string Yes Calendar title
start_time time_t Yes Event start
end_time time_t Yes Event end
brand string No Brand namespace
desk string No CRM desk code
owner_manager_id int No Organizer/main assignee
created_by int No Creator manager id
type int No Event type
status int No Event status
priority int No Event priority
ast_json object/array/string/null No Visible AST message body
all_day int No 0 or 1
remind_time time_t No Absolute reminder time
remind_before_sec int No Reminder offset before start
customer_id int No Linked customer id
lead_id int No Linked lead id
login int No Linked account login
participant_manager_ids int[] No Required participants by manager id
participants object[] No Detailed participant rows

Participants Object

Field Type Required Description
manager_id int Yes Participant manager id
role int No 0 organizer, 1 required, 2 optional
status int No 0 invited, 1 accepted, 2 declined, 3 tentative
created_time time_t No Optional create timestamp
updated_time time_t No Optional update timestamp

If both participants and participant_manager_ids are sent, participants is used.

Response Data

Returns the full event object with participants. Example is shortened.

{
  "event": {
    "id": 1,
    "brand": "default",
    "desk": "DESK_RETENTION",
    "owner_manager_id": 10,
    "created_by": 10,
    "title": "Retention sync",
    "start_time": 1710000000,
    "end_time": 1710003600,
    "participants": [
      {
        "event_id": 1,
        "manager_id": 10,
        "role": 0,
        "status": 1
      }
    ]
  }
}