Create a new calendar

After being created, the calendar will be connected to the specified calendar platform.

Headers
  • Authorization
    Type: string
    required

    API key for authentication

  • Content-Type
    Type: string
    required

    Should always be application/json

Body
required
application/json
  • client_id
    Type: string
    min length:  
    1
    required

    The client ID for the calendar platform authentication

  • client_secret
    Type: string
    min length:  
    1
    required

    The client secret for the calendar platform authentication

  • platform
    Type: string · PlatformEnumenum
    required
    • google - Google
    • microsoft - Microsoft
    values
    • google
    • microsoft
  • refresh_token
    Type: string
    min length:  
    1
    required

    The refresh token for accessing the calendar platform

  • deduplication_key
    Type: string
    min length:  
    1

    Optional key for deduplicating calendars. If a calendar with this key already exists in the project, the new calendar will not be created and an error will be returned.

  • metadata

    JSON object containing metadata to associate with the calendar

  • platform_uuid
    Type: string
    min length:  
    1

    The UUID of the calendar on the calendar platform. Specify only for non-primary calendars.

Responses
  • application/json
  • 400

    Invalid input

Request Example for post/api/v1/calendars
curl https://app.attendee.dev/api/v1/calendars \
  --request POST \
  --header 'Authorization: Token YOUR_API_KEY_HERE' \
  --header 'Content-Type: application/json' \
  --data '{
  "client_id": "123456789-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com",
  "client_secret": "GOCSPX-abcdefghijklmnopqrstuvwxyz",
  "refresh_token": "1//04abcdefghijklmnopqrstuvwxyz",
  "platform": "google",
  "metadata": {
    "tenant_id": "1234567890"
  },
  "deduplication_key": "user-abcd"
}'
{
  "id": "cal_abcdef1234567890",
  "platform": "google",
  "state": "connected",
  "metadata": {
    "tenant_id": "1234567890"
  },
  "deduplication_key": "user-abcd",
  "connection_failure_data": null,
  "created_at": "2025-01-13T10:30:00.123456Z",
  "updated_at": "2025-01-13T10:30:00.123456Z"
}