What a 401 and a 403 mean, by endpoint
Use this page when a signed-in request is refused. It lists, for each endpoint stated in this site pack, what sign-in, workspace and role are required, and the exact response for an unauthenticated request and for an unauthorized request. UI hiding alone is never the check. The server checks sign-in, workspace and role on every request.
How to read this page
Scope is limited to endpoints stated in this site pack. An endpoint not stated here is Unknown on this site. Do not rely on a rule for an endpoint until the town office supplies its name, its required sign-in, workspace and role, and its response shape from the app modules outside this site pack.
- Workspace means the town MAJIC company selected in the app. Records belong to the selected workspace. Every signed-in request is limited to that workspace, and a request never lists another workspace by typing its name.
- Role means one PermitDesk app role assigned by a town administrator in the Setup users list. Signing in alone does not add a role and does not show a queue. A portal account never grants staff access.
- A hidden or disabled button is a screen aid only. It is not proof that the server refused the request. Confirm the refusal on the response and on the record itself.
- A failed 401 does not prove a database fault. A failed 403 does not prove the public site is down. Check the other lane before you report, as stated on the health page.
Per-endpoint authorization rules
Work down the table in order. The last column states what the pack does not state for that endpoint.
| Endpoint stated in pack | Sign-in, workspace and role required | 401 response, unauthenticated | 403 response, unauthorized | Not stated in pack |
|---|---|---|---|---|
| GET /healthz, dedicated health address, no sign-in | None. No sign-in, no credentials, no workspace, no role, no town data query. | Not expected. A sign-in page in place of a JSON result with status ok is not a confirmed health result. | Not expected. A refusal here is read as the public site did not serve a page, and the home page fallback applies, as stated on the health page. | Unknown: response body for a refusal on this address not in supplied site pack. Record only result, checked-at time in UTC, probe mode and page address. |
| POST /api/public/request, demo, question or pilot form | None. Public form. No sign-in, no workspace, no role. Field values are sent only to this endpoint for the reply. | Not stated. The pack states no sign-in step for this form, so a 401 here is not a stated response. Treat any non-success result as a failed request, keep entries on the page, and use the support code shown. | Not stated. The pack states no role step for this form, so a 403 here is not a stated response. Treat any non-success result in the same way as above, and do not send field values as analytics. | Unknown: exact failure body beyond a plain error sentence and a support code shown to the person, as stated in site.js. Success is shown in the pack as a form-done state after a successful submission. |
| GET /api/public/records/status/{code}, public status lookup by status link code, no sign-in | None. No sign-in, no credentials sent from the page, no workspace, no role. The page sends only the code entered or taken from the page address, and then clears the code from the address and from the entry box, as stated on the status page. No workspace, record number, role or sign-in field is sent in the request. | Not stated. The page treats any non-success result as a code that did not match a public status, and shows that same message without listing records or telling whether a record number exists. A 401 here is not a stated response, and no sign-in step is offered on that page. | Not stated. A 403 here is not a stated response. Do not treat a code that does not match as proof that a record exists or does not exist. A record number on its own does not show a status on that page, as the page states. | Unknown: exact server response body and status code for a code that does not match not in supplied site pack. Unknown: code format, expiry and revocation handling not in supplied site pack. For a match, the page states the returned fields are record number, permit type, title, status, submitted date, issued date, closed date, next step and public timeline only, with no contacts, fees, documents, internal notes or status link code. |
| POST /api/files and GET /api/files with ref, signed-in file upload and list | Sign-in required in the selected workspace. The ref, where present, must belong to that workspace. Role permission is checked on the server for that workspace and record. | 401. Sign-in is required. Sign in again to the same workspace address kept in that browser tab, then check the workspace name again before you work. Do not report this as a database or public site fault. | 403. Your role cannot use this action, or the record belongs to another workspace. Stop work on that record, note the workspace name, record number and step, and contact a town administrator. Do not create a second workspace or a portal account to work around it. | Unknown: permission name for file upload and file list not in supplied site pack. Unknown: exact error sentence for this endpoint not in supplied site pack. No file content, secret, key, token or vault item is returned in a refusal. |
| Signed-in record, queue, report, export and setup endpoints, /api lane, not enumerated in this site pack | Sign-in required in the selected workspace. Workspace membership is the selected town workspace only. Role permission is checked on the server for each request, not only on the screen, as stated on the security page. | 401. Sign-in is required. Sign in again to the same workspace address kept in that browser tab, then check the workspace name, name, email and role shown on the account again before you open a queue or record. | 403. Your role cannot use this action, or the record belongs to another workspace. The screen should show a plain message that says what your role can do instead. Stop work on that record, note the workspace name, record number and step, and contact a town administrator before you edit or move work. | Unknown: endpoint list per feature area not in supplied site pack. Unknown: permission name per endpoint not in supplied site pack. Supply the endpoint list and permission names from the app modules and the town role list before you rely on a rule for a named endpoint. |
Exact responses to record
Use these rows for every signed-in refusal. A refusal never returns town data from another workspace, and never returns a secret, key, token, vault item, card detail, connection string, internal address or build version.
| Response | Exact meaning stated in pack | Fields to record |
|---|---|---|
| 200, success | The request was served for the signed-in workspace and role. For the public request form, success hides the form and shows the thank-you state. For a record list, success shows the record fields for that workspace and role only. | Page address or workspace name, record number where relevant, check time, and whether the page or record was served. |
| 401, unauthenticated | Sign-in is required, or the session ended. Sign in again to the same workspace address kept in that browser tab. This is not a database fault and not a public site outage. | Workspace name where a workspace is shown, record number where relevant, response code, check time. No secret, key, token or vault item. |
| 403, unauthorized | Your role cannot use this action, or the record belongs to another workspace. The message is plain and says what your role can do instead. Stop work, note the workspace name and record number, and contact a town administrator. | Workspace name, name, email and role shown on the account, record number, response code, check time. No record from another workspace, and no personal detail beyond what the account shows. |
| Other error, server or network | The request did not complete. The message is a plain sentence telling the person what to do. Entries on a form are kept on the page where the pack states it, and a support code is shown to the person for the public request form. | Page address, response code where shown, check time, support code where the screen shows one. Do not record card numbers, passwords or other private details. |
Check a refusal in order
Work through these steps in order. Each step ends with what you should see when it worked.
Read the response code in words
Read whether the screen shows a sign-in message or a role message. A sign-in message is a 401 lane. A role message is a 403 lane. You should be able to name the lane in words from the screen itself.
Check the workspace name first
Confirm the workspace name shown in the app, and the name, email and role shown on the account, as in the five steps on the security page. An empty queue or a missing record can mean the wrong workspace.
Act only on the lane you read
For a 401, sign in again to the same workspace address kept in that browser tab, then check the workspace name again. For a 403, stop work on that record, note the workspace name and record number, and contact a town administrator to confirm or change the role. Do not create a second workspace or a portal account to work around either lane.
Report the lanes separately
Send a 401 result and a 403 result as separate lines, each with its page address or workspace name, record number where relevant, response code and time, as stated on the health page. Keep a liveness result separate from a readiness result.
Security · Site status check · Search a public record · Reports and setup
Bring the endpoint list to the demo
Tell us which signed-in list or record you need first, and we will confirm its sign-in, workspace and role rule with your town role list.
Response envelope for new and existing endpoints
Use the unified response contract on Unified API response contract for the envelope, field naming, ID, timestamp and pagination rules that apply to the authorization rows above. Keep status ok on /healthz, keep ok plus top level record fields on the status lookup, and keep the site.js aliases for error code and request ID until readers are updated.
- Success detail, list and error shapes are stated in that contract. Authorization does not change those shapes.
- A 401 or 403 body uses the error envelope in that contract, with records, secrets and internal detail left out.