Error adding events using API
Problem reported by Somo IT - 7/26/2026 at 12:56 AM
Resolved
Hello 

Im trying to manage calendar events using API:

List sources -> OK

$ curl -X GET "hxxp://10.10.10.10:8080/api/v1/calendars/sources"   -H "Authorization: Bearer $TOKEN"
{"calendars":[{"folderId":50003,"id":"85871f8e36594ca8bddaf46c15db682b","name":"Calendar","color":"#E695C0","isVisible":true,"isPrimary":true,"isSharedItem":false,"owner":"test","permission":8,"isCalendar":true,"isTask":false,"isConferenceRoom":false,"isDomainResource":false,"internetCalendarLink":"","internetCalendarInterval":60,"isMapped":true,"isWebCalendar":false,"subscriptionUrl":"","webcalLink":"webcal://10.33.14.141:8080/webcal/ZDZhYjNhNWViMWFhNGIzNDg3YmE3OTYwZWUzMzY1OGJ8ZGYwMTdlMGVjZGE0NGRiNWFhM2I1MjYzN2E1ZjI1ZDV8NTAwMDM=","allowWebcalSubscription":false,"emailAlias":null,"sharedResourceType":0}],"tasks":[{"folderId":50004,"id":"a976bce0da2040c5ba61db6373f39cff","name":"Tasks","color":"#C6DE70","isVisible":true,"isPrimary":true,"isSharedItem":false,"owner":"test","permission":8,"isCalendar":false,"isTask":true,"isConferenceRoom":false,"isDomainResource":false,"internetCalendarLink":"","internetCalendarInterval":60,"isMapped":true,"isWebCalendar":false,"subscriptionUrl":"","webcalLink":"","allowWebcalSubscription":false,"emailAlias":null,"sharedResourceType":0}],"resources":[]}

List Events -> OK

$ curl -X GET "hxxp://10.10.10.10:8080/api/v1/calendars/events/test/85871f8e36594ca8bddaf46c15db682b" -H "Authorization: Bearer $TOKEN"
{"events":[{"id":90002,"uid":"540a4f24af2d4edb8d14c2c0155e6370","title":"despedida y cierre","allDay":false,"startWithTZ":{"dt":"2026-07-30T00:30:00+02:00","tz":"Europe/Paris","has_time":true},"endWithTZ":{"dt":"2026-07-30T01:30:00+02:00","tz":"Europe/Paris","has_time":true},"editable":true,"owner":"test","calId":"85871f8e36594ca8bddaf46c15db682b","calName":"Calendar","location":"en la calle","isRecurring":false,"isTentative":false,"isOnlineMeeting":false,"isPrivate":false,"status":3,"resourceId":null,"nextRecurrenceUtc":null,"firstReminder":300,"isTask":false,"isTaskComplete":false,"allowReplies":false,"categories":[],"organizer":{"name":null,"address":"","isOrganizer":false},"reservedBy":null,"orgCalInfo":null,"attendeeCount":0,"resourceCount":0,"permission":10,"hasPrivatePermission":true,"occurrenceId":null,"hasAttachments":false,"lastModified":"2026-07-26T06:08:46.6311819Z"}]}

Delete event -> OK

$ curl -X POST "hxxp://10.10.10.10:8080/api/v1/calendars/events/delete/test/85871f8e36594ca8bddaf46c15db682b/90002/false" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
[]
Add Event -> ERROR?! (CALENDAR_REQUIRES_MANAGE_OR_OWNER_ACCESS)

Im using the user owner. I dont understand what is the problem.

$ curl -X POST "hxxp://10.10.10.10:8080/api/v1/calendars/events/save/test/85871f8e36594ca8bddaf46c15db682b"   -H "Authorization: Bearer $TOKEN"   -H "Content-Type: application/json"   -d '{
    "calendarId": "85871f8e36594ca8bddaf46c15db682b",
    "allDay": false,
    "start": {
      "date_local": "2026-07-27T10:00:00",
      "time_zone_id": "Europe/Madrid",
      "has_time": true
    },
    "end": {
      "date_local": "2026-07-27T11:00:00",
      "time_zone_id": "Europe/Madrid",
      "has_time": true
    },
    "subject": "Reunión de prueba 1",
    "description": "Evento creado desde curl",
    "isPrivate": false
  }'
{"message":"CALENDAR_REQUIRES_MANAGE_OR_OWNER_ACCESS","details":null}

Anyone has managed to make it work?
Thanks!



Douglas Foster Replied
The 400 error suggests to me that you are not considered logged in properly, so there is a problem with the way you are obtaining your AuthToken.
Suggest you look at my post here, to see if it helps you get over the hump.   Sample code is in Python.  It starts with a System admin login, then impersonates a domain and a user to collect information.
Somo IT Replied
Thanks Douglas, but i need it to be done with the user credentials.

The documentation is very cryptic and is difficult to send the correct parameters and endpoint path
Reto Replied
Marked As Resolution
Just use the developer tools and the network tab of your browser to inspect what the webmail is doing to get the correct parameters. An updated api documentation was promised a long time ago, don't wait for that.
Somo IT Replied
Got the correct way by capturing the request.
Thanks

Reply to Thread

Enter the verification text