API call description
- Only the organizer is allowed to update an event. Therefore, the
userIdfield in the path must be the organizer’s unionId. - Pass only the fields that need to be updated in the request. Fields that are not passed remain unchanged.
- Each operation on event attendees supports up to 500 users, and events with up to 5,000 attendees are supported.
- To add or remove event attendees, use the Add event attendees and Remove event attendees APIs.
Request
Basic information
| Field | Value |
|---|---|
| HTTP URL | https://api.dingtalk.io/v1.0/calendar/users/{userId}/calendars/{calendarId}/events/{eventId} |
| HTTP Method | PUT |
| Supported app types | appType-Internal app appType-Third-party enterprise app appType-Third-party personal app |
| Required permissions | permission-Calendar.Event.Write-Write permission for events in the Calendar app |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
| x-client-token | String | No | Idempotency check. - The same x-client-token indicates the same request. - Expires in 1 day. |
| x-acs-dingtalk-access-token | String | Yes | The access credential used to call this API. Obtain it as follows: - For an internal app, call the Get the access token of an internal app API. - For a third-party enterprise app, call the Get the access token of an enterprise authorized to a third-party app API. - For a third-party personal app, call the Get a user token API. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| userId | String | Yes | The unionId of the event organizer. - For internal apps and third-party enterprise apps, call the Query user details API to obtain the value of the unionid parameter. - For third-party personal apps, call the Get user profile from contacts API to obtain the value of the unionId parameter. |
| calendarId | String | Yes | The ID of the calendar to which the event belongs. Set this parameter to primary, which represents the user’s primary calendar. |
| eventId | String | Yes | The event ID. Call the Query an event list API to obtain the value of the id parameter. |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| summary | String | No | The event title. |
| id | String | Yes | The event ID. |
| description | String | No | The event description. |
| start | Object | No | The event start time. |
| date | String | No | The event start date in the format yyyy-MM-dd. - Required for an all-day event. - Must be empty for a non-all-day event. |
| dateTime | String | No | The event start time in ISO-8601 date-time format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| timeZone | String | No | The time zone of the event start time, in TZ database name format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| end | Object | No | The event end time. The number of recurrences (numberOfOccurrences) and the event end time (end) cannot be set at the same time. |
| date | String | No | The event end date in the format yyyy-MM-dd. - Required for an all-day event. - Must be empty for a non-all-day event. |
| dateTime | String | No | The event end time in ISO-8601 date-time format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| timeZone | String | No | The time zone of the event end time. It must be the same as the time zone of the start time, in TZ database name format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| isAllDay | Boolean | No | Whether the event is an all-day event. - true: Yes. - false: No. |
| recurrence | Object | No | The event recurrence rule. |
| pattern | Object | No | The recurrence pattern. |
| type | String | No | The recurrence pattern type. - daily: Repeats every interval days. - weekly: Repeats on daysOfWeek every interval weeks. - absoluteMonthly: Repeats on day dayOfMonth every interval months. - relativeMonthly: Repeats on daysOfWeek of the index week every interval months. - absoluteYearly: Repeats every interval years. |
| dayOfMonth | Integer | No | Specifies the day of the month when the recurrence pattern type is absoluteMonthly. |
| daysOfWeek | String | No | Specifies the day of the week in lowercase English. Separate multiple values with commas. |
| index | String | No | Specifies the week of the month when the type is relativeMonthly. - first: The first week. - second: The second week. - third: The third week. - fourth: The fourth week. - last: The last week. |
| interval | Integer | No | The recurrence interval. The unit varies depending on the type. For example: - When type is daily, it represents an interval of N days. - When type is absoluteYearly, it represents an interval of N years. |
| firstDayOfWeek | String | No | The first day of the week. Valid values: sunday, monday, tuesday, wednesday, thursday, friday, saturday. Default: “sunday”. |
| range | Object | No | The recurrence range. |
| type | String | No | The recurrence range type. - noEnd: Never ends. - endDate: Ends on a specified date. - numbered: Ends after a specified number of recurrences. |
| endDate | String | No | The recurrence end time. endDate and numberOfOccurrences cannot be set at the same time. |
| numberOfOccurrences | Integer | No | The number of recurrences. endDate and numberOfOccurrences cannot be set at the same time. |
| attendees | Array | No | The list of event attendees. |
| id | String | No | The user’s unionId. |
| String | No | The mail address. | |
| isOptional | Boolean | No | Whether the attendee is optional. - true: Yes. - false: No. |
| location | Object | No | The event location. |
| displayName | String | No | The name of the event location. |
| extra | Map<String, String> | No | A JSON-formatted set of extension switches. Optional. The attributes are defined as follows: - noPushNotification: Whether to send a DingTalk push notification to associated users when the event is created. - true: Do not send. - false: Send. - noChatNotification: Whether to send a direct message card to attendees when the event is created. - true: Do not send. - false: Send. |
| reminders | Array | No | Event reminders. Multiple reminders can be added. - If this parameter is not passed, the default reminder time is: - Non-all-day event: 15 minutes before the start time. - All-day event: 9 AM on the day before the start. - If empty data is passed, no reminder is created. |
| method | String | No | The reminder method. - dingtalk: In-app reminder on DingTalk. |
| minutes | Integer | No | Sends the reminder N minutes before the event starts. |
| onlineMeetingInfo | Object | No | The video meeting. Passing this field on update creates a new video meeting. If a video meeting already exists, passing this field overwrites the existing one. |
| type | String | No | The online meeting type. - dingtalk: DingTalk video meeting. |
| richTextDescription | Object | No | The rich text field. |
| text | String | No | The rich text value. |
| uiConfigs | Array | No | UI configurations that control the display of components on the event details page. |
| uiName | String | Yes | The component name. Valid values (continuously updated): - updateEventButton: Edit Event button. - deleteEventButton: Delete Event button. - transferEventButton: Transfer Event button. - attendee: Attendee area. - comment: Event comment area. |
| uiStatus | String | Yes | The component status. Valid values: - hide: Hidden. - disable: Disabled (supported on the new details page; not supported on earlier versions, where the component is hidden instead). For button components: cannot be clicked. For area components: cannot be interacted with. For example, if the comment area is set to disable, comments cannot be written, but existing comments remain visible. - enable: Available (default state). |
Request example
HTTPResponse
Response body
| Name | Type | Description |
|---|---|---|
| id | String | The event ID. |
| summary | String | The event title. |
| description | String | The event description. |
| start | Object | The event start time. |
| date | String | The event start date in the format yyyy-MM-dd. - Required for an all-day event. - Must be empty for a non-all-day event. |
| dateTime | String | The event start time in ISO-8601 date-time format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| timeZone | String | The time zone of the event start time, in TZ database name format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| end | Object | The event end time. |
| date | String | The event end date in the format yyyy-MM-dd. - Required for an all-day event. - Must be empty for a non-all-day event. |
| dateTime | String | The event end time in ISO-8601 date-time format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| timeZone | String | The time zone of the event end time. It must be the same as the time zone of the start time, in TZ database name format. - Must be empty for an all-day event. - Required for a non-all-day event. |
| isAllDay | Boolean | Whether the event is an all-day event. - true: Yes. - false: No. |
| recurrence | Object | The event recurrence rule. |
| pattern | Object | The recurrence pattern. |
| type | String | The recurrence pattern type. - daily: Repeats every interval days. - weekly: Repeats on daysOfWeek every interval weeks. - absoluteMonthly: Repeats on day dayOfMonth every interval months. - relativeMonthly: Repeats on daysOfWeek of the index week every interval months. - absoluteYearly: Repeats every interval years. |
| dayOfMonth | Integer | Specifies the day of the month when the recurrence pattern type is absoluteMonthly. |
| daysOfWeek | String | Specifies the day of the week in lowercase English. Separate multiple values with commas. |
| index | String | Specifies the week of the month when the type is relativeMonthly. - first: The first week. - second: The second week. - third: The third week. - fourth: The fourth week. - last: The last week. |
| interval | Integer | The recurrence interval. The unit varies depending on the type. For example: - When type is daily, it represents an interval of N days. - When type is absoluteYearly, it represents an interval of N years. |
| firstDayOfWeek | String | The first day of the week. Valid values: sunday, monday, tuesday, wednesday, thursday, friday, saturday. Default: “sunday”. |
| range | Object | The recurrence range. |
| type | String | The recurrence range type. - noEnd: Never ends. - endDate: Ends on a specified date. - numbered: Ends after a specified number of recurrences. |
| endDate | String | The recurrence end time. |
| numberOfOccurrences | Integer | The number of recurrences. |
| attendees | Array | The list of event attendees. |
| id | String | The user’s unionId. |
| displayName | String | The username. |
| responseStatus | String | The reply status. |
| self | Boolean | Whether the user is the currently signed-in user. - true: Yes. - false: No. |
| isOptional | Boolean | Whether the attendee is optional. - true: Yes. - false: No. |
| organizer | Object | The event organizer. |
| id | String | The user’s unionId. |
| displayName | String | The username. |
| responseStatus | String | The reply status. |
| self | Boolean | Whether the user is the currently signed-in user. - true: Yes. - false: No. |
| location | Object | The event location information. |
| displayName | String | The display name of the event location. |
| meetingRooms | Array of String | The meeting room information. |
| reminders | Array | The event reminders. |
| method | String | The reminder method. |
| minutes | String | Sends the reminder N minutes before the event starts. |
| createTime | String | The created time. |
| updateTime | String | The update time. |
| onlineMeetingInfo | Object | The online meeting information. |
| type | String | The online meeting type. - dingtalk: DingTalk video meeting. |
| conferenceId | String | The meeting ID. |
| url | String | The URL for joining the meeting. |
| richTextDescription | Object | The rich text field. |
| text | String | The rich text value. |
| uiConfigs | Array | UI configurations that control the display of components on the event details page. |
| uiName | String | The component name. Valid values (continuously updated): - updateEventButton: Edit Event button. - deleteEventButton: Delete Event button. - transferEventButton: Transfer Event button. - attendee: Attendee area. - comment: Event comment area. |
| uiStatus | String | The component status. Valid values: - hide: Hidden. - disable: Disabled (supported on the new details page; not supported on earlier versions, where the component is hidden instead). For button components: cannot be clicked. For area components: cannot be interacted with. For example, if the comment area is set to disable, comments cannot be written, but existing comments remain visible. - enable: Available (default state). |
Response body example
Error codes
If an error is returned when you call this API, look up the solution in the Global error codes document based on the error message.| HttpCode | Error code | Error message | Description |
|---|---|---|---|
| 400 | invalidParameter | forwardErrorMessage | Invalid parameter. |
| 400 | invalidParameter | CalendarId cannot be blank | The calendar ID cannot be empty. |
| 400 | invalidParameter | Event must be provided. | The event cannot be empty. |
| 400 | invalidParameter | Event id summary cannot be blank | The event ID cannot be empty. |
| 400 | invalidParameter | Recurrence range numberOfOccurrences must between [1, 99] | numberOfOccurrences must be within the range [1, 99]. |
| 400 | invalidParameter | Recurrence interval must between [1, 365] | interval must be within the range [1, 365]. |
| 400 | invalidParameter | Meeting room invalid | The meeting room is not available. |
| 400 | idempotencyProcessing | Idempotency processing | The idempotent request is being processed. |
| 404 | itemNotFound | forwardErrorMessage | The specified event cannot be found. |