PUT
/
api
/
v1
/
calendar
/
events
/
{event_id}
/
update
{
  "id": 123,
  "uuid": "<string>",
  "title": "<string>",
  "start_time": "<string>",
  "end_time": "<string>",
  "status": "<string>",
  "message": "<string>",
  "error": "<string>"
}

Update an existing calendar event. You can use either PUT (full update) or PATCH (partial update) methods.

Path Parameters

event_id
string
required

ID or UUID of the event to update.

Request Body

title
string

Event title.

description
string

Event description.

start_time
string

Event start time.

end_time
string

Event end time.

event_type
string

Type of event. One of: meeting, appointment, busy, voice_call, video_call.

status
string

Event status. One of: scheduled, confirmed, cancelled, completed, no_show.

location
string

Event location.

customer_name
string

Customer name.

customer_email
string

Customer email.

customer_phone
string

Customer phone number.

customer_notes
string

Notes about the customer or appointment.

has_video_conference
boolean

Whether the event has video conferencing enabled.

video_conference_url
string

URL for video conferencing.

video_conference_provider
string

Provider of video conferencing (e.g., Zoom, Google Meet, etc.).

is_reminder_enabled
boolean

Whether reminders are enabled for this event.

remind_before_minutes
integer

How many minutes before the event to send a reminder.

ai_agent_id
integer

ID of the AI agent to associate with this event.

team_id
integer

ID of the team to associate with this event.

sync_external_calendars
boolean
default:true

Whether to sync this update with connected external calendars.

send_notifications
boolean
default:true

Whether to send notifications about this update.

Response

id
integer

Event ID.

uuid
string

Event UUID.

title
string

Event title.

start_time
string

Event start time.

end_time
string

Event end time.

status
string

Event status.

message
string

Success message.

PUT vs PATCH

  • Use PUT when you want to replace the entire event with the new data (full update)
  • Use PATCH when you want to update only specific fields (partial update)

Example Request (PUT - Full Update)

curl -X PUT 'https://api.klen.ai/api/v1/calendar/events/456/update' \
  -H 'Authorization: Bearer klen_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Updated Product Demo",
    "description": "Updated product demonstration for client",
    "start_time": "2025-05-16T15:00:00.000Z",
    "end_time": "2025-05-16T16:00:00.000Z",
    "event_type": "video_call",
    "status": "confirmed",
    "location": "Online",
    "customer_name": "Jane Doe",
    "customer_email": "[email protected]",
    "customer_phone": "+15551234567",
    "has_video_conference": true,
    "video_conference_provider": "Zoom",
    "is_reminder_enabled": true,
    "remind_before_minutes": 30,
    "send_notifications": true
  }'

Example Request (PATCH - Partial Update)

curl -X PATCH 'https://api.klen.ai/api/v1/calendar/events/456/update' \
  -H 'Authorization: Bearer klen_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "start_time": "2025-05-16T15:00:00.000Z",
    "end_time": "2025-05-16T16:00:00.000Z",
    "send_notifications": true
  }'

Example Response

{
  "id": 456,
  "uuid": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
  "title": "Updated Product Demo",
  "start_time": "2025-05-16T15:00:00.000Z",
  "end_time": "2025-05-16T16:00:00.000Z",
  "status": "confirmed",
  "message": "Event updated successfully"
}

Error Responses

error
string

Error code.

message
string

Error message.

Not Found (404)

{
  "error": "not_found",
  "message": "Event not found or you do not have access"
}

Invalid Date Format (400)

{
  "error": "invalid_datetime_format",
  "message": "Invalid datetime format. Expected ISO 8601 format (YYYY-MM-DDTHH:MM:SS)"
}

Invalid Time Range (400)

{
  "error": "invalid_time_range",
  "message": "End time must be after start time"
}

Agent Not Found (404)

{
  "error": "agent_not_found",
  "message": "AI agent not found or you do not have access"
}

Team Not Found (404)

{
  "error": "team_not_found",
  "message": "Team not found or you do not have access"
}

Unauthorized (401)

{
  "error": "authentication_required",
  "message": "API key is required"
}

Permission Denied (403)

{
  "error": "permission_denied",
  "message": "This API key does not have can_write_calendar permission"
}

Server Error (500)

{
  "error": "server_error",
  "message": "An unexpected server error occurred"
}