{ "swagger": "2.0", "info": { "description": "This is the API for Schej.it!", "title": "Schej.it API", "contact": {}, "license": {}, "version": "1.0" }, "host": "localhost:3002/api", "paths": { "/analytics/downgrade-user": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Downgrades the specified user to Schej Free", "parameters": [ { "description": "Object containing the user email", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "email": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/analytics/monthly-active-event-creators": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Gets the daily count of monthly active event creators over a date range", "parameters": [ { "type": "string", "description": "Start date (YYYY-MM-DD) for the range", "name": "startDate", "in": "query", "required": true }, { "type": "string", "description": "End date (YYYY-MM-DD) for the range", "name": "endDate", "in": "query", "required": true }, { "type": "integer", "description": "Client's timezone offset in minutes from UTC (e.g., -420 for UTC-7)", "name": "timezoneOffset", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "count": { "type": "integer" }, "date": { "type": "string" } } } ] } } }, "400": { "description": "Invalid date format, range, or timezone offset", "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "error": { "type": "string" } } } ] } }, "500": { "description": "Internal server error", "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "error": { "type": "string" } } } ] } } } } }, "/analytics/monthly-active-event-creators-with-more-than-x-events": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Gets the daily count of monthly active event creators over a date range with more than x events", "parameters": [ { "type": "string", "description": "Start date (YYYY-MM-DD) for the range", "name": "startDate", "in": "query", "required": true }, { "type": "string", "description": "End date (YYYY-MM-DD) for the range", "name": "endDate", "in": "query", "required": true }, { "type": "integer", "description": "Client's timezone offset in minutes from UTC (e.g., -420 for UTC-7)", "name": "timezoneOffset", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "count": { "type": "integer" }, "date": { "type": "string" } } } ] } } }, "400": { "description": "Invalid date format, range, or timezone offset", "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "error": { "type": "string" } } } ] } }, "500": { "description": "Internal server error", "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "error": { "type": "string" } } } ] } } } } }, "/analytics/scanned-poster": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Notifies us when poster QR code has been scanned", "parameters": [ { "description": "Object containing the location that poster was scanned from and the url that was scanned", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "location": { "$ref": "#/definitions/models.Location" }, "url": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/analytics/upgrade-dialog-viewed": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Notifies us when user has viewed the upgrade dialog", "parameters": [ { "description": "Object containing the user id", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "userId": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/analytics/upgrade-user": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Upgrades the specified user to Schej Premium", "parameters": [ { "description": "Object containing the user email", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "email": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/analytics/user/{email}": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Gets the user by email", "parameters": [ { "type": "string", "description": "User email", "name": "email", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.User" } } } } }, "/auth/sign-in": { "post": { "description": "Signs user in and sets the access token session variable", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Signs user in", "parameters": [ { "description": "Object containing the Google authorization code, scope, calendar type, and the user's timezone offset", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "calendarType": { "type": "string" }, "code": { "type": "string" }, "scope": { "type": "string" }, "timezoneOffset": { "type": "integer" } } } ] } } ], "responses": { "200": {} } } }, "/auth/sign-in-mobile": { "post": { "description": "Signs user in and sets the access token session variable", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Signs user in from mobile", "parameters": [ { "description": "Object containing the Google authorization code, calendar type, and the user's timezone offset", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "accessToken": { "type": "string" }, "calendarType": { "type": "string" }, "expiresIn": { "type": "integer" }, "idToken": { "type": "string" }, "refreshToken": { "type": "string" }, "scope": { "type": "string" }, "timezoneOffset": { "type": "integer" }, "tokenOrigin": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/auth/sign-out": { "post": { "description": "Signs user out and deletes the session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Signs user out", "responses": { "200": {} } } }, "/auth/status": { "get": { "description": "Returns a 401 error if user is not signed in, 200 if they are", "tags": [ "auth" ], "summary": "Gets whether the user is signed in or not", "responses": { "200": {}, "401": { "description": "Error object", "schema": { "$ref": "#/definitions/responses.Error" } } } } }, "/events": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Creates a new event", "parameters": [ { "description": "Object containing info about the event to create", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "attendees": { "type": "array", "items": { "type": "string" } }, "blindAvailabilityEnabled": { "type": "boolean" }, "dates": { "type": "array", "items": { "type": "string" } }, "daysOnly": { "type": "boolean" }, "duration": { "type": "number" }, "isSignUpForm": { "type": "boolean" }, "name": { "type": "string" }, "notificationsEnabled": { "type": "boolean" }, "remindees": { "type": "array", "items": { "type": "string" } }, "sendEmailAfterXResponses": { "type": "integer" }, "signUpBlocks": { "type": "array", "items": { "$ref": "#/definitions/models.SignUpBlock" } }, "timeIncrement": { "type": "integer" }, "type": { "$ref": "#/definitions/models.EventType" }, "when2meetHref": { "type": "string" } } } ] } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "eventId": { "type": "string" } } } ] } } } } }, "/events/{eventId}": { "get": { "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Gets an event based on its id", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/models.Event" } } } }, "put": { "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Edits an event based on its id", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "description": "Object containing info about the event to update", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "attendees": { "type": "array", "items": { "type": "string" } }, "blindAvailabilityEnabled": { "type": "boolean" }, "dates": { "type": "array", "items": { "type": "string" } }, "daysOnly": { "type": "boolean" }, "description": { "type": "string" }, "duration": { "type": "number" }, "name": { "type": "string" }, "notificationsEnabled": { "type": "boolean" }, "remindees": { "type": "array", "items": { "type": "string" } }, "sendEmailAfterXResponses": { "type": "integer" }, "signUpBlocks": { "type": "array", "items": { "$ref": "#/definitions/models.SignUpBlock" } }, "type": { "$ref": "#/definitions/models.EventType" } } } ] } } ], "responses": { "200": {} } }, "delete": { "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Deletes an event based on its id", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true } ], "responses": { "200": {} } } }, "/events/{eventId}/calendar-availabilities": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Return a map mapping user id to their calendar events that they have enabled for the given time range", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "type": "string", "description": "Lower bound for event's start time to filter by", "name": "timeMin", "in": "query", "required": true }, { "type": "string", "description": "Upper bound for event's end time to filter by", "name": "timeMax", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/calendar.CalendarEventsWithError" } } } } } } }, "/events/{eventId}/decline": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Decline the current user's invite to the event", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true } ], "responses": { "200": {} } } }, "/events/{eventId}/duplicate": { "post": { "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Duplicate event", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "description": "Object containing options for the duplicated event", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "copyAvailability": { "type": "boolean" }, "eventName": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/events/{eventId}/rename-user": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Rename a guest response", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "description": "Object containing info about the guest response to rename", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "newName": { "type": "string" }, "oldName": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/events/{eventId}/responded": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Mark the user as having responded to this event", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "description": "Object containing the user's email", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "email": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/events/{eventId}/response": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Updates the current user's availability", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "description": "Object containing info about the event response to update", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "availability": { "type": "array", "items": { "type": "string" } }, "calendarOptions": { "$ref": "#/definitions/models.CalendarOptions" }, "enabledCalendars": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "guest": { "type": "boolean" }, "ifNeeded": { "type": "array", "items": { "type": "string" } }, "manualAvailability": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "name": { "type": "string" }, "signUpBlockIds": { "type": "array", "items": { "type": "string" } }, "useCalendarAvailability": { "type": "boolean" } } } ] } } ], "responses": { "200": {} } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Delete the current user's availability", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "description": "Object containing info about the event response to delete", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "guest": { "type": "boolean" }, "name": { "type": "string" }, "userId": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/events/{eventId}/responses": { "get": { "produces": [ "application/json" ], "tags": [ "events" ], "summary": "Gets responses for an event, filtering availability to be within the date ranges", "parameters": [ { "type": "string", "description": "Event ID", "name": "eventId", "in": "path", "required": true }, { "type": "string", "description": "Lower bound for start time to filter availability by", "name": "timeMin", "in": "query", "required": true }, { "type": "string", "description": "Upper bound for end time to filter availability by", "name": "timeMax", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/models.Response" } } } } } }, "/slackbot": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "slackbot" ], "summary": "Gets the number of signed up users", "responses": { "200": { "description": "Text response", "schema": { "$ref": "#/definitions/commands.Response" } } } } }, "/user": { "delete": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Deletes the currently signed in user", "responses": { "200": {} } } }, "/user/add-apple-calendar-account": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Adds an apple calendar account", "parameters": [ { "description": "Object containing the email and app password of the apple account", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/user/add-google-calendar-account": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Adds a new calendar account", "parameters": [ { "description": "Object containing the Google authorization code and scope", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "code": { "type": "string" }, "scope": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/user/add-outlook-calendar-account": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Adds a new outlook calendar account", "parameters": [ { "description": "Object containing the Outlook authorization code and scope", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "code": { "type": "string" }, "scope": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/user/calendar-options": { "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Updates the user's calendar options", "parameters": [ { "description": "Object containing the updated options", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "bufferTime": { "$ref": "#/definitions/models.BufferTimeOptions" }, "workingHours": { "$ref": "#/definitions/models.WorkingHoursOptions" } } } ] } } ], "responses": { "200": {} } } }, "/user/calendars": { "get": { "description": "Gets the user's calendar events between \"timeMin\" and \"timeMax\"", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Gets the user's calendar events", "parameters": [ { "type": "string", "description": "Lower bound for event's start time to filter by", "name": "timeMin", "in": "query", "required": true }, { "type": "string", "description": "Upper bound for event's end time to filter by", "name": "timeMax", "in": "query", "required": true }, { "type": "string", "description": "Comma separated list of accounts to fetch calendar events from", "name": "accounts", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/calendar.CalendarEventsWithError" } } } } } }, "/user/events": { "get": { "description": "Returns an array containing all the user's events", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Gets all the user's events", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Event" } } } } } }, "/user/events/{eventId}/set-folder": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Sets the folder for the specified event", "parameters": [ { "type": "string", "description": "The ID of the event to set the folder for", "name": "eventId", "in": "path", "required": true }, { "description": "The ID of the folder to set the event to", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "folderId": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/user/folders": { "get": { "produces": [ "application/json" ], "tags": [ "folders" ], "summary": "Get all folders", "responses": { "200": { "description": "A list of all folders for the user", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.Folder" } } }, "400": { "description": "Invalid user ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Failed to get folders", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "folders" ], "summary": "Create a new folder", "parameters": [ { "description": "Folder name and optional color", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "color": { "type": "string" }, "name": { "type": "string" } } } ] } } ], "responses": { "201": { "description": "The ID of the created folder", "schema": { "$ref": "#/definitions/routes.CreateFolderResponse" } }, "400": { "description": "Invalid user ID or request body", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Failed to create folder", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/user/folders/{folderId}": { "get": { "produces": [ "application/json" ], "tags": [ "folders" ], "summary": "Get a folder by its ID and its contents", "parameters": [ { "type": "string", "description": "Folder ID", "name": "folderId", "in": "path", "required": true } ], "responses": { "200": { "description": "The folder object with events", "schema": { "$ref": "#/definitions/models.Folder" } }, "400": { "description": "Invalid user ID or folder ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Folder not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Failed to get events in folder", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "folders" ], "summary": "Delete a folder", "parameters": [ { "type": "string", "description": "Folder ID", "name": "folderId", "in": "path", "required": true } ], "responses": { "200": {}, "400": { "description": "Invalid user ID or folder ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Failed to delete folder", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "folders" ], "summary": "Update a folder's name or color", "parameters": [ { "type": "string", "description": "Folder ID", "name": "folderId", "in": "path", "required": true }, { "description": "New folder name and/or color", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "color": { "type": "string" }, "name": { "type": "string" } } } ] } } ], "responses": { "200": {}, "400": { "description": "Invalid user ID or folder ID", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Failed to update folder", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/user/name": { "patch": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Updates the user's name", "parameters": [ { "description": "Object containing the updated name", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "firstName": { "type": "string" }, "lastName": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/user/profile": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Gets the user's profile", "responses": { "200": { "description": "A user profile object", "schema": { "$ref": "#/definitions/models.User" } } } } }, "/user/remove-calendar-account": { "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Removes an existing calendar account", "parameters": [ { "description": "Object containing the email + type of the calendar account to remove", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "calendarType": { "$ref": "#/definitions/models.CalendarType" }, "email": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/user/searchContacts": { "get": { "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Searches the user's contacts based on the given query", "parameters": [ { "type": "string", "description": "Query to search for", "name": "query", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.User" } } } } } }, "/user/toggle-calendar": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Toggles whether the specified calendar is enabled or disabled for the user", "parameters": [ { "description": "Email of calendar account and whether to enable it", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "calendarAccountKey": { "type": "string" }, "enabled": { "type": "boolean" } } } ] } } ], "responses": { "200": {} } } }, "/user/toggle-sub-calendar": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Toggles whether the specified sub-calendar is enabled or disabled for the user", "parameters": [ { "description": "Email of calendar account, the sub calendar id, and whether to enable it", "name": "payload", "in": "body", "required": true, "schema": { "allOf": [ { "type": "object" }, { "type": "object", "properties": { "calendarAccountKey": { "type": "string" }, "enabled": { "type": "boolean" }, "subCalendarId": { "type": "string" } } } ] } } ], "responses": { "200": {} } } }, "/users": { "get": { "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Returns users that match the search query", "parameters": [ { "type": "string", "description": "Search query matching users' names/emails", "name": "query", "in": "query", "required": true } ], "responses": { "200": { "description": "An array of user profile objects", "schema": { "type": "array", "items": { "$ref": "#/definitions/models.User" } } } } } }, "/users/{userId}": { "get": { "produces": [ "application/json" ], "tags": [ "users" ], "summary": "Returns the user by their user id", "parameters": [ { "type": "string", "description": "User ID", "name": "userId", "in": "path", "required": true } ], "responses": { "200": { "description": "A user profile object", "schema": { "$ref": "#/definitions/models.User" } } } } } }, "definitions": { "calendar.CalendarEventsWithError": { "type": "object", "properties": { "calendarEvents": { "type": "array", "items": { "$ref": "#/definitions/models.CalendarEvent" } }, "error": { "type": "error" } } }, "commands.Response": { "type": "object", "properties": { "blocks": { "type": "string" }, "response_type": { "description": "ephemeral or in_channel", "type": "string" }, "text": { "type": "string" } } }, "models.AppleCalendarAuth": { "type": "object" }, "models.Attendee": { "type": "object", "properties": { "_id": { "type": "string" }, "declined": { "type": "boolean" }, "email": { "type": "string" }, "eventId": { "type": "string" } } }, "models.BufferTimeOptions": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "time": { "type": "integer" } } }, "models.CalendarAccount": { "type": "object", "properties": { "appleCalendarAuth": { "type": "object", "$ref": "#/definitions/models.AppleCalendarAuth" }, "calendarType": { "type": "string" }, "email": { "description": "Email is required for all calendar accounts", "type": "string" }, "enabled": { "type": "boolean" }, "oAuth2CalendarAuth": { "type": "object", "$ref": "#/definitions/models.OAuth2CalendarAuth" }, "picture": { "type": "string" }, "subCalendars": { "type": "object", "additionalProperties": { "$ref": "#/definitions/models.SubCalendar" } } } }, "models.CalendarEvent": { "type": "object", "properties": { "allDay": { "description": "Whether the event is an all day event", "type": "boolean" }, "calendarId": { "type": "string" }, "endDate": { "type": "string" }, "free": { "description": "Whether the user is free during this event", "type": "boolean" }, "id": { "type": "string" }, "startDate": { "type": "string" }, "summary": { "type": "string" } } }, "models.CalendarOptions": { "type": "object", "properties": { "bufferTime": { "type": "object", "$ref": "#/definitions/models.BufferTimeOptions" }, "workingHours": { "type": "object", "$ref": "#/definitions/models.WorkingHoursOptions" } } }, "models.CalendarType": { "type": "string" }, "models.Event": { "type": "object", "properties": { "_id": { "type": "string" }, "attendees": { "description": "Attendees for an availability group (fetched from Attendees collection)", "type": "array", "items": { "$ref": "#/definitions/models.Attendee" } }, "blindAvailabilityEnabled": { "description": "Whether to enable blind availability", "type": "boolean" }, "calendarEventId": { "type": "string" }, "collectEmails": { "type": "boolean" }, "creatorPosthogId": { "description": "PostHog ID for the event creator", "type": "string" }, "dates": { "type": "string" }, "daysOnly": { "description": "Whether to only poll for days, not times", "type": "boolean" }, "description": { "type": "string" }, "duration": { "type": "number" }, "hasResponded": { "description": "Whether the user has responded to the availability group (fetched based on whether user is in Attendees)", "type": "boolean" }, "hasSpecificTimes": { "description": "Used for specific times for specific dates feature", "type": "boolean" }, "isDeleted": { "type": "boolean" }, "isSignUpForm": { "description": "Sign up form details", "type": "boolean" }, "name": { "type": "string" }, "notificationsEnabled": { "type": "boolean" }, "numResponses": { "description": "Used to store the number of responses for the event", "type": "integer" }, "ownerId": { "type": "string" }, "remindees": { "description": "Remindees", "type": "array", "items": { "$ref": "#/definitions/models.Remindee" } }, "responses": { "description": "Availability responses - old format for backward compatibility (fetched from eventResponses collection)", "type": "object", "additionalProperties": { "$ref": "#/definitions/models.Response" } }, "scheduledEvent": { "description": "Scheduled event", "type": "object", "$ref": "#/definitions/models.CalendarEvent" }, "sendEmailAfterXResponses": { "type": "integer" }, "shortId": { "type": "string" }, "signUpBlocks": { "type": "array", "items": { "$ref": "#/definitions/models.SignUpBlock" } }, "signUpResponses": { "type": "object", "additionalProperties": { "$ref": "#/definitions/models.SignUpResponse" } }, "startOnMonday": { "description": "Whether to start the event on Monday (as opposed to Sunday, used for DOW events)", "type": "boolean" }, "timeIncrement": { "type": "integer" }, "times": { "type": "string" }, "type": { "type": "string" }, "when2meetHref": { "type": "string" } } }, "models.EventType": { "type": "string" }, "models.Folder": { "type": "object", "properties": { "_id": { "type": "string" }, "color": { "type": "string" }, "eventIds": { "type": "array", "items": { "type": "string" } }, "isDeleted": { "type": "boolean" }, "name": { "type": "string" }, "userId": { "type": "string" } } }, "models.Location": { "type": "object", "properties": { "city": { "type": "string" }, "country_code": { "type": "string" }, "country_name": { "type": "string" }, "latitude": { "type": "number" }, "longitude": { "type": "number" }, "postal": { "type": "string" }, "state": { "type": "string" } } }, "models.OAuth2CalendarAuth": { "type": "object" }, "models.Remindee": { "type": "object", "properties": { "email": { "type": "string" }, "responded": { "type": "boolean" } } }, "models.Response": { "type": "object", "properties": { "availability": { "description": "Availability", "type": "string" }, "calendarOptions": { "type": "object", "$ref": "#/definitions/models.CalendarOptions" }, "email": { "type": "string" }, "enabledCalendars": { "description": "Maps email to an array of sub calendar ids", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "ifNeeded": { "type": "string" }, "manualAvailability": { "description": "Mapping from the start date of a day to the available times for that day", "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/primitive.DateTime" } } }, "name": { "description": "Guest information", "type": "string" }, "useCalendarAvailability": { "description": "Calendar availability variables for Availability Groups feature", "type": "boolean" }, "user": { "type": "object", "$ref": "#/definitions/models.User" }, "userId": { "description": "User information", "type": "string" } } }, "models.SignUpBlock": { "type": "object", "properties": { "_id": { "type": "string" }, "capacity": { "type": "integer" }, "endDate": { "type": "string" }, "name": { "type": "string" }, "startDate": { "type": "string" } } }, "models.SignUpResponse": { "type": "object", "properties": { "email": { "type": "string" }, "name": { "description": "Guest information", "type": "string" }, "signUpBlockIds": { "description": "The IDs of the sign up blocks that the user has signed up for", "type": "array", "items": { "type": "string" } }, "user": { "type": "object", "$ref": "#/definitions/models.User" }, "userId": { "description": "User information", "type": "string" } } }, "models.SubCalendar": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "name": { "type": "string" } } }, "models.User": { "type": "object", "properties": { "_id": { "description": "Profile info", "type": "string" }, "calendarAccounts": { "description": "CalendarAccounts is a mapping from {`email_CALENDARTYPE` =\u003e CalendarAccount} that contains all the\nadditional accounts the user wants to see google calendar events for", "type": "object", "additionalProperties": { "$ref": "#/definitions/models.CalendarAccount" } }, "calendarOptions": { "description": "Calendar options", "type": "object", "$ref": "#/definitions/models.CalendarOptions" }, "email": { "type": "string" }, "firstName": { "type": "string" }, "hasCustomName": { "description": "Whether the user has set a custom name for themselves, i.e. don't change their name when they sign in", "type": "boolean" }, "isPremium": { "type": "boolean" }, "lastName": { "type": "string" }, "numEventsCreated": { "type": "integer" }, "picture": { "type": "string" }, "primaryAccountKey": { "description": "The calendarAccountKey of the account the user first signed in with", "type": "string" }, "stripeCustomerId": { "description": "Stripe customer ID", "type": "string" }, "timezoneOffset": { "type": "integer" } } }, "models.WorkingHoursOptions": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "endTime": { "type": "number" }, "startTime": { "type": "number" } } }, "responses.Error": { "type": "object", "required": [ "error" ], "properties": { "error": { "type": "object" } } }, "routes.CreateFolderResponse": { "type": "object", "properties": { "id": { "type": "string" } } } } }