cal/calendso.yaml
Bailey Pumfleet 9195ef41f3
Added bodies and responses for availability calls (#569)
Co-authored-by: bailey <bailey@calendso.com>
2021-09-04 11:28:05 +01:00

562 lines
18 KiB
YAML

openapi: 3.0.0
info:
title: Calendso API
description: The open source Calendly alternative.
contact:
name: Support
email: support@calendso.com
license:
name: MIT License
url: 'https://opensource.org/licenses/MIT'
version: 1.0.0
termsOfService: 'https://calendso.com/terms'
server:
url: 'http://localhost:{port}'
description: Local Development Server
variables:
port:
default: '3000'
tags:
- name: Authentication
description: 'Auth routes, powered by Next-Auth.js'
externalDocs:
url: 'http://next-auth.js.org/'
- name: Availability
description: Checking and setting user availability
- name: Booking
description: Create and manage bookings
- name: Integrations
description: Manage integrations
- name: User
description: Manage the user's profile and settings
- name: Teams
description: Manage teams
paths:
/api/auth/signin:
get:
description: Displays the sign in page.
summary: Displays the sign in page
tags:
- Authentication
'/api/auth/signin/:provider':
post:
description: Starts an OAuth signin flow for the specified provider. The POST submission requires CSRF token from /api/auth/csrf.
summary: Starts an OAuth signin flow for the specified provider
tags:
- Authentication
'/api/auth/callback/:provider':
get:
description: 'Handles returning requests from OAuth services during sign in. For OAuth 2.0 providers that support the state option, the value of the state parameter is checked against the one that was generated when the sign in flow was started - this uses a hash of the CSRF token which MUST match for both the POST and GET calls during sign in.'
summary: Handles returning requests from OAuth services
tags:
- Authentication
/api/auth/signout:
get:
description: Displays the sign out page.
summary: Displays the sign out page
tags:
- Authentication
post:
description: Handles signing out - this is a POST submission to prevent malicious links from triggering signing a user out without their consent. Handles signing out - this is a POST submission to prevent malicious links from triggering signing a user out without their consent.
summary: Handles signing out
tags:
- Authentication
/api/auth/signup:
post:
description: Creates a new user from an invitation.
summary: Create a new user
tags:
- Authentication
/api/auth/session:
get:
description: Returns client-safe session object - or an empty object if there is no session. The contents of the session object that is returned are configurable with the session callback.
summary: Returns client-safe session object
tags:
- Authentication
/api/auth/csrf:
get:
description: 'Returns object containing CSRF token. In NextAuth.js, CSRF protection is present on all authentication routes. It uses the "double submit cookie method", which uses a signed HttpOnly, host-only cookie. The CSRF token returned by this endpoint must be passed as form variable named csrfToken in all POST submissions to any API endpoint.'
summary: Returns object containing CSRF token
tags:
- Authentication
/api/auth/providers:
get:
description: Returns a list of configured OAuth services and details (e.g. sign in and callback URLs) for each service. It can be used to dynamically generate custom sign up pages and to check what callback URLs are configured for each OAuth provider that is configured.
summary: Returns configured OAuth services
tags:
- Authentication
/api/auth/changepw:
post:
description: Changes the password for the currently logged in account.
summary: Changes the password for the currently logged in account
tags:
- Authentication
/api/auth/forgot-password:
post:
description: Send a password reset email.
summary: Send a password reset email
tags:
- Authentication
/api/auth/reset-password:
post:
description: Reset a user's password with their password reset token.
summary: Reset a user's password
tags:
- Authentication
'/api/availability/{user}?dateFrom={dateFrom}&dateTo={dateTo}':
get:
description: 'Gets the busy times for a particular user, by username.'
summary: Gets the busy times for a user
tags:
- Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
description: ''
minItems: 1
uniqueItems: true
x-examples:
example-1:
- start: 'Fri, 03 Sep 2021 17:00:00 GMT'
end: 'Fri, 03 Sep 2021 17:40:00 GMT'
items:
type: object
properties:
start:
type: string
minLength: 1
end:
type: string
minLength: 1
required:
- start
- end
'500':
description: Internal Server Error
parameters:
- schema:
type: string
name: user
in: path
required: true
description: The username of who you want to check availability for
- schema:
type: string
name: dateFrom
in: path
required: true
description: The timestamp of which time you want to get busy times from
- schema:
type: string
name: dateTo
in: path
required: true
description: The timestamp of which time you want to get busy times until
/api/availability/calendar:
get:
description: Gets the user's selected calendars.
summary: Gets the user's selected calendars
tags:
- Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
description: ''
minItems: 1
uniqueItems: true
items:
type: object
required:
- selected
- externalId
- integration
- name
- primary
properties:
selected:
type: boolean
externalId:
type: string
minLength: 1
integration:
type: string
minLength: 1
name:
type: string
minLength: 1
primary:
type: boolean
x-examples:
example-1:
- selected: false
externalId: en.uk#holiday@group.v.calendar.google.com
integration: google_calendar
name: Holidays in United Kingdom
- selected: false
externalId: addressbook#contacts@group.v.calendar.google.com
integration: google_calendar
name: Birthdays
- selected: true
externalId: bailey@calendso.com
integration: google_calendar
name: Calendso
primary: true
- selected: true
externalId: bpumfleet@gmail.com
integration: google_calendar
name: Personal
- selected: false
externalId: connor@cal.com
integration: google_calendar
name: connor@cal.com
- selected: false
externalId: c_feunmui1m8el5o1oo885fu48k8@group.calendar.google.com
integration: google_calendar
name: 1.0 Launch
'500':
description: Internal Server Error
post:
description: Adds a selected calendar for the user.
summary: Adds a selected calendar for the user
tags:
- Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
'500':
description: Internal Server Error
requestBody:
content:
application/json:
schema:
type: object
properties:
integration:
type: string
externalId:
type: string
delete:
description: Removes a selected calendar for the user.
summary: Removes a selected calendar for the user
tags:
- Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
'500':
description: Internal Server Error
requestBody:
content:
application/json:
schema:
type: object
properties:
externalId:
type: string
integration:
type: string
/api/availability/day:
patch:
description: Updates the start and end times for a user's availability.
summary: Updates the user's start and end times
tags:
- Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
message:
type: string
requestBody:
content:
application/json:
schema:
type: object
properties:
startMins:
type: string
endMins:
type: string
bufferMins:
type: string
description: ''
/api/availability/eventtype:
post:
description: Adds a new event type for the user.
summary: Adds a new event type
tags:
- Availability
requestBody:
content:
application/json:
schema:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
eventType:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
'500':
description: Internal Server Error
patch:
description: Updates an event type for the user.
summary: Updates an event type
tags:
- Availability
requestBody:
content:
application/json:
schema:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
eventType:
type: object
properties:
title:
type: string
slug:
type: string
description:
type: string
length:
type: string
hidden:
type: boolean
requiresConfirmation:
type: boolean
locations:
type: array
items: {}
eventName:
type: string
customInputs:
type: array
items: {}
'500':
description: Internal Server Error
delete:
description: Deletes an event type for the user.
summary: Deletes an event type
tags:
- Availability
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties: {}
'500':
description: Internal Server Error
'/api/book/:user':
post:
description: Creates a booking in the user's calendar.
summary: Creates a booking for a user
tags:
- Booking
/api/book/confirm:
post:
description: Accepts an opt-in booking.
summary: Accepts an opt-in booking
tags:
- Booking
/api/integrations:
get:
description: Gets a list of the user's integrations.
summary: Gets the user's integrations
tags:
- Integrations
delete:
description: Deletes a user's integration
summary: Deletes a user's integration
tags:
- Integrations
/api/integrations/googlecalendar/add:
get:
description: Gets the OAuth URL for a Google Calendar integration.
summary: Gets the OAuth URL
tags:
- Integrations
/api/integrations/googlecalendar/callback:
post:
description: Gets and stores the OAuth token for a Google Calendar integration.
summary: Gets and stores the OAuth token
tags:
- Integrations
/api/integrations/office365calendar/add:
get:
description: Gets the OAuth URL for a Microsoft 365/Outlook integration.
summary: Gets the OAuth URL
tags:
- Integrations
/api/integrations/office365calendar/callback:
post:
description: Gets and stores the OAuth token for a Microsoft 365/Outlook integration.
summary: Gets and stores the OAuth token
tags:
- Integrations
/api/integrations/zoomvideo/add:
get:
description: Gets the OAuth URL for a Zoom integration.
summary: Gets the OAuth URL
tags:
- Integrations
/api/integrations/zoomvideo/callback:
post:
description: Gets and stores the OAuth token for a Zoom integration.
summary: Gets and stores the OAuth token
tags:
- Integrations
/api/user/profile:
patch:
description: Updates a user's profile.
summary: Updates a user's profile
tags:
- User
/api/user/membership:
get:
description: Get a list of the teams the user has joined.
summary: Get the teams a user is joined to
tags:
- User
patch:
description: Accept team invitation
summary: Accept team invitation.
tags:
- User
delete:
description: Leave team or decline membership invite of current user
summary: Leave team or decline team invite.
tags:
- User
'/api/:team':
delete:
description: Deletes a team
summary: Deletes a team
tags:
- Teams
'/api/:team/invite':
post:
description: Invites someone to a team.
summary: Invites someone to a team
tags:
- Teams
'/api/:team/membership':
get:
description: Lists the members of a team.
summary: Lists members of a team
tags:
- Teams
delete:
description: Cancels a membership (invite) to a team
summary: Cancels a membership
tags:
- Teams
servers:
- url: 'https://app.calendso.com'
description: Production
components:
securitySchemes: {}