Authorization and error handling by endpoint
Use one decision order for every signed-in endpoint. Confirm the college workspace, check the role for the step, and return 401, 403, or 404 by the rules below. This page reconciles only rules already stated in this pack. It changes no sign-in, session, role, tenancy, or security code or setting.
Decision order for every request
Run each step in order and stop at the first failure. The server checks again on every request, even when a screen hides a button. A changed role takes effect on the next request and a result from before the change is not opened again from a saved link, as stated in Search scope.
```mermaid
flowchart TD
A[Request arrives] --> B{Signed in session present}
B -- No --> C[401 Sign in required or public widget path only]
B -- Yes --> D{Record in this workspace}
D -- No or other college --> E[404 Not found in this workspace]
D -- Yes --> F{Role covers step or detail permission present}
F -- No --> G[403 Names the role that can do the step]
F -- Yes --> H[200 With workspace assistant channel and date scope stated]
```One college at a time. Confirm the college name at the top of the app before ranking or opening any record. System view shows counts grouped by workspace only and never returns question text, as stated in Role home view and Weekly quality rate.
401, 403, and 404, corrected
Do not swap these cases. Each case has different wording, different content, and a different count rule.
| Response | When it applies | Wording and content | Count and audit rule |
|---|---|---|---|
| 401 Sign in required | No signed-in session, session-only mode has ended, or a visitor without an account asks a personal question in the signed-in app or the widget | Sign in required for this college workspace. No question text, answer text, source record, saved item, or office detail from a workspace is returned. The public widget path stays available for public approved sources only. A failed sign-in routes to the named handoff office with name, phone, email, hours, and location from the office directory, as stated in Role features. | No workspace count changes. Test and staff preview sessions are labeled as test and are excluded from usage and satisfaction counts. |
| 403 Role does not cover the step | Signed in and the record is in this workspace, but the assigned role does not cover the step, the separate detail or export permission is missing, the person tries to approve their own submission, or publish is requested before approval, a handoff office, and retention are set | State the role that can do the step and link the relevant guide, as stated in Role home view. No record text is returned and no button that does nothing is shown. The public role filter on the guides index is discovery only and does not grant access, as stated in Search scope. | Reading full question text and exporting detail need the separate permission and each view and each export is audit logged, as stated in Reports and Verified expert. A denied attempt returns no count change. |
| 404 Not found in this workspace | The record id does not exist in this workspace, belongs to another college workspace, is opened through a share link that holds copy only, or is opened after a role change from a saved link | Not found in this workspace, in the same wording whether or not a record exists in another college. No confirmation of another college, no question text, and no mixing of records across colleges. A share link from Share an answer does not open a workspace record, as stated in Share answer. | No headline count, rating, or handoff is created. Superseded merged records stay readable as superseded for audit in Work unanswered and are excluded from headline counts. |
| Validation failure | A field in the validation table below fails its limit or format, or a duplicate save arrives | Inline error after the helper text for that field, one form summary with role alert above the primary action that receives focus and states the count of fields that need attention, as stated in Unified form layout. Correcting a field removes its error. | No record is saved and no duplicate is made. A duplicate title, question, source link, workspace, and assistant match updates the same saved item, as stated in Save answer bundle. |
| 200 Unavailable, not an error state | The check does not complete, times out, or returns no answer text | Unavailable wording only, no source listed, handoff office named from the office directory, as stated in Test answers. Do not present a failed check as no source. | Recorded separately as unavailable only when a question record was created. Never counted as not answered and never counted as a source gap, as stated in Test answers and Weekly quality rate. |
| 200 Not-known, not an error state | A complete check runs and no approved passage for this college and assistant supports an answer, passages disagree, or the only matching source is past its review date, suspended, expired, or retired | Not-known message, no answer shown, handoff office named with name, phone, email, hours, and location, as stated in Test answers. | Recorded as not answered. Handed off stays in the handoff rate only, as stated in Weekly quality rate. |
Specification by endpoint
Read only the row for the endpoint you are building. Each row uses the workspace, role, and permission wording already in the guides cited in the last column.
| Endpoint or screen | Workspace scope | Role and extra permission | Failed check returns | Source in this pack |
|---|---|---|---|---|
| Ask, signed in | One college workspace confirmed by the college name at the top of the app. Every question, answer, and source belongs to exactly one workspace. | Signed-in student, prospective student, faculty, help desk staff, student services staff, or college administrator for that college company. | No session returns 401. Question id from another college returns 404. No approved source returns 200 not-known. Failed check returns 200 unavailable. | Role first-run, Ask and check sources, Test answers |
| Website widget | Public approved sources only for the published assistant and college. No workspace record is searched or returned. | Visitor without an account. No follow control is shown to a visitor without an account. | Personal question returns 401 with sign-in or the named handoff office. No workspace id returns 404. | Role first-run, Search scope, Role features |
| My Answers, device and signed in | Device list searches the same device only. Signed-in items each belong to one workspace named on the item. | Own saved items only. Another person question text needs the separate detail permission. | Other workspace item returns 404. Same workspace other person without detail permission returns 403. Test answer saves no bundle. | Save answer bundle, Search scope, Share answer |
| Sources, submit and approve | One workspace per source, with owner office and future review date. A source past its review date stops being used in new answers. | Submitter may submit. Approval needs a different person with an active approver role. No person approves their own submission. | Self-approval returns 403 naming the approver role. Source in another college returns 404. | Role first-run, Approve a source, Test answers |
| Assistants, test panel, and publish | One workspace, one assistant name, draft status confirmed before testing. | Builder or college administrator tests. Approver reads test results. Publish needs approval, a named handoff office, and retention and access set. | Publish before those checks returns 403. Test session is labeled as test, excluded from counts, and cannot be endorsed. | Test answers, Role first-run, Verified expert |
| Improve, assign and resolve a theme | One workspace, with assistant, theme, owner office, and due date on the item. | Contributor, help desk staff, student services staff, or college administrator assigns owner and due date. Resolution needs the linked approved source or assistant change. | Theme in another college returns 404. Resolve without a linked change returns 403 by validation of the resolution note. Not in scope needs a written reason and stays visible. | Work unanswered, Role home view |
| Reports, list behind a number, read full question text, export detail | One workspace at a time, with assistant, channel, and date range in college local time. System view shows counts grouped by workspace only. | Count view follows the role for the task. Full question text and export need the separate detail or export permission. | Detail or export without that permission returns 403 with no text. Detail request in system view returns 403 and shows counts only. Other college detail returns 404. | Weekly quality rate, Verified expert, Search scope |
| Governance, retention and access | One workspace, with the college and assistant named on the saved rule. | College administrator only sets retention days or session-only mode, who may view full questions, and who may export. | Other role returns 403 naming college administrator. Audit entry must show who set the rule, when, and for which college and assistant. | Set retention and access, Role first-run |
| Team, invite and role assignment | One workspace. Confirm an active approver role for a different person before a source is submitted. | Workspace admin invites by MAJIC email and confirms the role as active in Team. | Pending invite does not approve a submission. Account in another workspace returns 404. Duplicate email or identity records are mapped to the surviving record in Workspace member audit. | Role first-run, Workspace member audit |
| Today, follow, and digest | Follow records belong to exactly one workspace. System view shows follow counts by college only, never follow detail. | Student follows own question only. Staff see aggregate follow counts only, with no list of followers by name. | Follow another student question returns 403 in the same workspace and 404 in another workspace. Visitor device follow list sends no digest. | Role features, Role home view, Role first-run |
| Notification preferences | Per person, per workspace, per college local time. Scheduled summary is off by default and global pause wins. | Own settings only. Caps stated in Notification preferences and Stale question reminders apply before any send. | Another person settings returns 403 in the same workspace and 404 in another workspace. No send occurs in the 21:00 to 08:00 quiet period. | Set notification preferences, Stale question reminders |
| Share and export of own history | Share copies text out of one workspace and does not move the record. No live link to a workspace record is created. | Own saved or asked answer only. Report export permission is not used for own history and is required for other people detail. | Share of another person or another college returns 403 or 404 by the decision order. Opening a share link returns the copy text, not a workspace record. | Share answer, Save answer bundle |
| Workspace search | Server filter to one college workspace at a time. Public search returns no workspace question text, saved item, source record, or office detail. | Return only records the signed-in role can view for the task in that college. Role filter on the public guides index does not grant access. | Record the role cannot view is not returned. Person in another college cannot open a result and receives 404. Test results are labeled as test and excluded. | Search scope, Search indexing |
Validation limits to enforce the same way on every form
Use these limits from My Answers, Share answer, and Unified form layout. A field that fails returns a validation failure, not a 401, 403, or 404.
| Field | Limit and format | Guide |
|---|---|---|
| Title | 200 characters, required for a saved answer and a share copy | Save answer bundle, Share answer |
| Question | 2000 characters | Save answer bundle, Share answer |
| Answer | 4000 characters, short answer only, no added fact | Save answer bundle, Share answer |
| Source title | 200 characters | Save answer bundle, Share answer |
| Source link | 500 characters, must start with https on the share tool, blank only for a not-known record with no source listed | Share answer, Save answer bundle |
| Last checked date | 80 characters, shown beside each source on the answer | Save answer bundle, Share answer |
| College workspace and assistant | 120 characters each, must match the college name and assistant named on the answer. A mismatch stops a save or a share. | Save answer bundle, Share answer, Verified expert |
| Collection and saved date | Collection 80 characters, blank means Unfiled. Saved date is YYYY-MM-DD or blank. | Share answer |
Keep label, field, helper text, and error text in that order on every form. Required fields show an asterisk in the label, the words required in screen reader text, and required plus aria-required on the field, as stated in Unified form layout.
Checks before you ship an endpoint change
Run each check as each role, on phone and desktop, with keyboard and screen reader. If a check fails, fix it before you publish.
- Anonymous visitor receives 401 for a personal signed-in question, sees no follow control in the widget, and can still use the public widget for public approved sources only
- Student in another college receives 404 with the same wording as a record that does not exist, and receives no confirmation that the other college record exists
- Signed-in student who tries to approve a source, set retention, or export other people detail in the same workspace receives 403 naming the role that can do the step, with no record text returned
- Approver can approve a source submitted by another person, and cannot approve a submission they submitted or built
- Reports detail and export without the separate permission are audit logged, system view shows counts only, and unavailable is counted separately from not answered
- Not-known and unavailable use different wording, different record states, and different counts, and a failed check is never shown as no source
- A role change takes effect on the next request, and a saved link from before the change returns 403 or 404 by the decision order instead of opening the record
- Validation failure shows an inline error after the helper text and a summary that receives focus, saves no record, and creates no duplicate
- Each rate shows its numerator and denominator counts with the same workspace, assistant, channel, and date range on screen and on the list behind the number
Next guide
Work the largest gap first, then check the count in the next period.