Guides · Reports

Trim API responses to the fields the screen reads

Use these trimmed schemas to cut bytes transferred on status, form, health, file and list responses while keeping every field the screen uses. Each table names the reader that proves the field, the fields to leave out, and the budget to check on a test record.

How the payload was measured

Each reader in this pack was read for the fields it uses. A field stays in the trimmed schema only where a reader reads it or a page states the screen shows it. A field that no reader reads, or that a page states the screen never shows, is left out of that response. Tenant filtering, permission checks, sign in and role rules stay exactly as they are. This page changes no security setting and no tenancy rule.

  • Readers checked: public/site.js for the demo form, public/status.html for the status lookup, public/health.html for the health check, and the source field tables on Reports and setup for signed in lists.
  • Measure on a test record in the town workspace. Record Content-Length, the field list, the page size shown on the list, and the screen result for each endpoint in the steps below.
  • Budgets below are targets to check on that test record, not claims about a live response today. Record the measured value beside the budget in setup notes.
  • Keep the alias rules in API response contract until each reader is updated to read the trimmed shape first. Do not remove a field a reader still reads in the same change.

Measured field usage from the readers in this pack

Work down the table in order before you change a response shape. Field counts below are counted from the reader code in this pack. They are distinct field names read by that reader, not live byte counts. Record Content-Length on a test record beside the budget in the next table.

Exact fields each reader in this pack reads
Reader in this packFields the reader reads, countedFields to leave out of that response
Status lookup, status page in public/status.html14 distinct field names. Top level: ok, record, next_step, timeline. Record fields: record_number, type_name, title, status, submitted_at, issued_at, closed_at, 7 fields. Timeline entry fields: changed_at, new_status, public_message, 3 fields per entry. The reader also accepts the same record inside data, and keeps the top level form until it reads data first, as in API response contract.Contacts, fees, documents, internal notes, phone, email, payment detail, reviewer comments, status link code, draft fields, database identifier and file content. None of those names is read by this reader.
Public request form, public/site.js3 semantic response fields. Top level: ok, error as one plain sentence string, and one code value. The code value is read under 4 alias names, code, requestId, request_id and diagnosticCode, for one value. The reader truncates the sentence and the code before display. Request fields sent by the form are form fields plus kind and page, and no record field is read in the response.Record data, echoed form field values, internal detail, stack text, secret, token and internal address. No data object is read by this reader.
Health check, health page in public/health.html1 field. Top level status with value ok, in a JSON body. The checked at time is generated on the device and is not read from the response.Response headers, build version, uptime, server detail, town data, timing, token, secret and connection string. None of those names is read by this reader.
Signed in list and detail screensUnknown: list reader code not in supplied site pack. No signed in list or detail reader file is in this pack, so no field count can be counted from a reader here. The projection for those rows below is taken from the source field tables on Reports and setup, and stays Unknown for a reader counted field list until the town office supplies that reader code.Full contacts list, full documents list, full fee lines, message text, internal notes, history text, file content and records from another workspace. Those items belong on a tab or detail response, not in a list row.

Summary representation for lists, and detail representation for one record

Use a summary row on every list and a detail header for one record. Load each tab on its own request. A list row never embeds a tab.

Summary row and detail header projections
RepresentationFields to return, and only those fieldsFields to leave out
List summary row, one row per record numberRecord number, status, record type, the one date the card names, submitted date or decision date or issued date, due date where the card names it, current workflow stage, department, parcel, last activity date where the card names it, and assigned reviewer or role on staff lists only. Meta with total, page, page size, page count, has more, request id and checked at, as in the pagination default below.Contacts, documents, fee lines, messages, history, file content, internal notes and any tab field. Derived counts such as days overdue are computed on the client from today and due date, instead of returning a second copy as text.
Detail header, one recordRecord number, type, status, parcel or address, applicant or contact by role as the screen shows it, next step, and timeline stage with owner and date for the current stage only.All tabs in one response, other applicant records, other workspace records, file content in a list view and internal notes in a public view.
One tab at a time, documents, fees, inspections, messages and historyOnly the fields for that tab, for that one record number, first page only with total, page, page size, page count and has more in meta where the tab states its fields.Every other tab, and any field from a tab the person has not opened.

Pagination default where a list shows no size

Use this default on a record list that shows no page size, and record it in setup notes with the town office before live use. Where a list already shows a page size, that shown size is the page size for that list and must be within the limit below.

Pagination default for list responses
ItemDefault and limit
PageDefault 1, the first page with rows. Changing Text, Status, Record type, Date, Owner, page size or sort resets page to 1. Moving page alone keeps every filter and the sort.
Page sizeDefault 20 rows per page. Clients send page size only, integer from 1 to 100 inclusive. A value of 0 or above 100 is invalid and is not silently clamped, as in Pagination, sorting and filtering contract.
Meta on every list responseTotal counts distinct record numbers across all pages, not rows on one page. Page count is total divided by page size rounded up, 0 where total is 0. Has more is true only where page is less than page count. Keep request id and checked at in meta.
Sort tie breakRecord number ascending after the named sort, so no record number repeats across adjacent pages and no record is skipped at a tie.

Trimmed schemas by endpoint

Work down the table in order before you change a response shape. The last column is the budget to check.

Trimmed response schemas, field selections and budgets
Endpoint and readerKeep, fields the UI usesLeave outBudget on a test record
GET status lookup by status link code, reader status pageok, record.record_number, record.type_name, record.title, record.status, record.submitted_at, record.issued_at, record.closed_at, next_step, timeline entries with changed_at, new_status and public_message onlyContacts, fees, documents, internal notes, phone, email, payment detail, reviewer comments, status link code, draft fields, database identifier, file contentUnder 4096 bytes uncompressed with up to 20 timeline entries. Dates stay as numbers until the reader is updated, as stated in the contract guide.
POST public request form, reader public/site.jsSuccess: ok true only. Error: ok false, error as one plain sentence, and one code alias from code, requestId, request_id or diagnosticCodeRecord data, echoed form field values, internal detail, stack text, secret, token, internal addressSuccess under 128 bytes. Error under 512 bytes.
GET health address, reader health pageStatus ok at the top level for /healthz, and no other fieldResponse headers, build version, uptime, server detail, town data, timing, token, secret, connection stringUnder 64 bytes.
POST and GET files with ref, stated in APPKIT.mdList row only: file name, date, version and received status as shown on the documents list. Upload result only: the same row fields for the file just receivedFile content, file bytes, storage detail, secret, token, vault item, other record filesUnder 256 bytes per row. Unknown: file object field names not in supplied site pack. Confirm names from the app modules before you rely on a name here.
Signed in record lists, largest list responses, source fields on Reports and setupOne row per record number with only the source fields the card names: record number, status, record type, submitted date or decision date or issued date as named on the card, due date where named, current workflow stage, department, parcel, last activity date where named, and assigned reviewer or role on staff lists only. Meta with total, page, page size, page count, has more, request id and checked at as in the pagination default aboveFull contacts list, full documents list, full fee lines, message text, internal notes, history text, file content, other workspace recordsUnder 512 bytes per row at the page size shown on that list, or at the default 20 where the list shows no size. Do not copy a page size from another list.
Workspace and account check, reader security page five stepsWorkspace name, name, email and role shown on the accountQueue rows, record rows from another workspace, secret, token, vault item, card detailUnder 512 bytes.
Project and record detail, largest single response, header and tabs on Permits and plan reviewHeader only: record number, type, status, parcel or address, applicant or contact by role as the screen shows, next step, timeline stage with owner and date for the current stage. Each tab loads on its own: documents, fees, inspections, messages and history return only the fields for that tabAll tabs in one response, other applicant records, other workspace records, file content in a list view, internal notes in a public viewHeader under 2048 bytes on a test record. Unknown: full detail field list not in supplied site pack. Supply the field list from the app modules and record it in setup notes.

Measured comparison for permits, documents, workspaces and users

Use this comparison to find unbounded results before you change a response. Field counts below are counted from the keep lists and the screens named in this pack. They are not live byte counts. Record Content-Length on a test record for each row, beside the budget in the table above, in setup notes.

List and detail comparison by endpoint group
Endpoint group, as named in this packFields the current screen requires, keptUnbounded or over-selected riskTrimmed paginated response to returnBudget to check on a test record
Permits and projects list, signed in record lists on Reports and setupRecord number, status, record type, the one date the card names, due date where named, current workflow stage, department, parcel, last activity date where named, and assigned reviewer or role on staff lists onlyFull contacts, documents, fee lines, messages and history embedded in each list row, so list size grows with every tab on every record and returns detail the record tabs already returnOne row per record number, meta with total, page, page size, page count and has more, page size as shown on that list or default 20, no tab fields in a list row, first page only with total counted across all pagesUnder 512 bytes per row at the page size shown on that list, as in the table above
Permit detail header and tabs on Permits and plan reviewHeader only: record number, type, status, parcel or address, applicant or contact by role as the screen shows, next step, timeline stage with owner and date for the current stage. Each tab keeps only the fields for that tabAll tabs in one response, plus unbounded timeline, history and message entries in one payload for one recordHeader as a separate request, each tab as a separate request by record number, each tab returns first page only with total, page and page size in meta, the next page by moving page only, filters and sort kept by the listHeader under 2048 bytes, as in the table above. Tab rows under 512 bytes per row where the tab states its fields, otherwise Unknown until the field list is supplied from the app modules
Documents list for one record, POST and GET files with ref, stated in APPKIT.mdFile name, date, version and received status as shown on the documents list. Upload result keeps the same row fields for the file just receivedFile bytes or file content in a list row, files for other records where ref is not applied, and an unbounded row count for one recordRows for the ref record only, one row per file, no bytes in a list row or in the upload result, first page only with total, page and page size in meta where the list shows a page size, otherwise default 20 and do not copy a page size from another listUnder 256 bytes per row, as in the table above
Workspaces, workspace selector and account check on the security pageWorkspace name for a selector row. Workspace name, name, email and role shown on the account for the account check, as in the five steps on that pageQueue rows, record rows and other workspace records embedded in an account or selector response, and an unbounded workspace list with records per workspaceSelector row is workspace name only, account check is one object with the four fields above and no embedded list, a workspace list returns first page only with total, page and page size where the list shows a page size, otherwise default 20Account check under 512 bytes, as in the table above. Check a selector row under 256 bytes per row on a test record as a target, not as a live claim
Setup users list on Set up a permit type and fees and on the security pageName, email and role shown on the account, and listed status where the Setup users list shows it, for the invite and role assignment steps on those pagesAssigned records, queue rows and history per user embedded in a user row, and an unbounded user list with no page limitOne row per person, no records or queues embedded, first page only with total, page and page size in meta where the list shows a page size, otherwise default 20, role check on the server on every requestUnder 512 bytes per row as a target to check on a test record, using the per row budget for signed in lists in the table above. Unknown: user list endpoint name not in supplied site pack
  • Count the kept fields and the left out fields for each row before you change a response. Where a kept field is not on the screen for that list, remove it from that list row and keep it only on the detail or tab response that shows it.
  • The total on a record list counts distinct record numbers across all pages, not rows on one page, as stated on Reports and setup and in Query contract. Do not read a row count on one page as a total, and do not copy a page size from one list to another list.
  • Changing Text, Status, Record type, Date, Owner or Sort returns the list to the first page with rows and keeps the other filters, sort and workspace, as stated in Query contract. Moving page alone keeps every filter and the sort.
  • Workspace stays fixed to the signed in workspace, or to this town on public search, with no picker and no way to list another workspace by typing its name, as stated on the security page. A trimmed response never widens that scope to fill a row.
  1. Measure the permits list and the detail separately

    On a test record, record Content-Length and the field list for one list page and for the header request. Confirm tab fields, file content and history text are absent from the list row, and confirm each tab returns only its own fields on its own request.

  2. Measure documents by ref and the upload result

    Record Content-Length for the documents list for one record and for the upload result. Confirm no file bytes are present, rows are for the ref record only, and the upload result carries the same row fields as the list row.

  3. Measure workspaces and users with no embedded lists

    Record Content-Length for the account check, a selector row where the app shows one, and one page of the Setup users list. Confirm no queue row, record row or history entry is embedded, record the page size shown or default 20, and confirm the role check still applies on the server.

  4. Compare before and after on the same test record

    Record the field list and Content-Length again after trimming, keep every field in the kept column for that row, and record the measured value beside the budget for that row in setup notes. Publish only after the screen still shows every kept field and public search with the test record shows no private field.

Field selection rules for the largest responses

Apply these rules in the app modules. They keep the screens working and stop a list or a detail response from growing with fields the screen never reads.

  • Select the named fields only. Do not return a whole record row where the screen reads the fields in the table above.
  • Return derived counts on the client from the fields returned, such as days overdue from today and due date, instead of returning a second copy as text.
  • Keep one row per record number on a list. The total counts distinct record numbers across all pages, not rows on one page.
  • Load documents, fees, inspections, messages and history as separate tab responses opened by record number, as in Search coverage by entity. Do not return every tab with the header.
  • Keep public search and the status lookup to public fields only. Phone, email, payment detail, internal notes and draft applications never appear there, as stated on Search a public record.
  • Keep the cache rule from the standing rules. Do not put long lived caching on files whose names do not change between versions.

Measure and publish in order

Work through these steps in order on one clearly marked test record. Each step ends with what you should see when it worked.

  1. Record the current size and field list

    For each endpoint above, record Content-Length, the field list, and the screen result on the test record. Note the page size shown on each list, or default 20 where no size is shown.

  2. Mark each field used or unused

    Compare the field list with the keep column in the table above and with the measured field usage table. Mark each field used by a reader or unused. Unused fields are the trimming list.

  3. Apply the trimmed schema and keep aliases

    Return only the keep fields in the app modules, keep the aliases stated in API response contract until the reader is updated, and keep tenant filtering and permission checks unchanged.

  4. Re-measure and check every screen

    Record Content-Length again and confirm the status page still shows record number, type, status, dates, next step and timeline, lists still show total, page and sort, and form and health screens still work. Confirm public search with the test record shows no private field.

  5. Publish only after the test passes

    Record the measured value beside the budget for each endpoint in setup notes, then publish. Drafts and the test record stay private and do not appear in public search.

API response contract · Query contract · Pagination, sorting and filtering contract · Reports and setup · Security

Bring your endpoint list to the demo

Tell us which list or record you need first, and we will confirm its trimmed fields and budget with your town role list.

Request a demo