Documentation was generated on 2026-08-21T14:24:35.726Z
Deletes a user. Response has status code 200 if successful. pub.user-service.user-deleted is published after deletion
Gets users. Response has status code 200 if successful. Note that any query params will be used as a mongo query.
Gets user by id. Response has status code 200 if successful.
Creates a fruster user. Must include a few base fields but can contain any number of custom fields. Response has status code 201 if successful. Automatically splits data between user and profile if configured to.
Updates a user. Can contain any number of custom fields. Response has status code 200 if successful.
Gets audit logs for a specific user. The result is sorted on timestamp. Supports pagination.
Will return a Set-Cookie to instruct browser to expire any existing cookie and delete the session of the token (from cookie or Authorization Bearer-header) from the database. Should be used by both Token and Cookie.
Note: When using the query param logoutId the id is obtained from GET to /auth/active-sessions which can only be done by the logged in user.
Gets all active sesssions for the logged in user, typically to be used to list sessions similar to something like google or facebook with the ability to logout any session:

Will return all values as null (expect for id) if user hasn't been active since the session details functionality was implemented (sometime around 2020-06-11).
Disables Two Factor Authentication via SMS for the user. Will remove the sms from the user's two factor authentication methods.
Enables Two Factor Authentication via SMS for the user. Will send a SMS to the provided phone number with a code that the user needs to input to enable TFA. The code is valid for 10 minutes.
Gets a fresh access token by providing a refresh token.
Login for non web devices such as native mobile apps. Returns an access token to be used as bearer authentication. Response body also contains profile which has the same data as user-service.get-users-by-query with expand: "profile" but for the logged in user.
Verifies the Two Factor Authentication code sent to the user via SMS. Will return a Set-Cookie with the new session token if the code is correct. The code is valid for 10 minutes.
Collects status and returns qr code. Returns status 202 while order is pending, and status 200 when complete, along with completionData
Initiates a BankID login. Will return details so client can either autostart bankid application or render a qr code which will be scanned from other device running BankID application.
Initiates a BankID sign order. Will return details so client can either autostart bankid application or render a qr code which will be scanned from other device running BankID application.
Deletes a booking if it hasn't been confirmed, cancels it if it has been. Returns empty object if deleted, otherwise the booking with the new status of CANCELLED.
Gets bookings for an organisation or an order. user has to be part of either the organisation of the bookings (query organisationId) or the organisation of the order (query orderId)
Gets a booking by its id. Logged in user can be part of the organisation that created the order or the organisation that created the booking.
For getting confirmed bookings for current school year as a manager for decision making
Declines a booking. User has to have correct permission and be part of the organisation of the orders of the booking of the inputted id
Confirms one or more bookings. User has to have correct permission and be part of the organisation of the orders of the bookings of the inputted ids
Updates a booking. Allows adding and removing students from booking. Must follow the same rules as when booking order.
Get organisations for given organisations, will return organisations only have booking for current school year and if bookings are confirmed/non studyguidance and distance learning
Check whether a contract exist between buying and selling organisers for current school year
Receive contract status updates from one flow webhook
Get decisions for given school year grouped by organiser
To be polled by frontend after initializing signing. Returns qr-code and status 202 while signing is not complete, status 200 when complete
Creates a decision for current confirmed bookings with learning type distance learning, not study guidance. All bookings for current school year have to be included or not included (a decision has to be made), it is not permitted to omit confirmed bookings. The creation of a descicion triggers a bankId signing. Only if signed can the decision be accessed/downloaded.
Lists all organisers (huvudmän) with their pub-contract template/signing status. Admin only.
Returns the pub-contract templates (with signing status) for a single organiser. Admin only.
Deletes an invoice batch. This can have serious implications!!
Get receipt for a booking/invoice row
Exports invoice batch. Currently supports jeeves. Returns file as ZIP.
Submits and saves an invoice batch. Makes it readonly after that
In progress. Generates a new batch of invoices, everything that has happened up until to is included
Marks one or more notifications as read for the logged in user.
Deletes an order if it has no bookings, cancels it if it has bookings. Returns empty object if deleted, otherwise the order with the new status of CANCELLED.
Gets orders. To get orders for a specific organisation the user must be logged in and have the correct permissions (order.get and order.get.teacher to get orders for a teacher). Note: Getting orders for teachers' pagination isn't working 100% at the moment (and is not currently used anyway)
Gets order by id. Published orders are possible to get as logged out, for any other status the user has to be logged in, have the correct permissions (order.get) and be part of the organisation of the order. Response is either OrderViewModel which is the same response as POST to /order or DraftOrderViewModel which is the same response as POST to /order/draft
Returns the students eligible to appear in a report for the given order at the given moment at. A booking contributes students only if it is currently CONFIRMED and its statusUpdates contain a Confirmed entry at or before at. Per booking, the students returned are those whose studentMemberships window was open at at (half-open semantics). Caller must have the order's organisation as their currently selected organisation AND either be the order's current TEACHER, a TEACHER who was teaching the order at at (per teacherMemberships), a HEADMASTER, or a SCHOOL_ADMIN. Internal admins must impersonate one of those roles to access this endpoint.
Returns the students eligible to appear in an attendance report for the given lecture. A booking contributes students only if it is currently CONFIRMED and its statusUpdates contain a Confirmed entry at or before the lecture start time. For each eligible booking, the returned students are those whose studentMemberships window was open at the lecture start time (half-open semantics). For study-guidance orders, the booking must also have the lecture's id in its bookedDates, otherwise no students are contributed.
Gets order by a booking id (key "id", not "bookingId". The user must be part of the organisation of the order. Booking is included in response. Response is either OrderViewModel which is the same response as POST to /order or DraftOrderViewModel which is the same response as POST to /order/draft, however, it only includes data relevant to the booking (e.g. dates that are booked by that booking)
Gets the total number of orders and bookings that has first lecture between two dates
Gets a lecture by id. Logged in user has to be in the same organisation as the order of the lecture (or admin).
Gets lectures for a teacher within a certain time frame. Requires permissions order.get.teacher if used with teacherId query
Creates a new order. If a draft is published, the data of that order has to be sent to this endpoint, including its id
Books the order of the inputted order id.
You cannot book an order you have created (the organisation)
You cannot book an you have already booked (the organisation)
Order has to have status PUBLISHED
All participants have to be in the organisation
All participants grade must match the grade of the order
The order has to have available slots
The booking must not have more participants than available slots
The booking must not have more participants than the order's maxParticipants participants
If order type is study guidance, the booking must not have less particpants than the order's minParticipants
If order type is study guidance, the booking must not include dates booked other organisations
Creates a new order as draft. Upserts order so it can be used with the id of a previous draft to update it. This means the whole order has to be in the request body when updating.
Allows a user to user to request competence from linguista, sends an email with the inputted data.
Updates an order. Requires additional permission order.update.all to update everything, or order.update.lectureSpecifics to be able to update lectureSpecifics
Gets organisations with active orders
Get a signed pub-contract pdf for the user's current organisation. Pass contractId to download a specific addendum; otherwise the root contract is returned. If manager/admin, organisationId should be supplied
Set no estimated planning request needs for an organisation
Toggles book order functionality for an organisation
Toggles create order functionality for an organisation
Toggles written reports (skriftliga omdömen) opt-out for an organisation. When opting out, all existing written reports for the organisation are deleted.
Get organisations grouped by organiser for loggedin manager
Get organiser details for given organisation number
Delete a planning request as headmaster/Admin.
Create a planning request as headmaster that manager can later approve.
Create a new publish entry for organiser's organisations
Update a planning request as headmaster. If status is INITIAL or NOAPPROVALNEEDED, only the previouslyPerformedBy field will be updated
Moves a planning request to current school year. Will also reset status to INITIAL or NOAPPROVALNEEDED
Update request statuses - used by manager to save a "draft" status before publishing
Initiates signing of a pub-contract (root or addendum) from a template, creating and sending it to Oneflow
Removes a pub-contract template. Only allowed while signing has not been initiated.
Returns the config default values used by the 'Fyll i standardvärden' button and as fallback for root templates
Creates and publishes a pub-contract template (root or addendum) for an organiser
Get a list of receipts for specified booking
Generates an attendance report for all students within timeframe. Rows are driven by booking studentMemberships (a student appears once they have ever been assigned to a confirmed booking on the order). Lectures with no eligible student are dropped from the date columns. Cells outside a student's membership window render as 'Elev ej tilldelad detta datum'; reported dates render their attendance value; un-reported in-window dates render 'Inväntar Rapportering'.
Generates an booking cancellation report for the selling headmaster for a given time period
Generates an booking cancellation report for the admin for a given time period
Generates report of combined students
Generates an invoice report for the bookings of orders for the logged in user's (current) organisation for a specified timeframe
Generates a grade report for all students within timeframe. Rows are driven by booking studentMemberships (a student appears once they have ever been assigned to a confirmed booking on the order). Date axis comes from the order's configured reports.grade dates intersected with the timeframe (legacy boolean true falls back to order lecture dates; false/missing skips the order). One row per (eligible student × date). 'Ej rapporterad' is rendered when the student is in their membership window but no grade has been reported yet.
Generates a grade report for all students within timeframe
Generates an invoice report for the bookings of orders for the logged in user's (current) organisation for a specified timeframe
Generates a knowledge follow-up report for all students within timeframe. Rows are driven by booking studentMemberships (a student appears once they have ever been assigned to a confirmed booking on the order). Date columns come from the order's configured reports.knowledgeFollowUp dates intersected with the timeframe. Study-guidance orders are excluded — knowledge follow-up is not applicable for them. Cells outside a student's membership window render as 'Ej tilldelad'; reported dates render the knowledge-follow-up value; in-window unreported dates render 'Inväntar Rapportering'.
Generates report containing information about booking in given organisation.
Generates an order report for admin for all organisations for a given timeframe
Generates an planning report as headmaster or manager
Generates a planning report as an admin
Generates report containing information about orders in given organisation.
Generates a report of the number of remote learning hours that are performed within the schools of an organiser (huvudman), per buying organiser
Generates a user report for all users within timeframe
Generates an Excel report of written-report status for the selling organisation (headmaster / school-admin). One row per student, written-report date and order, for the current school year up to today + WRITTENREPORTDAYS_VISIBLE days.
Deletes a pre registered absence for a student for a lecture
Gets completed reports for a teacher. Is only possible to get the reports created by the logged in user atm.
Gets a report by id. Only current teacher on order that report is for can get it
Gets a teacher's completed reports grouped by order. Includes completed attendance, knowledge follow-up, grade reports, and written report dates where the teacher has completed all entries. Groups are sorted by most recently completed date.
Gets pre-registered absence for a lecture
Gets the status of the inputted pending signing. As long as signing (auth) is not completed, qrImage is returned in response. To be polled by the client for grade report w/ status COMPLETED, so that it knows when to do the create/update step. Returns status 200 if user has authenticated using bankid, 202 if user has not. Returns 404 BANKID_ERROR if something goes wrong during bankid authentication, pending signing is then deleted.
Gets a teacher's reports to do (new reports to do based off current date vs reports' dates in order & incomplete reports). Item in response will include id, reportDetails etc. if it's an incomplete report
Gets a teacher's reports to do grouped by order. Each group contains all pending reports for that order (attendance, knowledge follow-up, grade, and written reports), sorted by date ascending. Groups are sorted by oldest pending report date.
Generates a report with students in the danger zone. This is based on reports done by teachers of orders the students are part of. Students only appear on this list if they have been absent from a lecture or knowledge follow up F or NO_GRADE.
If a student has been absent from three lectures in a row it will be tagged with a flag indicating this.
Sorts result by weighing the differnet fields returned in the data such as the tendency, absence, knowledge follow up and missed lectures warning.
Creates a report with one or more types. Grade reports cannot be created along side other reports. The other types can be combined, e.g. ATTENDANCE and KNOWLEDGEFOLLOWUP.
Adds pre registered absence for a students for a lecture
Adds pre registered absence for a student for a lecture
Starts signing by starting bankid login for provided personal number. Saves a pending signing in the database, returns that signing. This is needed to be able to finish the grade report creation w/ status COMPLETED. Pending signing has to be finished within 120s
Either sets handlingStarted, or removes it. Only users in organisation that set handlingStarted can remove it. If handlingStarted is set, it cannot be changed without being removed first
Deletes all orders and bookings in a school year
Updates several students at once. Calling user must be member of all the students organisation The students returned will be in same order as those sent in
Gets the logged in user with its currently selected organisation as user.currentOrganisation
Gets list of headmasters as edshare admin. Sorted by headmasters' name
Gets the stauts of the current pending registration. To be polled by the client so that it knows when to do the finish step. Returns status 200 if user has authenticated using bankid, 202 if user has not. Returns 404 BANKID_ERROR if something goes wrong during bankid authentication, pending registration is then deleted.
Gets list of managers as edshare admin. Sorted by managers' name
Logs in as inputted teacher user, in the current organisation
Finishes a headmaster account. Must have been started by the http.post.user.start endpoint and authenticated by the user via bankid before it can be called. Requires the request body to include the details from the pending registration initiated by that endpoint. Returns a Set-Cookie header for the new account.
Finishes a manager account. Must have been started by the http.post.user.start endpoint and authenticated by the user via bankid before it can be called. Requires the request body to include the details from the pending registration initiated by that endpoint. Returns a Set-Cookie header for the new account.
Generates a new email verification token and resends email w/ token to the provided user. Response has status code 200 if successful.
Creates a staff member (teacher/school admin). Sets status to INVITED. Sends invitation mail to the added member.
Imports a list of staff members as teachers. Sets status to INVITED. Sends invitation mail to the added member.
Activate a teacher. Logged in user can only active itself
Starts registration by starting bankid login for provided personal number. Saves a pending registration in the database, returns that registration. This is needed to be able to finish the account creation. Pending registration has to be finished within 120s
Verifies a user's email address by providing a token sent to the user by email. Response has status code 200 if successful.
Updates the logged in user. The output is the the updated user, it may vary depending on its role
Updates the user's current organisation value
Used to add or remove existing organisations to an existing headmaster or manager.
Updates password of auth user's account. Requires to validation of old password before new can be set. Response has status code 202 if successful.
Check if the given organisation is already has a account in edshare
Gets written report dates with summary counts for the logged-in user
Gets written reports for a specific date and order, merged with all students from confirmed bookings
Generates a PDF of PUBLISHED written reports for the current school year. For buying headmasters/admins this is every report addressed to the requesting organisation (with intro page). For teachers it is the reports on their own orders in the currently selected selling organisation (no intro page, student's organisation shown). Returns the PDF binary; the gateway streams it to the browser as application/pdf.
Creates or updates a written report draft for a student on a specific date
Reviews a written report (publish, ignore, send back to draft, or un-ignore)
Sends a written report draft for review by the principal
Sends a message to a client (user) via websocket, if such connection exists. The message is sent to a userId with a label (in place of the >). If sent to ws.out.e3bcf884-8b49-46ae-8546-8dcc65b56932.new-notification (The label being new-notification) the user will receive the message in the handler registered to new-notification. Can be used to send a global message to all connected users by providing a * as userId. To specify a list of users to send to * is used as userId and req.to is set to an array of userIds.
Sends a message to all connected users. Public and non public connections. The > is the label for the message being sent. E.g. ws.out.public.psa (Where the label is psa). This endpoint will make it possible for the public clients to subscribe to the endpoint without knowing their assigned uuid.
Deletes audit logs by query. Used for GDPR cleanup and user data removal. Supports dryRun mode to preview deletions.
Gets audit logs by query. The result is sorted on timestamp. Supports pagination.
Generates a web JWT token for a user matching the inputted Mongo query. Used for external logins.
Gets session details for a user. Will return all values as null if user hasn't been active since the session details functionality was implemented (sometime around 2020-06-11).
Logs out a list of users. Does not matter if user is logged in via cookie or token.
Gets a fresh access token by providing a refresh token.
Internal service endpoint used to initiate a BankID login. Note that since 1st May 2024 BankID requires autostart token or qr instead of personal number.
Collects status and returns qr code. Returns status 202 while order is pending, and status 200 when complete, along with completionData
Internal service endpoint used to initiate a BankID login. Note that since 1st May 2024 BankID requires autostart token or qr instead of personal number.
Request to (forcefully) unregister (a) websocket client. Can be done by either providing the jwt-token to unregister one connection or the id of the user to unregister all connections for user.
Sends a mail to one or more mails (emails) addresses
Generates a pdf receipt for booking, and saves it in database
Renders the supplied HTML to a PDF (A4) and returns it as a base64-encoded string.
Removes participants by id from all bookings. Is primarily used when cleaning up after deletion of deactivated students.
Creates a notification for either order, booking or request
Deletes notifications by query. E.g. to be used when removing orders, bookings and requests (where unread notifications can still be fetched)
Removes participants by id from all bookings. Is primarily used when cleaning up after deletion of deactivated students.
Generate receipts for all bookings
Gets bookings query. Supports standard query params in request body.
Gets orders by query
Removes a participant from all bookings and adds them to removedParticipants
Can be used to revert a gallring, in case issues occur
Creates a contract between two organisers and sends it to oneflow for signing.
Creates an organisation
Send contract status between buying and selling organisers for current school year
Gets organisation by id.
Gets organisations by query
Gets a list of organisations within the same organiser. Either by providing an organiser or an organisation id
Gets planning requests by query
Delete reports for an order.
Service-to-service: permanently deletes all written reports for a buying organisation (all statuses, all school years). Used when an organisation opts out of written reports.
Service-to-service: deletes all written reports whose report date falls within the given school year. Used by the ox-order-service gallring (school year cleanup). If dryRun is true, only counts matching written reports without deleting (used for the preview).
Service-to-service: permanently deletes all written reports for the given students. Used by the ox-student-service cleanup when deactivated students are hard-deleted.
Gets pre registered absence for a student within a provided time frame
Gets completed reports by query
Gets report types for a specific lecture. Returns report id if report already exists for that lecture. Returns ATTENDANCE and KNOWLEDGEFOLLOWUP reports.
Service-to-service: gets written report entries by query. Used by ox-report-service to build the written-report status export for the selling organisation.
Checks if any current request matches the inputted order details, and if so it sends an email about it to the headmasters of the organisations of the requests. Primarily to be used by order service when a new order is published.
Scheduled job that sends email to headmaster when a request has been deleted (stops showing up). This happens one month after the request was created.
Legal guardians to students that turn 18 to be deleted from database
Used to delete deactivated students
Gets the logged in user by jwt token with its currently selected organisation as user.currentOrganisation (prepared to use profile.currentOrganisationId as id to get but falls back on first organisation id in profile.organisations)
Used to add existing organisations to an existing headmaster.
Handling bankid order status for when headmasters registers an account
A service that accepts JSON (in) and outputs reports in different formats.
Creates or updates (upserts) a new job that runs on a given interval or time. Read more about fruster-schedule-service.
Adds inputted roles to specified user. Can only add roles existing in configuration. Response has status code 202 if successful.
Creates a fruster user. Must include a few base fields but can contain any number of custom fields. Response has status code 201 if successful. Automatically splits data between user and profile if configured to.
Deletes a user. Response has status code 200 if successful. pub.user-service.user-deleted is published after deletion
Deletes users by a query. Response has status code 200 if successful. pub.user-service.user-deleted is published after deletion. Request body is the query to delete with. Cannot use empty query.
Gets user records by aggregate without process aggregate result
Gets profiles by query. Note: Return data may vary depending on the configuration. Configured profile fields: ALL (Everything except the fields configured for user)
Gets all scopes for specified roles in a flat array. E.g. input ['admin', 'user', 'super-admin'] would return ['', 'admin.', 'profile.get']. Response has status code 200 if successful.
Gets users by query. Response has status code 200 if successful.
Gets users by aggregate. The result process with view model
Gets users by query. Note: Return data may vary depending on the configuration. Configured user fields: personalNumber,firstName,lastName,name,deactivated,active,metadata.activated,metadata.deactivated,deleted (Will always return id,email,password,roles,scopes)
Can be expanded to return both user and profile data using expand: "profile" if configured to split the data. If expand is used; the query can be used to query profile fields as well: { "profile.firstName": "Bob" }. With expand; the data is returned {...userData, profile: {...profileData}}. Can fetch only user count without users, using count: true. if count is used returns totalCount with empty users array
Removes inputted roles from specified user. Cannot remove the last role. Response has status code 202 if successful.
Generates a new email verification token and resends email w/ token to the provided user. Response has status code 200 if successful.
Sets password of a user. Used by password reset service. Note: Updating a user's password should be done w/ the update-password endpoint. Response has status code 202 if successful.
Updates password of an account. Requires to validation of old password before new can be set. Response has status code 202 if successful.
Updates a user. Can contain any number of custom fields. Response has status code 200 if successful.
Updates a user. Can contain any number of custom fields. Response has status code 200 if successful.
Validates that inputted password becomes the same hash as for an account. Typically used by auth service for login. Response has status code 200 if successful. Validation can be done on email
Verifies a user's email address by providing a token sent to the user by email. Response has status code 200 if successful.
comment-bank
DELETE to /comment-bank/:id
from ox-reporting-service.938e5e6aHard-deletes a comment bank entry.
GET to /comment-bank
from ox-reporting-service.938e5e6aLists comment bank entries; supports optional filtering used by the admin overview.
GET to /comment-bank/for-order/:orderId
from ox-reporting-service.938e5e6aReturns all comment bank entries compatible with the given order, each annotated with a match score. Sorted by score desc, then updatedAt desc.
POST to /comment-bank
from ox-reporting-service.938e5e6aCreates a new comment bank entry. Internal admin only.
PUT to /comment-bank/:id
from ox-reporting-service.938e5e6aUpdates the comment text of an existing entry. Selectors cannot be modified.