Skip to content

Create a calendar

POST
/calendars
curl --request POST \
--url https://calendar.work.optidata.cloud/api/calendars \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Team planning", "customization_color": "#EBBC00" }'

Creates a calendar owned by the authenticated user, optionally sharing it with other people in the same request through members.

Names are limited to 255 characters, may not contain :, /, ? or ", and may not reuse one of the reserved mailbox folder names (Calendar, Contacts, Tasks, Inbox, Trash, …).

Media typeapplication/json

Body accepted when creating or updating a calendar.

object
name
required

Display name. May not contain :, /, ? or ", and may not reuse a reserved mailbox folder name.

string
>= 1 characters <= 255 characters
customization_color

Hex colour, three or six digits.

string | null
/^#([a-fA-F0-9]{3}){1,2}$/
members

The members already on the calendar. Mark an entry needsUpdate: true to change that person’s role.

Array<object>

A person to grant or withdraw access. invitable is the directory entry that identifies them — pass the object returned by GET /search/invitables; only email is strictly needed.

object
type

user is somebody with an Optiwork account in the tenant, group a user group, and guest an address outside it.

string
Allowed values: user guest group
role

What a member may do with a calendar. viewer reads it, manager also creates and edits events and may answer invitations on the owner’s behalf, admin additionally manages sharing, and owner is the person the calendar belongs to.

string
Allowed values: viewer manager admin owner
optiworkIdentifier

Optiwork identifier of the member, when they have one.

string | null
needsUpdate

In members, marks an existing member whose role should change.

boolean | null
invitable
required

Directory entry identifying the member.

object
email
string format: email
name
string
key
additional properties
any
members_to_add

People who should gain access.

Array<object>

A person to grant or withdraw access. invitable is the directory entry that identifies them — pass the object returned by GET /search/invitables; only email is strictly needed.

object
type

user is somebody with an Optiwork account in the tenant, group a user group, and guest an address outside it.

string
Allowed values: user guest group
role

What a member may do with a calendar. viewer reads it, manager also creates and edits events and may answer invitations on the owner’s behalf, admin additionally manages sharing, and owner is the person the calendar belongs to.

string
Allowed values: viewer manager admin owner
optiworkIdentifier

Optiwork identifier of the member, when they have one.

string | null
needsUpdate

In members, marks an existing member whose role should change.

boolean | null
invitable
required

Directory entry identifying the member.

object
email
string format: email
name
string
key
additional properties
any
members_to_remove

People whose access should be withdrawn.

Array<object>

A person to grant or withdraw access. invitable is the directory entry that identifies them — pass the object returned by GET /search/invitables; only email is strictly needed.

object
type

user is somebody with an Optiwork account in the tenant, group a user group, and guest an address outside it.

string
Allowed values: user guest group
role

What a member may do with a calendar. viewer reads it, manager also creates and edits events and may answer invitations on the owner’s behalf, admin additionally manages sharing, and owner is the person the calendar belongs to.

string
Allowed values: viewer manager admin owner
optiworkIdentifier

Optiwork identifier of the member, when they have one.

string | null
needsUpdate

In members, marks an existing member whose role should change.

boolean | null
invitable
required

Directory entry identifying the member.

object
email
string format: email
name
string
key
additional properties
any
Examples

A private calendar

{
"name": "Team planning",
"customization_color": "#EBBC00"
}

The created calendar.

Media typeapplication/json
object
calendar
required

A calendar the caller owns or has been given access to.

object
id
required

Id of the calendar, as digits.

string | null
sharedId

For a calendar shared with the caller, its {ownerZid}:{calendarId} identifier. null for a calendar the caller owns.

string | null
uuid
string | null
name
required
string | null
color

Hex colour used to render the calendar.

string | null
exportUrl

Populated only when a subscription feed has been generated.

string | null
folderPath
string | null
parentFolderId
string | null
parentFolderUuid
string | null
linkedCalendarId

For a shared calendar, its id in the owner’s account.

string | null
linkedCalendarUuid
string | null
ownerZid
string | null
ownerEmail
string | null
ownerName
string | null
userRole
One of:

What a member may do with a calendar. viewer reads it, manager also creates and edits events and may answer invitations on the owner’s behalf, admin additionally manages sharing, and owner is the person the calendar belongs to.

string
Allowed values: viewer manager admin owner
isHomeCalendar
required

true for the user’s primary calendar, which cannot be renamed or deleted.

boolean
isDeletable
required
boolean
isShared
required

true when the calendar belongs to somebody else.

boolean
isBroken
required

true when a shared calendar can no longer be resolved — usually because the owner revoked access or deleted it.

boolean
permissions
required

Who the calendar is shared with, and at which role.

Array<object>

One person’s access to a calendar.

object
role

What a member may do with a calendar. viewer reads it, manager also creates and edits events and may answer invitations on the owner’s behalf, admin additionally manages sharing, and owner is the person the calendar belongs to.

string
Allowed values: viewer manager admin owner
memberType

user is somebody with an Optiwork account in the tenant, group a user group, and guest an address outside it.

string
Allowed values: user guest group
memberZid

Mailbox identifier of the member.

string | null
memberEmail

Address of the member.

string | null
memberName
string | null
memberAvatarUrl
string | null
memberOptiworkIdentifier

Optiwork identifier of the member — the value to send back as optiworkIdentifier.

string | null
Examples
Examplecreated
{
"calendar": {
"id": "3623",
"name": "Team planning",
"color": "#EBBC00",
"folderPath": "/Team planning",
"userRole": "owner",
"isHomeCalendar": false,
"isDeletable": true,
"isShared": false,
"isBroken": false,
"permissions": []
}
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The event title field is required.",
"errors": {
"title": [
"The event title field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}