{"info":{"_postman_id":"80f50740-3916-4133-af23-e8ddceca2256","name":"SchoolConnect API","description":"<html><head></head><body><p>This is a collection featuring all of the API routes of SchoolConnect. These routes are publicly available to allow administrators and developers to build on top of the platform, for example to create an integration with a CMS (Content Management System). All API routes are built on top of tRPC 10, so expect the HTTP request/response specifications to be similar: <a href=\"https://trpc.io/docs/rpc\">https://trpc.io/docs/rpc</a>.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"11867361","collectionId":"80f50740-3916-4133-af23-e8ddceca2256","publishedId":"2s93eVXDeJ","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-05-04T00:13:20.000Z"},"item":[{"name":"User","item":[{"name":"Recieve Information on Self","id":"90016906-ab1a-48ff-86f0-32363a15d27b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.self?batch=1&input={\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\"}}}","description":"<p>This API route takes in the session token of the user and receives the info on the currently signed in user for that session token.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.self"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"},{"description":{"content":"<p>The input for the API, includes the session token.</p>\n","type":"text/plain"},"key":"input","value":"{\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\"}}}"}],"variable":[]}},"response":[],"_postman_id":"90016906-ab1a-48ff-86f0-32363a15d27b"},{"name":"Device Present","id":"857af857-6688-4578-9bdb-263001a22fe9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.devicePresent?batch=1&input={\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\",\"device\":\"The device queried\"}}}","description":"<p>Checks if a device is already registered. Useful for populating data into a form.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.devicePresent"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"},{"description":{"content":"<p>The input for the API, includes the session token and the device.</p>\n","type":"text/plain"},"key":"input","value":"{\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\",\"device\":\"The device queried\"}}}"}],"variable":[]}},"response":[],"_postman_id":"857af857-6688-4578-9bdb-263001a22fe9"},{"name":"Query Linked Accounts of a User","id":"cb93d1b1-1bbc-479b-b437-25f2644fa580","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.linkedAccounts?batch=1&input={\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\"}}}","description":"<p>Query the linked accounts to the user. Takes in only the session token of the user trying to be queried. This will respond with an object in the form:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"github\": boolean,\n    \"facebook\": boolean,\n    \"google\": boolean\n}\n\n</code></pre>\n<p>This specifies a boolean for each of the OAuth providers that are available in the application.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.linkedAccounts"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"},{"description":{"content":"<p>The input for the API, includes the session token.</p>\n","type":"text/plain"},"key":"input","value":"{\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\"}}}"}],"variable":[]}},"response":[],"_postman_id":"cb93d1b1-1bbc-479b-b437-25f2644fa580"},{"name":"Recieve Information on User","id":"72129b86-e7ec-4d1a-a7ca-f1ecffe87d74","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.self?batch=1&input={\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\",\"userId\":\"{{USER_ID}}\"}}}","description":"<p>This is a modification of the <code>user.self</code> request, but instead here, we pass in a <code>userId</code>, to receive information on that user specifically.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.self"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"},{"description":{"content":"<p>The input for the API, includes the session token and user ID.</p>\n","type":"text/plain"},"key":"input","value":"{\"0\":{\"json\":{\"token\":\"{{SESSION_TOKEN}}\",\"userId\":\"{{USER_ID}}\"}}}"}],"variable":[]}},"response":[],"_postman_id":"72129b86-e7ec-4d1a-a7ca-f1ecffe87d74"},{"name":"Set the Name of a user","id":"ff273413-2a33-46b1-9c10-8ddb7b761b1a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"name\": \"New Name\",\r\n            \"userId\": \"The User ID of a user is optional, by default it modifies the logged in user\",\r\n            \"userId\": \"{{USER_ID}}\"\r\n        }\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.setName?batch=1","description":"<p>This mutation sets the name of the provided user. Specifying the <code>userId</code> is optional, and by default it will modify the user that is requesting the route.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.setName"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"ff273413-2a33-46b1-9c10-8ddb7b761b1a"},{"name":"Delete a User","id":"56f0f1b5-7f91-4096-a43c-229def3dfbc1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"userId\": \"The User ID of a user is optional, by default it deletes the logged in user\",\r\n            \"userId\": \"{{USER_ID}}\"\r\n        }\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.delete?batch=1","description":"<p>This mutation deletes a user. Only administrators can delete users of other accounts. Otherwise, simply specify the <code>token</code>. The token is required for all users to ensure that they are properly authenticated to do the task they are attempting.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.delete"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"56f0f1b5-7f91-4096-a43c-229def3dfbc1"},{"name":"Set the Password of a user","id":"72d75f71-f3db-471d-80c1-ffdea926d0c6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"password\": \"New Password\"\r\n        }\r\n    }\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.setPassword?batch=1","description":"<p>To change the password of a user, you must have the session token of that same user. This means that a user can only change their password if they are logged into their account. The password is received and then encrypted using <code>bhash</code> to make sure that even if there is a data leak, the passwords can't be accessed.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.setPassword"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"72d75f71-f3db-471d-80c1-ffdea926d0c6"},{"name":"Update a User","id":"6d7cbd59-c26c-4ab2-8db8-8251bbbc36df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"userId\": \"{{USER_ID}}\",\r\n            \"name\": \"The new name that is going to be assigned to this user (OPTIONAL)\",\r\n            \"email\": \"The new email that is going to be assigned to this user (OPTIONAL), this can only work on pending users\",\r\n            \"role\": \"The new role of the user (OPTIONAL)\"\r\n        }\r\n    }\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.update?batch=1","description":"<p>This mutation updates a user with the given data. This is useful for a form inside a content management system that allows the user to specify the new role, name, email, etc. Several of these fields are optional if you aren't giving the option to modify them.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.update"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"6d7cbd59-c26c-4ab2-8db8-8251bbbc36df"},{"name":"Create Pending User","id":"35bab063-dd48-4187-b5c1-77dc904218d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"name\": \"The new name that is going to be assigned to this user (OPTIONAL)\",\r\n            \"email\": \"The email for the pending user\"\r\n        }\r\n    }\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.createPending?batch=1","description":"<p>This mutation creates a new pending user for the form data that is specified. Pending users are a feature available to administrators that allow them to create a user before the user has even signed up. This allows them to setup several of the settings and features for that specific user beforehand.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.createPending"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"35bab063-dd48-4187-b5c1-77dc904218d6"},{"name":"Register a Device","id":"8e1c11d5-1345-42d8-9ec2-77d8c0040a9c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"device\": \"The Expo push token for the device\"\r\n        }\r\n    }\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.registerDevice?batch=1","description":"<p>Registers a device given a Expo push token. This API route is called whenever a user enabled notifications inside the settings. The Expo push token is reset whenever the user uninstalls the application and reinstalls it. The Expo Push token allows developers to push notifications to this device.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.registerDevice"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"8e1c11d5-1345-42d8-9ec2-77d8c0040a9c"},{"name":"Unregister a Device","id":"7e932a70-ff9a-4cb0-96e6-eae36dc3eefd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"0\": {\r\n        \"json\": {\r\n            \"token\": \"{{SESSION_TOKEN}}\",\r\n            \"device\": \"The Expo push token for the device\"\r\n        }\r\n    }\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://schoolconnect-mu.vercel.app/api/trpc/user.unregisterDevice?batch=1","description":"<p>This API route unregisters the device attached to the given API route. This is useful when logging out, deleting an account, or simply disabling notifications. The <code>device</code> property specifies the Expo push token for which a device has to be removed.</p>\n","urlObject":{"protocol":"https","path":["api","trpc","user.unregisterDevice"],"host":["schoolconnect-mu","vercel","app"],"query":[{"description":{"content":"<p>Internal query parameter for tRPC</p>\n","type":"text/plain"},"key":"batch","value":"1"}],"variable":[]}},"response":[],"_postman_id":"7e932a70-ff9a-4cb0-96e6-eae36dc3eefd"}],"id":"b218d756-3dc1-4964-afdb-40924680fa1e","_postman_id":"b218d756-3dc1-4964-afdb-40924680fa1e","description":""}]}