{ "openapi": "3.0.0", "info": { "title": "Chaos API", "version": "1.0.0" }, "servers": [ { "url": "https://chaos.devsoc.app/api", "description": "Production server" }, { "url": "http://localhost:3000/api", "description": "Local server" } ], "paths": { "/": { "get": { "operationId": "getRoot", "description": "Root of API", "tags": ["Miscellaneous"], "responses": { "200": { "description": "OK", "content": { "text/plain": { "schema": { "type": "string", "example": "Join DevSoc! https://devsoc.app/" } } } } } } }, "/auth/callback/google": { "get": { "operationId": "googleCallback", "description": "Google OAuth callback", "tags": ["Auth"], "parameters": [ { "name": "code", "in": "query", "description": "Google OAuth code", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Ok", "content": null } } } }, "/auth/logout": { "post": { "operationId": "logout", "description": "Invalidates current token", "tags": ["Auth"], "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully logged out" } } } } } }, "401": { "description": "Not logged in", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotLoggedIn" } } } } } } }, "/user": { "get": { "operationId": "getLoggedInUser", "description": "Returns info about currently logged in user", "tags": ["User"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/user/name": { "patch": { "operationId": "updateUserName", "description": "Updates currently logged in user's name", "tags": ["User"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "Clancy Tiger" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated name" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/user/pronouns": { "patch": { "operationId": "updateUserPronouns", "description": "Updates currently logged in user's pronouns", "tags": ["User"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "pronouns": { "type": "string", "example": "They/Them" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated pronouns" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/user/gender": { "patch": { "operationId": "updateUserGender", "description": "Updates currently logged in user's gender", "tags": ["User"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "gender": { "type": "string", "example": "Female" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated gender" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/user/zid": { "patch": { "operationId": "updateUserZid", "description": "Updates currently logged in user's zID", "tags": ["User"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "zid": { "type": "string", "example": "z5123456" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated zID" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/user/degree": { "patch": { "operationId": "updateUserDegree", "description": "Updates currently logged in user's degree", "tags": ["User"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "degree_name": { "type": "string", "example": "Electrical Engineering" }, "degree_starting_year": { "type": "integer", "example": 2024 } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated email" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/user/applications": { "get": { "operationId": "getUserApplications", "description": "Returns info about applications made by currently logged in user", "tags": ["User"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "campaigns": { "type": "array", "items": { "$ref": "#/components/schemas/ApplicationDetails" } } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/organisation": { "post": { "operationId": "createOrganisation", "description": "Create a new organisation", "tags": ["Organisation"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "slug": { "type": "string", "description": "ASCII string for URL like https://chaos.devsoc.app/s/unsw-devsoc", "example": "unsw-devsoc" }, "name": { "type": "string", "example": "UNSW Software Development Society" }, "admin": { "type": "integer", "format": "int64", "example": 1541815603606036500, "description": "User ID of admin" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully created organisation" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "403": { "description": "User is not a SuperUser", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } } } } }, "/organisation/slug_check": { "post": { "operationId": "checkOrganisationSlugAvailability", "description": "Check if slug is available", "tags": ["Organisation"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "slug": { "type": "string", "example": "unsw-devsoc" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Organisation slug is available" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "400": { "description": "Bad request - slug is in use or not ASCII", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BadRequest" } } } } } } }, "/organisation/{id}": { "get": { "operationId": "getOrganisationById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns info about specified organisation", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganisationDetails" } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } }, "delete": { "operationId": "deleteOrganisationById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Deletes specified organisation", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully deleted organisation" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "403": { "description": "User is not a SuperUser", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Unauthorized" } } } } } } }, "/organisation/slug/{slug}": { "get": { "operationId": "getOrganisationBySlug", "parameters": [ { "name": "slug", "in": "path", "description": "Organisation slug", "required": true, "schema": { "type": "string" } } ], "description": "Returns info about specified organisation", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrganisationDetails" } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/organisation/{id}/campaign": { "post": { "operationId": "createCampaign", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Create a new campaign inside specified organisation", "tags": ["Organisation"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewCampaign" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully created campaign" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "401": { "$ref": "#/components/responses/NotOrganisationAdmin" } } } }, "/organisation/{id}/campaign/slug_check": { "post": { "operationId": "checkCampaignSlugAvailability", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Checks availability of campaign slug in specified organisation", "tags": ["Organisation"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "slug": { "type": "string", "example": "2024-subcom-recruitment" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Campaign slug is available" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "401": { "$ref": "#/components/responses/NotOrganisationAdmin" } } } }, "/organisation/{id}/campaigns": { "get": { "operationId": "getAllOrganisationCampaigns", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns all (active & ended) campaigns for specified organisation. However, ended campaigns cannot have new applications", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "campaigns": { "type": "array", "items": { "$ref": "#/components/schemas/OrganisationCampaign" } } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" } } } }, "/organisation/{id}/email_template": { "post": { "operationId": "createEmailTemplate", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Create a new email template within the organisation", "tags": ["Organisation"], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewEmailTemplate" } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully created email template" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "401": { "$ref": "#/components/responses/NotOrganisationAdmin" } } } }, "/organisation/{id}/email_templates": { "get": { "operationId": "getAllOrganisationEmailTemplates", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Get all email templates for specified organisation", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/EmailTemplate" } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "401": { "$ref": "#/components/responses/NotOrganisationAdmin" } } } }, "/organisation/{id}/logo": { "patch": { "operationId": "updateOrganisationLogoById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Update logo for specified organistion. Returns a PUT url to upload new image to", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "upload_url": { "type": "string", "description": "Presigned S3 url to upload file", "example": "https://presignedurldemo.s3.eu-west-2.amazonaws.com/6996987893965262849/2d19617b-46fd-4927-9f53-77d69232ba5d" } } } } } }, "307": { "$ref": "#/components/responses/NotLoggedIn" }, "401": { "$ref": "#/components/responses/NotOrganisationAdmin" } } } }, "/organisation/{id}/member": { "get": { "operationId": "getOrganisationMembersById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns list of members of specified organisation", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "members": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "name": { "type": "string", "example": "Clancy Lion" }, "role": { "type": "string", "example": "Admin" } } } } } } } } }, "403": { "description": "User is not an organisation admin or member.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } }, "put": { "operationId": "updateOrganisationMembersById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "members": { "type": "array", "uniqueItems": true, "items": { "type": "integer", "format": "int64" }, "example": [ 1541815603606036500, 1541815603606036700, 1541815287306036500 ] } } } } } }, "description": "Specifies members for specified organistion.", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated members." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an organisation admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } }, "delete": { "operationId": "deleteOrganisationMemberById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "user_id": { "type": "integer", "format": "int64" } } } } } }, "description": "Specifies member for deletion in organistion.", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated members." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an organisation admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/organisation/{id}/admin": { "get": { "operationId": "getOrganisationAdminsById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns list of admins of specified organisation.", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "members": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "name": { "type": "string", "example": "Clancy Lion" }, "role": { "type": "string", "example": "Admin" } } } } } } } } }, "403": { "description": "User is not a SuperUser.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } }, "put": { "operationId": "updateOrganisationAdminsById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "members": { "type": "array", "uniqueItems": true, "items": { "type": "integer", "format": "int64" }, "example": [ 1541815603606036500, 1541815603606036700, 1541815287306036500 ] } } } } } }, "description": "Specifies Admins for specified organistion.", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated members." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not a SuperUser.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } }, "delete": { "operationId": "deleteOrganisationAdminById", "parameters": [ { "name": "id", "in": "path", "description": "Organisation ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "user_id": { "type": "integer", "format": "int64" } } } } } }, "description": "Specifies Admin for deletion in organistion.", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully deleted Admin." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not a SuperUser.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/campaign": { "get": { "operationId": "getAllCampaigns", "description": "Returns all active campaigns.", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "campaigns": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 6996987893965263000 }, "organisation_id": { "type": "integer", "format": "int64", "example": 1541815603606036700 }, "organisation_name": { "type": "string", "example": "UNSW Software Development Society" }, "name": { "type": "string", "example": "2024 Subcommittee Recruitment" }, "cover_image": { "type": "string", "example": "2d19617b-46fd-4927-9f53-77d69232ba5d" }, "description": { "type": "string", "example": "Are you excited to make a difference?" }, "starts_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "ends_at": { "type": "string", "example": "2024-04-15T18:25:43.511Z" } } } } } } } } } } } }, "/campaign/{id}": { "get": { "operationId": "getCampaignById", "parameters": [ { "name": "id", "in": "path", "description": "Campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns info about specified campaign.", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "id": { "type": "integer", "format": "int64", "example": 6996987893965263000 }, "organisation_id": { "type": "integer", "format": "int64", "example": 1541815603606036700 }, "organisation_name": { "type": "string", "example": "UNSW Software Development Society" }, "name": { "type": "string", "example": "2024 Subcommittee Recruitment" }, "cover_image": { "type": "string", "example": "2d19617b-46fd-4927-9f53-77d69232ba5d" }, "cover_image_url": { "type": "string", "description": "Time-limited presigned URL to download the banner when cover_image is set", "nullable": true }, "description": { "type": "string", "example": "Are you excited to make a difference?" }, "starts_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "ends_at": { "type": "string", "example": "2024-04-15T18:25:43.511Z" } } } } } } } }, "put": { "operationId": "updateCampaignById", "parameters": [ { "name": "id", "in": "path", "description": "Campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "2024 Subcommittee Recruitment" }, "description": { "type": "string", "example": "Are you excited to make a difference?" }, "starts_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "ends_at": { "type": "string", "example": "2024-04-15T18:25:43.511Z" } } } } } }, "description": "Updates details of specified campaign.", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated campaign." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an organisation admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } }, "delete": { "operationId": "deleteCampaignById", "parameters": [ { "name": "id", "in": "path", "description": "Campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Deletes specified campaign.", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully deleted campaign." } } } } } }, "403": { "description": "User is not an admin of campaign's organisation.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/campaign/{id}/banner": { "patch": { "operationId": "updateCampaignBannerById", "parameters": [ { "name": "id", "in": "path", "description": "Campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Updates banner image for specified campaign.", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "upload_url": { "type": "string", "description": "Presigned S3 url to upload file.", "example": "https://presignedurldemo.s3.eu-west-2.amazonaws.com/6996987893965262849/2d19617b-46fd-4927-9f53-77d69232ba5d" } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an organisation admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/campaign/{id}/role": { "post": { "operationId": "createRole", "parameters": [ { "name": "id", "in": "path", "description": "Campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Creates a new role in a campaign.", "tags": ["Campaign"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "Chief Mouser" }, "description": { "type": "string", "required": false, "example": "Larry the cat is dead, now we need someone else to handle the rat issues at 10th Downing st." }, "min_available": { "type": "int32", "example": 1 }, "max_available": { "type": "int32", "example": 3 }, "finalised": { "type": "boolean", "description": "Whether this role has been finalised (e.g. max available number)", "example": false } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully created organisation." } } } } } }, "403": { "description": "User is not a Campaign Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/campaign/{id}/roles": { "get": { "operationId": "getRolesByCampaignId", "parameters": [ { "name": "id", "in": "path", "description": "Campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns info about all roles in a campaign", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "campaigns": { "type": "array", "items": { "$ref": "#components/schemas/RoleDetails" } } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not a Campaign Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/campaign/{id}/applications": { "get": { "operationId": "getApplicationsById", "parameters": [ { "name": "id", "in": "path", "description": "campaign ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns info about all Applications in given Campaign.", "tags": ["Campaign"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "applications": { "type": "array", "items": { "$ref": "#components/schemas/ApplicationDetails" } } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not a Campaign Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/role/{id}": { "get": { "operationId": "getRoleById", "parameters": [ { "name": "id", "in": "path", "description": "Role ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns info about specified role.", "tags": ["Role"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "Chief Mouser" }, "description": { "type": "string", "example": "Larry the cat gone missing! now we need someone else to handle the rat issues at 10th Downing st." }, "min_available": { "type": "int32", "example": 1 }, "max_available": { "type": "int32", "example": 3 }, "finalised": { "type": "boolean", "description": "Whether this role has been finalised (e.g. max available number)", "example": false } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } } } }, "put": { "operationId": "updateRoleById", "parameters": [ { "name": "id", "in": "path", "description": "Role ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Update a role given the role id.", "tags": ["Role"], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "name": { "type": "string", "example": "Chief Whip" }, "description": { "type": "string", "required": false, "example": "Put a bit of stick about!" }, "min_available": { "type": "int32", "example": 1 }, "max_available": { "type": "int32", "example": 3 }, "finalised": { "type": "boolean", "description": "Whether this role has been finalised (e.g. max available number)", "example": true } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully update organisation." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not a Campaign Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } }, "delete": { "operationId": "deleteRoleById", "parameters": [ { "name": "id", "in": "path", "description": "Role ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Deletes specified role.", "tags": ["Role"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully deleted role." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an admin of role's Campaign.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/role/{id}/applications": { "get": { "operationId": "getApplicationsByRoleID", "parameters": [ { "name": "id", "in": "path", "description": "Role ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns all applications to a specific role", "tags": ["Role"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "applications": { "type": "array", "items": { "$ref": "#components/schemas/ApplicationDetails" } } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an Application Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/application/{id}": { "get": { "operationId": "getApplicationByID", "parameters": [ { "name": "id", "in": "path", "description": "Application ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "description": "Returns an applications given its ID", "tags": ["Application"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "application": { "type": { "$ref": "#components/schemas/ApplicationDetails" } } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an Application Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/application/{id}/private": { "put": { "operationId": "updateApplicationPrivateStatus", "parameters": [ { "name": "id", "in": "path", "description": "Application ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "data": { "type": { "$ref": "#components/schemas/ApplicationStatus" } } } } } } }, "description": "Change Private Status of a specific Application", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated Application Private Status." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an Application Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }, "/application/{id}/status": { "put": { "operationId": "updateApplicationStatus", "parameters": [ { "name": "id", "in": "path", "description": "Application ID", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { "data": { "type": { "$ref": "#components/schemas/ApplicationStatus" } } } } } } }, "description": "Change Status of a specific Application", "tags": ["Organisation"], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "message": { "type": "string", "example": "Successfully updated Application Status." } } } } } }, "401": { "description": "Not logged in.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Not logged in." } } } } } }, "403": { "description": "User is not an Application Admin.", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } } }, "components": { "schemas": { "NotLoggedIn": { "type": "object", "properties": { "message": { "type": "string", "example": "Not logged in" } } }, "Unauthorized": { "type": "object", "properties": { "message": { "type": "string", "example": "Unauthorized" } } }, "BadRequest": { "type": "object", "properties": { "message": { "type": "string", "example": "Bad request" } } }, "Answer": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 6996987893965227000 }, "question_id": { "type": "integer", "format": "int64", "example": 6996987893965227000 }, "answer_type": { "type": "string", "enum": [ "ShortAnswer", "MultiChoice", "MultiSelect", "DropDown", "Ranking" ] }, "data": { "oneOf": [ { "type": "string", "example": "I am passionate about events" }, { "type": "integer", "example": 6996987893965227000 }, { "type": "array", "format": "int64", "example": [ 6996987893965227000, 69969829832652230000, 6996987893965228000 ] } ] }, "created_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "updated_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" } } }, "NewAnswer": { "type": "object", "properties": { "question_id": { "type": "integer", "format": "int64", "example": 6996987893965263000 }, "answer_type": { "type": "string", "enum": [ "ShortAnswer", "MultiChoice", "MultiSelect", "DropDown", "Ranking" ] }, "data": { "oneOf": [ { "type": "string", "example": "I am passionate about events" }, { "type": "integer", "example": 6996987893965227000 }, { "type": "array", "format": "int64", "example": [ 6996987893965227000, 69969829832652230000, 6996987893965228000 ] } ] } } }, "ApplicationStatus": { "type": "string", "enum": ["Pending", "Rejected", "Successful"] }, "OrganisationDetails": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 6996987893965263000 }, "slug": { "type": "string", "example": "devsoc-unsw" }, "name": { "type": "string", "example": "UNSW Software Development Society" }, "logo": { "type": "string", "example": "76718252-2a13-4de2-bc07-f977c75dc52b" }, "created_at": { "type": "string", "example": "2024-02-10T18:25:43.511Z" } } }, "OrganisationCampaign": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 6996987893965263000 }, "slug": { "type": "string", "example": "2024-subcom-recruitment" }, "name": { "type": "string", "example": "2024 Subcommittee Recruitment" }, "cover_image": { "type": "string", "example": "2d19617b-46fd-4927-9f53-77d69232ba5d" }, "description": { "type": "string", "example": "Are you excited to make a difference?" }, "starts_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "ends_at": { "type": "string", "example": "2024-04-15T18:25:43.511Z" } } }, "RoleDetails": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 7036987893965263000 }, "campaign_id": { "type": "integer", "format": "int64", "example": 1116987453965262800 }, "name": { "type": "string", "example": "Chief Mouser" }, "description": { "type": "string", "example": "Larry the cat gone missing! now we need someone else to handle the rat issues at 10th Downing st." }, "min_available": { "type": "int32", "example": 1 }, "max_available": { "type": "int32", "example": 3 }, "finalised": { "type": "boolean", "description": "Whether this role has been finalised (e.g. max available number)", "example": false } } }, "User": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "email": { "type": "string", "example": "me@example.com" }, "zid": { "type": "string", "example": "z5555555", "nullable": true }, "name": { "type": "string", "example": "Clancy Lion" }, "pronouns": { "type": "string", "example": "He/Him" }, "gender": { "type": "string", "example": "Male" }, "degree_name": { "type": "string", "example": "Computer Science", "nullable": true }, "degree_starting_year": { "type": "integer", "example": 2024, "nullable": true }, "role": { "type": "string", "enum": ["User", "SuperUser"] } } }, "UserDetails": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "email": { "type": "string", "example": "me@example.com" }, "zid": { "type": "string", "example": "z5555555" }, "name": { "type": "string", "example": "Clancy Lion" }, "pronouns": { "type": "string", "example": "They/Them" }, "gender": { "type": "string", "example": "Male" }, "degree_name": { "type": "string", "example": "Computer Science" }, "degree_starting_year": { "type": "integer", "example": 2024 } } }, "ApplicationDetails": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "campaign_id": { "type": "integer", "format": "int64", "example": 5141815603606036000 }, "user": { "$ref": "#/components/schemas/UserDetails" }, "status": { "$ref": "#/components/schemas/ApplicationStatus" }, "private_status": { "$ref": "#/components/schemas/ApplicationStatus" }, "applied_roles": { "type": "array", "items": { "$ref": "#/components/schemas/ApplicationAppliedRoleDetails" } } } }, "ApplicationAppliedRoleDetails": { "type": "object", "properties": { "campaign_role_id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "role_name": { "type": "String", "example": "Sponsorships" }, "preference_percentage": { "type": "integer", "format": "int32", "example": 50 } } }, "NewCampaign": { "type": "object", "properties": { "name": { "type": "string", "example": "2024 Subcommittee Recruitment" }, "slug": { "type": "string", "example": "2024-subcom-recruitment" }, "description": { "type": "string", "example": "Are you excited to make a difference?" }, "starts_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "ends_at": { "type": "string", "example": "2024-04-15T18:25:43.511Z" } } }, "Campaign": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "slug": { "type": "string", "example": "2024-subcom-recruitment" }, "name": { "type": "string", "example": "2024 Subcommittee Recruitment" }, "organisation_id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "organisation_name": { "type": "string", "example": "UNSW Software Development Society" }, "cover_image": { "type": "string", "format": "uuid", "example": "05ebad1e-8be4-40c3-9d36-140cac9a0075", "nullable": true }, "description": { "type": "string", "example": "Are you excited to make a difference?", "nullable": true }, "starts_at": { "type": "string", "example": "2024-03-15T18:25:43.511Z" }, "ends_at": { "type": "string", "example": "2024-04-15T18:25:43.511Z" }, "created_at": { "type": "string", "example": "2024-02-15T18:25:43.511Z" }, "updated_at": { "type": "string", "example": "2024-02-15T18:25:43.511Z" } } }, "EmailTemplate": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "organisation_id": { "type": "integer", "format": "int64", "example": 1541815603606036500 }, "name": { "type": "string", "example": "Success Email" }, "template_subject": { "type": "string", "example": "[OUTCOME] {{campaign_name}} - {{role_name}}" }, "template_body": { "type": "string", "example": "Hi {{name}}, you have been successful in your application for {{organisation_name}} {{role_name}}. Regards {{organisation_name}} Exec" } } }, "NewEmailTemplate": { "type": "object", "properties": { "name": { "type": "string", "example": "Success Email" }, "template_subject": { "type": "string", "example": "[OUTCOME] {{campaign_name}} - {{role_name}}" }, "template_body": { "type": "string", "example": "Hi {{name}}, you have been successful in your application for {{organisation_name}} {{role_name}}. Regards {{organisation_name}} Exec" } } } }, "responses": { "NotLoggedIn": { "description": "Redirect to login", "headers": { "Location": { "description": "Login url", "schema": { "type": "string", "format": "uri" } } } }, "NotOrganisationAdmin": { "description": "User is not an organisation admin", "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } } } } }