/api/standards
Read and edit standards (specifications) — the structured documents that define project requirements. Supports revisioning, working copies, and comments.
GET /api/standardsList standards accessible to the authenticated user. Supports filtering by scope, project, company, library, and category. Each verbose row carries wiki_slug: the slug of the wiki page of the standard, or null when it has none.
Required permission: standard:read
| Name | In | Type | Description |
|---|---|---|---|
| subject_type | query | string | Filter by the scope the standard itself belongs to: "global", "company", or "project". To list what a project uses, call GET /api/projects/:id/standards instead: a project mostly adopts global and company standards, so subject_type=project with project_id returns only the few scoped to the project itself. |
| project_id | query | integer | Also include the standards scoped to this project (subject_type "project") alongside the global, company and personal standards the list always returns. It does NOT narrow the list to the standards the project uses: for "what standards are in project N", call GET /api/projects/:id/standards. |
| company_id | query | integer | Filter to standards owned by a specific company |
| library_id | query | integer | Filter to standards in a specific library |
| category_id | query | integer | Filter to standards in a specific category |
| search | query | string | Search by name, then description: best match first unless sort is given (the name exactly, then names starting with it, then names containing it, then description matches). Punctuation is ignored, words match in any order, common abbreviations are expanded (xfmr, swgr), and a misspelt word of five or more letters still matches (swtichgear). A search of punctuation alone matches it literally ("_", "%"). From an API key or connected app, a search that sends neither page nor per_page answers its best 20 rows, with total; send per_page (up to 100) for more. |
| mode | query | string | Optional, with search: "name" matches the search against standard names and wiki slugs only, never descriptions (the name exactly, then names starting with it, then names containing it or every word, the slug, a misspelt name, then a close trigram match for part of the name, so "door hardware schedule" still finds Door Hardware). Use it when you know what the standard is called: "door hardware" then answers Door Hardware without the standards whose descriptions mention doors. It answers the best 20 with total unless paged, and the response carries mode. From an API key or connected app, a name where the search begins a word ranks above one holding it inside a word ("Roofing": Low-Slope Membrane Roofing before Applied Fireproofing), your own (company, project, personal) standards come before public ones at an equal match, and each row carries `wiki` ({library_slug, standard_slug, url}: its public SynC Standards page, null when it has none). Without mode the search also matches descriptions. "name" is the only mode here: to search clause text by exact terms or by a question, call GET /api/standards/search-content with mode=keyword or mode=hybrid. Any other value is a 400 naming the valid modes. |
| names | query | string | Optional, with mode=name and instead of search: several standard names in one call, separated by "|" (names=Door Hardware|Firestopping|Rooftop Units) or as the parameter repeated; at most 20. Use it to find the standards to import in one call. The other filters apply to every name. per_page is then the matches per name (default 3, at most 20) and page is refused. The answer is `names`: [{name (as sent), total (matches for that name), count, standards}] in the order asked, each standards list best first. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| include_deprecated | query | boolean | Include deprecated standards (default false). A deprecated standard carries deprecated_at, deprecation_reason (the reason given when it was deprecated) and deprecated_by_name (who deprecated it); the compact format drops all three. |
| page | query | integer | Page number, from 1 (default 1). Paging returns total, page and per_page beside the rows. |
| per_page | query | integer | Results per page (1-100). Pages on its own, from page 1. Without it the list is not paged, except an API key's or connected app's search, which answers 20. |
| sort | query | string | Sort by: "name", "created_at", or "category" (default: category, name) |
| sort_order | query | string | "asc" or "desc" (default: asc) |
| format | query | string | "verbose" (default, every field) or "compact", which keeps only identity and navigation fields (id, name, description, scope, library, category, current revision) and drops the lineage/audit metadata. Built for token reduction when listing many standards. Compact cuts each description to about 150 characters unless include=description. From an API key or connected app the default is "compact"; send format=verbose for every field. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| include | query | string | "description": with format=compact, each description whole instead of its first ~150 characters. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
GET /api/standards/:idGet a standard with its full element content, revision info, and datasheet elements. To LOOK SOMETHING UP (what does a standard require, which element covers X) use GET /search-content first and then read just the element it cites with address=<address> — a full read is for exports, imports, or a complete review of one known standard. READ BY SECTION: first outline=true (address and a short heading per element, to depth 2: about 10 KB where the whole standard is 100-270 KB), then address=<address> for the part you need (that element and everything under it). The answer carries `section_read` {addresses, depth, outline, elements_total, elements_returned}. An address the standard does not have is 404 ADDRESS_NOT_FOUND, naming it, with the nearest addresses in metadata.suggestions; a malformed one is 400 INVALID_ADDRESS (metadata.reason says why). A section read answers a short header: id, name, description (summarised), revision_id, revision_code, current_revision_id and current_revision_code, is_working_copy, working_revision_id, subject_type, subject_id, library_id, library_name, category_id, category_name and deprecated_at, plus moderation, content_integrity, parent_standard_id and sync_source when set; include=header keeps the whole header. WITHHELD CLAUSES: a clause under a moderation hold keeps its address, depth and datasheet fields but returns empty content with a moderation object in its place. That object carries divergence: null, or — when this is a customized copy whose text for the clause already differed from what the notice pointed at before the notice was recorded — {beforeNotice, revisionId, revisionCode, changedAt, userId, userName, noticeRecordedAt}: a record of when this copy changed, never a finding about it, and never a lift of the hold. SOURCE: `wiki_adopted_revision_id` is the SynC Standards revision this revision was imported or last upgraded from (null for a standard your company wrote). Over HTTP the standard also carries `sync_source`: null, or {adopted_revision_id, title, revision_number, permalink}, the SynC Standards revision exports credit. A withdrawn SynC revision is never listed. USE: over HTTP with include=used_in_projects, `used_in_project_count` is the number of live projects whose revision the caller reads holds this standard or a project copy customized from it, counted ONLY over projects the caller may read: the open draft or current revision for a caller who may see the draft, otherwise the newest published revision the caller may open (for a share-link recipient, the newest one their links reach); null without include=used_in_projects, for a project copy, a read through a project (project_id or projectRevisionId), and format=compact. DEPRECATION: deprecated_at, deprecation_reason and deprecated_by_name say when, why and by whom the standard was deprecated (all null for an active standard). A deprecated standard cannot be added to a project. With revisionId, `revision_record` is the record of that revision (null without revisionId): `revision_record` is the record of this revision itself: { source_note, write_channel }. `source_note` is the writer-supplied source line (null when none). `write_channel` is how the revision was written, { channel: editor | api_key | connection | assistant | wiki, label }, and only for a caller in the company that holds the record; null for anyone else and for a revision from before it was recorded. Over HTTP the response carries `immutable` (always present): true only when it served a published revision from its verified stored content and the request named that revision, so the same request returns the same content and a client may reuse the answer for a short while; false otherwise (a current or draft read, failed integrity, withheld content, an export read). CLAUSE NUMBERS: `address` is always the decimal address (1.2.1). The read states numbering_applied (the pattern shown; "1" is decimal) with numbering_applied_form ("full" or "own"), numbering_source and the standard’s own numbering_setting with numbering_setting_form. Where a standard is not numbered in decimal, each clause also carries address_label, the number as shown (1.02.A), just before its address (a signed-in session always gets it). A clause parameter takes either form; the answer gives the decimal address. CITATIONS: [[sync/slug]] cites a SynC standard. [[lib/name]] cites a standard of the same library or, in a project, the standard the project holds under that citation name. Do not make up a name: write cite_as, which an API key or connected app gets on each standard (GET /citation-search finds others), or cite_clause_as + #<address> for one clause (null when none can be cited). Over HTTP `citations` gives each citation in the clauses returned, keyed as written: {state, standardId, standardRevisionId, candidates, fixed, reason}; a signed-in session asks with include=citations. state: bound (in a project, to the revision it holds), ambiguous (matches several held standards, in `candidates`), cited-not-included (a SynC standard the project does not hold; `fixed` {standardRevisionId, revisionCode, adoptedAt, source} is the revision it is fixed to, source pinned, dated, carried, next-issue, not-recorded or none), floating (no standard here has that lib/ name) or invalid (no standard you can read). A project revision you cannot see counts as no project.
Required permission: standard:read
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| revisionId | query | integer | Specific standard revision ID for historical view (optional). Defaults to the current revision, or through a project, the revision that project uses. A revision outside what you may read is 404. |
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. The assistant defaults it to the project the chat is open on. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. |
| project_revision_id | query | integer | The same as projectRevisionId: with project_id, the project revision you are reading, which decides the citation states (optional). Sending both names with different values is a 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| format | query | string | Response format: "verbose" (default, all fields) or "compact" (per element: address, content, toc_content and identity_uuid only, a smaller payload). Most clause text is in toc_content, not content, so read both. Compact leaves out attributes, so compact rows are not a body for PUT /:id/working-copy. Through a connected app a compact read of a large standard is still cut when it is over the limit, and says so: counts first, then elements_partial (rows with their text) and elements_outline (address and identity_uuid, no text). Compact leaves out datasheetElements unless include=datasheet. To read one section, send address (below). Invalid values return 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. To keep a standard read inside the context budget, read the outline and then the address you need, or find it via GET /api/standards/search-content. |
| address | query | string | Read one element and its subtree, e.g. 3 (section 3 and all of 3.x) or 3.1. Clause address as shown (1.01.A.1) or in decimal (1.1.1.1). Resolved against the revision you read, or for an edit, the draft your baseVersion names. Optional. |
| addresses | query | string | Several subtrees, comma-separated (3.1,4.2), at most 50, answered in document order. Each as shown or in decimal. Optional. |
| depth | query | integer | Only elements whose address has at most this many parts, 1-20, counted from the top of the standard: depth=1 is the top sections, depth=2 adds 3.1 but not 3.1.1. Optional. |
| outline | query | boolean | true: per element only {address, heading} (heading = the first ~80 characters of its text), no datasheet field list, depth 2 unless depth is sent. The cheapest first read; pick an address from it. |
| outline_full | query | boolean | true: answer an outline deeper than 2 whole. Without it, an API key or connected app asking for an outline deeper than 2 whose rows would pass 30 KB gets the depth=2 outline instead, with section_read.depth_asked, depth_capped {rows_asked, bytes_asked, cap_bytes, note} and section_counts (clauses under each clause listed), so it can read one section by address. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| description | query | string | "none": leave standard.description out of a section read (an API key or connected app). It is the same on every read of a standard, about 1.5-2 KB: send description=none on the reads after your first. Any other value: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| fields_only | query | boolean | Return only the standard's DATASHEET FIELDS: each with its id (what a datasheet create keys elementValues by), address, label, input type, option values, default and derived_basis. With them comes `clauses`, a short excerpt of each clause that holds a field, keyed by address, in place of the clause text. Use it before creating or filling out a datasheet: a full read of a large standard is cut to fit, and the cut drops fields. Over HTTP, read GET /api/datasheet/:standardId/template?fields_only=true instead. ASSISTANT PATH ONLY — the HTTP route does not read this parameter. |
| include | query | string | Comma-separated extras. "used_in_projects" fills `used_in_project_count` (see USE above); without it the count is null and costs nothing. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. "datasheet": keep datasheetElements with format=compact or outline=true (left out otherwise). With outline=true, and on any section read by an API key or connected app, each datasheet field comes back as a short row (id, address, label, input_type, unit, option_count, starting_disposition) and `section_read.datasheet` says so; "options" (include=datasheet,options) keeps every field in full. "description": the whole description on a section read (address, addresses, depth or outline summarise it to ~150 characters). "header": the whole standard header on a section read (it is short otherwise). "citations": the citations map (see CITATIONS above) for a signed-in session; an API key or connected app gets it without asking. |
GET /api/standards/:id/headThe standard's current state, without its content: id, name, subject_type, subject_id, library_id, library_name, category_id, category_name, current_revision_id, current_revision_code, working_revision_id (null when no draft is open), and deprecated_at, deprecation_reason and deprecated_by_name (all null for an active standard), as { head }. These are the fields of GET /:id that change while a published revision does not, so a client that reuses a revision it already read can ask for them alone. With include=used_in_projects, `used_in_project_count` follows the same rule as on GET /:id; otherwise it is null. Read through a project (project_id), the project must use the standard, as for GET /:id; otherwise 404.
Required permission: standard:read
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. The assistant defaults it to the project the chat is open on. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. |
| include | query | string | "used_in_projects" fills `used_in_project_count`; without it the count is null and costs nothing. "cite_as" adds cite_as and cite_clause_as, as GET /:id gives them to an API key (with revisionId, for that revision). |
GET /api/standards/:id/revisionsList revision history for a standard. On a customized copy each revision carries `source` (null, {kind: "customized", revisionId, revisionCode} for the source revision it was copied from, or {kind: "merged", fromRevisionId, fromRevisionCode, toRevisionId, toRevisionCode} for the source changes it took), and the response carries `lineage` ({source: {standardId, name, canView, home}, customizedFrom, syncedTo, mergeDraft}: the source, the revision copied from, the source revision the copy last took changes through, and an unsaved merge draft); `lineage` is null on a standard that is not a copy. `lineage.source.home` is who holds the source, {type: "global"|"company"|"user"|"project", name} (name "SynC" for the SynC library), or null when the reader may not be told. Over HTTP each revision also carries `sync_source`: null, or {adopted_revision_id, title, revision_number, permalink}, the SynC Standards revision it came from. Read through a project (project_id), only the revisions that project uses are listed.
Required permission: standard:view_revisions
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. The assistant defaults it to the project the chat is open on. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. |
GET /api/standards/:id/compareCompare two revisions of a standard side-by-side. Besides the clause and datasheet changes, returns `tags` ({added, removed}: tag names the newer revision gained and lost), `description` ({from, to, fromRecorded, toRecorded, changed}: each revision's description, older first, null for none; a revision saved before descriptions were recorded has fromRecorded or toRecorded false, and `changed` is true only when both sides were recorded and differ) and `contentIdentical` (true when the two revisions have the same content hash, which covers the clauses and datasheet fields but neither the tags nor the description, so a revision that changed only those is contentIdentical). Each clause UPDATE in `elementChanges` carries `changed`, which parts differ ("heading", "text", "attributes"), and `score`, the clause similarity of the two texts (0 to 1; null when a side is withheld). The score compares words and ignores punctuation, case and common words such as "the", "shall" and "not", so a clause whose only edit is in those (brackets removed, for example) is an UPDATE with score 1. Through a project, both revisions must be ones that project uses; otherwise 404. Over HTTP the response carries `immutable` (always present): true only when it served a published revision from its verified stored content and the request named that revision, so the same request returns the same content and a client may reuse the answer for a short while; false otherwise (a current or draft read, failed integrity, withheld content, an export read).
Required permission: standard:view_revisions
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| from | query | integer | Source revision ID |
| to | query | integer | Target revision ID |
| view | query | string | "full" (default): the changes plus both whole revisions as fromElements and toElements, which is large for a big standard. "changes": the changes only, without fromElements and toElements, with elementChanges and datasheetChanges paged by offset and limit, and `page` ({ offset, limit, elementChangesTotal, datasheetChangesTotal, nextOffset }). `summary` always counts every change. Use "changes" to ask what changed; ask for the next page with offset = nextOffset until it is null. |
| offset | query | integer | With view=changes: the first change to return in each list (default 0). |
| limit | query | integer | With view=changes: how many changes to return from each list (default 50, at most 200). |
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. The assistant defaults it to the project the chat is open on. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. |
GET /api/standards/search-contentHybrid semantic + keyword search over standards CONTENT — the requirement clauses and datasheet fields themselves, not just standard names. USE THIS FIRST for any question about what a standard requires or contains (e.g. "which standard covers corrosion protection?", "where is the sound-level field?"). It returns a ranked list of compact hits — each carrying the owning standard, a CITABLE element address, and a snippet — so you then fetch just that one element by address (e.g. GET /api/standards/:id) to read it in full. Do NOT pull a whole standard or datasheet into context to look something up; full-document reads are for exports or a complete review. Handles vocabulary gaps (e.g. "rust protection" finds "corrosion-resistant coating") and exact jargon (e.g. "NEMA 3R", "208Y/120V") alike. SCOPE CHOICE MATTERS: omit project_id to search the ENTIRE standards library — that is the right scope for "which standard covers X?", "does our library have anything about X?", and anything phrased about the library/company/wiki. Pass project_id ONLY when the question is about what THIS project's own standards say. A project usually pins just a few standards, so a project-scoped miss means "not in this project" — NEVER conclude the library lacks content until an UNSCOPED search also misses. Hits are standards-library content, not project documents — cite them by standard name + element address. SPEED: a new query is embedded first, which can take seconds. An API key or connected app waits at most ~1.5 s; past that it gets the keyword hits (clauses saying the query words, the most and rarest words first) with degraded: true, and the embedding finishes in the background, so the same query repeated shortly after gets the full semantic answer. PICK A MODE to skip that wait when you do not need meaning: mode=name when you know what the standard is called, mode=keyword for exact terms, mode=hybrid (the default) for questions. is_note: true on a hit marks an explanatory note, which requires nothing. CLAUSE NUMBERS: `numbering` states the numbering once {numbering_applied ("1" is decimal), numbering_source, and project_revision_id in a project}; `standards` (by id) lists only the standards numbered differently, and only their rows carry address_label (the number as shown) beside the decimal address.
Required permission: standard:read
| Name | In | Type | Description |
|---|---|---|---|
| query | query | string | What to search for — a natural-language phrase or exact jargon (required). |
| project_id | query | integer | Optional: restrict to the standards pinned to this project's current revision. OMIT for library-wide questions; if a project-scoped search misses, retry without project_id before concluding the content does not exist. A project you may not read, or that does not exist, is a 404. |
| projectRevisionId | query | integer | Optional, with project_id: the project revision whose pinned standards to search. When the user is viewing a published revision of the project, the page note names it: pass that id, or you search the draft instead. Default: the open draft for an author, the issued revision for a reader. Another project's revision, or one you may not read, is a 404; a historical revision needs project:revision:view. |
| limit | query | integer | Optional: max hits to return (default 20, max 100). |
| mode | query | string | Optional: what to run; the response carries mode when you send one. "name": the standards whose NAME matches the query (never descriptions or clause text, no embedding, fast), answered as `standards` (standard_id, name, standard_revision_id, revision_code, category_name, rank, best first) with hits empty and count the standards found; use it when you know what the standard is called ("door hardware", "firestopping"). "keyword": full-text over the clauses with no embedding, so it is fast and never degraded: clauses saying every query word, then those saying the most and rarest of them; a hit is "strong" only when its own clause text (not just the headings above it) says the query as typed or every query word; use it for exact terms ("NEMA 3R", "208Y/120V", "condensate drain"). "hybrid" (the default): keyword plus semantic, for questions ("submittals for firestop systems"). The one-phrase rule in the notes applies to hybrid only. Any other value is a 400 naming the valid modes. With mode=keyword the answer carries model: null (nothing was embedded), and over HTTP `standards` lists name matches only, at most 10. From an API key or connected app, mode=name ranks a name where the query begins a word above one holding it inside a word, puts your own (company, project, personal) standards before public ones at an equal match, and gives each row `wiki` ({library_slug, standard_slug, url}, null when it has no public SynC Standards page); and a hit's `wiki` carries `url`, the standard's public page. |
| group | query | string | Optional: "standard" answers `groups` instead of `hits`: one row per standard in the order its best hit ranked, with count (its hits among those answered), strong_count, addresses (in rank order) and top_hit (the best hit, as a hit). It sums the hits the search answered, so send limit=100 to count more. Use it for "which standards say X, and how much" without reading every hit. Not with mode=name or names (no hits to group). Any other value is a 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| standard_id | query | integer | Optional: search this one standard only, the revision GET /api/standards/:id would serve (with project_id, the standard's pin in the searched project revision). Use it before reading a long standard: search it, then read just the addresses the hits name. A standard you cannot read, or that does not exist, is a 404 "Standard not found"; one the project does not hold is a 404 saying so. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| names | query | string | Optional, with mode=name and instead of query: several standard names in one call, separated by "|" (names=Door Hardware|Firestopping|Rooftop Units) or as the parameter repeated; at most 20. limit is then the matches per name (default 3, at most 20). The answer is `names`: [{name (as sent), count, standards}] in the order asked, each standards list best first, as mode=name ranks; count is the matches in all. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
query — stringSEMANTIC search: it matches MEANING, so send ONE natural-language phrase describing ONE concept (e.g. "rodent and pest protection for switchgear enclosures"). There are NO boolean operators — a query containing bare OR/AND/NOT, a "|" alternation, or a comma/slash-separated keyword list is REJECTED and no search runs, because such a string embeds as literal words and retrieves worse, not broader. To cover several distinct concepts, make SEPARATE calls, one plain phrase each; never widen or repeat a query to compensate for a miss. REPORTING RESULTS: every hit carries a `confidence` tier — "strong" (real evidence) or "related" (adjacent content, offered without a claim) — and the response reports `strong_count`. When `strong_count` is 0, nothing in the searched content directly addresses the question: say that plainly FIRST. You may then point at the closest "related" hits as WHERE such a requirement would live if it existed (e.g. the enclosure/environment sections of the switchgear standards), explicitly labeled as closest-related context — never presented as findings, never as evidence the requirement exists, and never paraphrased into a requirement the standard does not state. `read_as` is [{from, to}] when a misspelt word was read as a word the hits use, else []; `unknown_term` is the word as typed when no searched clause uses it (confidence_signals.gate_reason "unknown-term"), else null. Each hit's `signals` says why it ranked, one key per way it matched: fts_rank (the clause says every query word; ts_rank), fts_any (it says only some of them; 1 plus the rarity of each word it says, so more and rarer words score higher; it appears only when no query embedding was used, as in mode=keyword or a degraded answer), trgm (a close spelling of a one- or two-word query, 0-1) and cos (similar in meaning, the semantic half, 0-1). HTTP CALLERS ALSO GET (API keys and the app, not the assistant): `standards`, the standards in the same scope whose name or description matches the query (standard_id, name, standard_revision_id, revision_code, category_name, rank: under 500 the name matched, 400-499 by close spelling, 500 and up the description only; library_deprecated, and library_replacement {standard_id, name, revision_code} when the library has replaced a pinned standard), and on each hit `path` (the heading titles above it, outermost first) and `is_heading` (a bare heading). WRONG TOOL FOR BROWSING: this searches requirement TEXT. To find out WHICH standards exist — picking imports for a project, covering several trades or categories, "what do we have on X?" — do NOT run one content search per topic. List the catalog instead: GET /api/standards (optionally with search=, category_id=, library_id=, subject_type=) returns the standards themselves, and GET /api/categories returns the category list to pick from. One listing answers what a dozen content searches only guess at, and each search costs a full turn of your limited budget.
PUT /api/standards/:idUpdate a standard. Only standards you own or have company-level update access to can be modified. A project's own copy (a standard homed in a project) changes only while that project's open draft holds it; otherwise this is refused with 409 "Open a draft of this project to change its standards." (code PROJECT_DRAFT_REQUIRED), before anything is written. DESCRIPTION: a standard's description is content. It is set here only before the standard's first revision; after that a different description is refused with 409 "A standard's description is part of its content. Change it in the draft, then save a revision." and nothing is written. Change it with PUT /:id/working-copy `description`, then POST /:id/publish. The description sent back unchanged is accepted. name and category_id change here at any time. category_id: for a company or personal standard, a category of the standard's own library; for a project standard, one of its project's sections or a SynC (global) category. Any other (a SynC category for a library standard, a category of another library, or one that does not exist) is a 404 and nothing is written. numbering: the standard's own clause numbering. null follows the project it is read in, else its library's default; every read returns it as numbering_setting and numbering_setting_form. SynC Standards take none (400).
Required permission: standard:update
name — stringdescription — string — only before the standard's first revision; see the descriptioncategory_id — integernumbering — object or null — clause numbering as { "pattern": "PART 1, 1.01, A., 1., a., 1), a)", "form": "full" }. pattern lists how the first clause of each level looks on its own line, top level first, separated by commas. Each level counts with 1, 01, A, a, I or i (numbers, two-digit numbers, capital or small letters, capital or small roman numerals); the top level counts with 1, 01, I or i. Punctuation around it: "A.", "a)", "(a)", or none. "1.01" shows level 1’s number, then its own; "01." shows only its own (what comes before the last point must be the counters of the levels above). A word before the number: "PART 1"; "PART+ 1" also puts the word in front of every full address below it (the nearest carried word above a line wins). Deeper levels repeat the last level written ("1, 1.1" continues as 1.1.1). Decimal is "1.". form: "full" (each clause shows its full address: the word, then every level’s number joined by points, as PART 1.01.A) or "own" (only its own level, exactly as written: A.); none is "full". References always use the short form (1.01.A). A string is taken as the pattern in the "full" form. null (or "inherit") removes the setting. Send what the user asked for; never pick a style for themNUMBERING is a setting, not content: changing it creates no revision and moves no fingerprint, and it is audited. It comes back normalized as the pattern and <field>_form ("full" or "own"). A pattern SynC can’t read is 400 with code INVALID_NUMBERING, a message that names the level and what was wrong (code in backticks), and metadata { field, reason, level, token } (reason: empty, empty-level, token, word-too-long, bracket, counter, first-level, above-count, above, too-long, form, type); nothing is written.
POST /api/standards/:id/editStep 1 of editing a standard: start editing by creating a working copy (returns the existing working copy if one already exists). Then save changes with PUT /:id/working-copy, and save the revision with POST /:id/publish. A project's own copy (a standard homed in a project) is edited only while that project's open draft holds it: otherwise 409 "Open a draft of this project to change its standards." (code PROJECT_DRAFT_REQUIRED). While the draft holds it, a caller without project:draft:edit on that project (an API key granted standard edits only, for one) is refused with 403, as its save would be: saving the copy moves the draft.
Required permission: standard:update
| Name | In | Type | Description |
|---|---|---|---|
| view | query | string | As on GET /:id/working-copy: "identities" answers with the identities-only working copy (address, identity_uuid and heading per clause, and version) instead of the whole draft. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
GET /api/standards/:id/working-copyGet the current working copy (draft) for a standard, with all elements and datasheet elements. Returns 404 if no working copy exists. WITHHELD CLAUSES: if the standard is under a moderation hold, every element is still returned, but a held one arrives SEALED — its content is the single line `<!-- sync:withheld:TOKEN -->`, its toc_content is "Withheld clause", and it carries sealed: true plus seal_token. The identities of the sealed slots are listed in sealedIdentities, and the standard-level notice is in moderation. The original text is never sent. Return a sealed element to PUT /:id/working-copy with its content byte-identical and the stored text is restored server-side; change it and you are authoring a replacement clause. Never invent, reuse or edit a token, and never offer to reconstruct the withheld text. A sealed element’s moderation object carries divergence: null, or — when this is a customized copy whose text for that clause already differed from what the notice pointed at before the notice was recorded — {beforeNotice, revisionId, revisionCode, changedAt, userId, userName, noticeRecordedAt}. That is a record of when this copy changed, never a finding about it: it does not narrow the hold and does not lift it. EDIT VERSION: the response carries `version` (an opaque string — never parse or change it); send it back as baseVersion on PUT /:id/working-copy and POST /:id/publish. Each element carries editedBy ({ userId, displayName } or null) and editedAt: who last changed that clause in this draft, null when unchanged since the draft opened. HTTP callers also get each element's `hash`, the per-clause merge key that PUT /:id/working-copy accepts back in baseElements. DESCRIPTION: `description` is the standard's description as the next revision will record it (the draft's own, or the standard's when the draft has not changed it; null for none). FIELD IDENTITY: in a browser session (the editor), each datasheet element also carries identity_uuid, the field’s identity, which the editor sends back as fieldIdentities on PUT /:id/working-copy. An API key, connected app or the assistant does not receive it.
Required permission: standard:view_drafts
| Name | In | Type | Description |
|---|---|---|---|
| view | query | string | "full" (default): the whole working copy. "identities": per clause only its address, identity_uuid, a heading (the first line of its text, cut to 80 characters with "..."), note: true for a note, fields (how many datasheet fields it holds) and sealed: true for a withheld clause, in document order under `identities`, with version, elementCount and datasheetElementCount. Use it to map identity_uuid onto a document you are converting without reading every clause. It is not a save body: its rows carry no text, so a list built from them is refused (ELEMENTS_INCOMPLETE). "severity": no content, only `severity` { suggested_severity, base_revision_code, next_revision_codes: {MAJOR, MINOR, PATCH} }, the level POST /:id/publish uses when you send no severity, computed from what the draft changes. Other values are 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
PUT /api/standards/:id/working-copySHORTEST PATHS. A few clauses or fields: PATCH /:id/working-copy with ops. A rewrite: GET /:id/markdown, edit the markup, send it here as `markdown` with openIfMissing: true (no POST /:id/edit and no baseVersion when no draft is open) and publish: { summary } to save the revision in the same call. clauseIdentities can be left out unless clauses moved or were rewritten past recognition (GET /:id/markdown?include=identities returns them). This save returns the same errors and problems POST /validate-markdown would. API keys and connected apps get the short answer (response: "summary") unless they send response: "full". Two modes. (1) FULL REPLACE (default): send ALL elements — any element not included is deleted. This is not a patch; to add/modify specific elements, first GET the standard to retrieve all elements, modify the array, then PUT the full array back. If the new element count is less than half the existing count, pass confirmReplace: true to proceed. WHOLE LISTS ONLY: each element is stored exactly as sent, so a key you leave out is cleared, never kept. A list taken from a shortened read is refused with 400 (code ELEMENTS_INCOMPLETE) and nothing is saved. Three cases: an element carrying content_omitted (an outline row; reason outline_row); an element whose text was shortened to fit a read, carrying truncated_keys or text ending in "... [+N chars truncated to fit context]" (reason text_truncated; a markdown save carrying that marker is refused too); an element that names an existing clause (by element_id or identity_uuid) and leaves out a content, toc_content or attributes key that clause holds (reason keys_missing, with the keys). Rows from GET /api/standards/:id?format=compact (address, content and identity_uuid only) are not a save body for that reason. A heading stored with empty content may be sent with toc_content only. An API key or connected app whose element list leaves out clauses the draft holds is refused with 400 (code CLAUSES_MISSING, reason clauses_missing; metadata gives missingCount and the first addresses, in document order) unless it sends deleteMissing: true. confirmReplace does not count. MARKDOWN DELETES NOTHING UNASKED: markup replaces the whole standard, so every clause of the draft that no clause in it pairs with is deleted, and a clause rewritten so far that it no longer pairs counts as deleted (it is saved as a new clause). From an API key or connected app, a markdown save that would delete any clause is refused with 409 (code DELETIONS_NOT_CONFIRMED) before anything is written, unless it sends deletions_ok: true. metadata gives count, total (the clauses in the draft) and clauses: [{ address, heading, identity_uuid }] (the first 15; clauses_listed when there are more). Withheld clauses are not counted: one left out is kept. To change a few clauses, use PATCH /:id/working-copy, whose delete ops need no flag. A clause sent with identity_uuid: null is a new clause and keeps no clause the draft holds, even at the same address. From an API key or connected app, clauses that carry the text of clauses in the draft laid out differently (a body on its heading line) would be saved as new clauses, losing the originals: that is refused with 400 (code CLAUSES_RESHAPED, reason clauses_reshaped, addresses in the draft), and deleteMissing does not change it. Put each body under its heading. Two elements naming the same clause (one identity_uuid or element_id on both) is refused with 400 (code IDENTITY_DUPLICATE, reason identity_duplicate, with duplicates: [{ identity_uuid, addresses }]); deleteMissing does not change that. The save replaces every datasheet field too, so a body with no datasheetElements stores none. From an API key or connected app, a save that sends no datasheetElements, sends an empty list, or leaves out fields the draft holds is refused with 400 (code FIELDS_MISSING, reason fields_missing, with fields: [{ element_address, label }]) unless it sends deleteMissing: true. A field counts as kept when the save would pair it: sent back as read on the same clause with the same label, moved to another clause under a label no other field has, or renamed on its clause to a similar label. A field replaced by an unrelated one on its clause is a deletion. A markdown save whose datasheet blocks leave out the draft's fields is refused the same way. Fields of a clause you leave out are counted with the clause, not again. A refusal lists every problem it found in metadata.problems, each { code, reason, count, addresses, keys?, fields?, duplicates? }; its code is the first problem's. POST /:id/working-copy/preview lists the same problems in its 200 before you save. A body carrying a NUL character (U+0000) anywhere is refused with 400 (code NUL_CHARACTER, metadata.field the path to it). DATASHEET FINDINGS ARE WARNINGS HERE: a field whose default is outside its options, whose range default is out of bounds or off its step, that says default: deferred without drawing_ref, or an option field with no options or a choice that is not text, is stored exactly as sent and does not refuse this save. When the body carries markdown or datasheetElements, the 200 lists each one in problems: [{ id, class: "content" | "revision", line, address, field, message }] (line is null for an element save); a body without datasheetElements, or with description only, has no problems key. Saving the revision (POST /:id/publish) refuses them (400 DATASHEET_FINDINGS), so fix each first. A connected app never receives a cut list as `elements`: a result cut to fit carries truncated: true and moves the rows to elements_partial and elements_outline. (2) PATCH MODE, in-app assistant only. Over HTTP there is no patch mode: a body without elements (or markdown) is refused with 400 "Elements array is required", and datasheetElementsOnly and removeDatasheetFields are ignored. For the assistant, patch mode edits datasheet fields only (the common case: changing a field's options/default/drawing_ref without touching the standard's requirement text): pass datasheetElementsOnly: true and OMIT elements entirely. Every requirement element and every datasheet field you do not mention is carried over unchanged automatically — you never need to re-fetch or resubmit the full document. In datasheetElements, each item is matched to an existing field by (element_address, label); to rename/respec a field (change its label), add match_label with the field's CURRENT label so it is matched to the right existing row instead of being added as a new field. To delete a field, list it in the top-level removeDatasheetFields array as { element_address, label } (using its current label, not match_label). WITHHELD CLAUSES: a sealed element returned from GET /:id/working-copy carries `<!-- sync:withheld:TOKEN -->` as its content. Send it back unchanged and the stored text is spliced back in server-side and the clause keeps its identity; send different text and you are authoring a REPLACEMENT — the held clause is retired and a new one is created in its place, recorded against your account. A sealed element you omit entirely is preserved, not deleted, so a hold can never cost a draft its text. A token that does not belong to this working copy is rejected with 409: re-fetch the working copy rather than reusing or editing a token. Deleting a withheld clause is done in the SynC editor only: its save names the token in deleteWithheld, and from an API key or connected app that field is refused with 403 "Deleting a withheld clause needs the SynC editor." (code DELETE_WITHHELD_EDITOR_ONLY). Leaving the element out is never a deletion. EDIT CONFLICTS: send baseVersion, the `version` from your most recent read (GET /:id/working-copy or POST /:id/edit) or from your previous save. If someone saved the draft since, the save is refused with 409 and `code: "EDIT_CONFLICT"`; re-read and apply your change again. Every successful save returns the new `version` for the next one. PROJECT COPY: a project's own copy is saved only while that project's open draft holds it; a working copy whose draft was issued or no longer holds the copy is refused with 409 "Open a draft of this project to change its standards." (code PROJECT_DRAFT_REQUIRED), and nothing is written. CLAUSE IDENTITY: every element a read returns carries identity_uuid. Send it back on the element it belongs to, or null for a new clause; the in-app assistant must include the key on every element of a full replace. From an API key, a connected app or the in-app assistant, an element sent with identity_uuid null is saved as a new clause under a new identity: it is never matched to an existing clause by its text, not even one this save removes. An element with no identity_uuid key is matched to the current clauses by its text and its place. To see how a save will pair its clauses before you send it, send the same body to POST /:id/working-copy/preview. A valid id of this standard is kept whatever the new text, so keep each id on the clause its text came from. An id of another standard, or one id on two elements (IDENTITY_DUPLICATE), is refused with 400 and nothing is saved. A malformed id, or one that names no clause, is ignored and listed in the response's identityWarnings: { address, identity_uuid or element_id, reason: malformed | unknown }. identityWarnings also lists reason possible_shift (from an API key, connected app or the assistant): a clause whose text is much closer to another named clause's old text than to the clause it names, with score, betterMatch { previousAddress, identity_uuid, score }, run { first, last, length } when consecutive clauses look shifted the same way, and a message. It is a warning only: the ids are saved as sent. SAME-DOCUMENT REFERENCES: [[#2.3.1]] cites clause 2.3.1 of this standard. In `elements`, write addresses as the draft you read (your baseVersion) numbers them; in `markdown`, as the document you send numbers them. When clauses are renumbered, the save moves each reference with its clause. A reference the save cannot place (its clause was removed, no clause has that address, or the clause is added in this same save) is stored as [[#?2.3.1]]. The save is never refused for it; saving the revision is. Fix it, or send it again once the clause exists. The response reports selfReferenceRewrites: [{ in, from, to }] (`in` is the citing clause's saved address) and unboundSelfReferences: [{ in, address, reason: 'removed' | 'no-clause' | 'unbound' }] ('unbound' means it was already unbound before this save). Both are empty when there is nothing to report. CITATIONS REPORT: when the text cites other standards, the response has citationsReport: { total, states: { <state>: count }, citations: [{ citation, address, state, reason }] }, states as on GET /:id. With response "summary" only those not bound are listed. It never refuses the save.
Required permission: standard:update
baseVersion — string — the `version` of the working copy you read; see the descriptionelements — array (required unless only description is sent, or, for the in-app assistant, datasheetElementsOnly is true) of { address, content, toc_content, attributes, identity_uuid } — identity_uuid as read, or null for a new clause (see CLAUSE IDENTITY); element_id is accepted in its placedatasheetElements — array of { element_address, label, input_type, options?, default_value?, order_number?, drawing_ref?, drawing_ref_locator?, starting_disposition?, constraint?, match_label?, identity_uuid? } — see notes for constraint. identity_uuid is not handed out by the reads and is not needed: fields pair by clause and label. If one is sent it must be a field of this standard, and that field is kept whatever its label; one carried by no field is ignored and listed in the response's fieldIdentityWarnings ({ address, field, identity_uuid, reason: unknown }); one of another standard is refused with 400 FIELD_IDENTITY_FOREIGN (metadata addresses and fields) and nothing is saveddatasheetElementsOnly — boolean — patch mode, in-app assistant only (see description); ignored over HTTPremoveDatasheetFields — array of { element_address, label } — patch-mode field deletions, in-app assistant only; ignored over HTTPdescription — string or null — HTTP callers only, not accepted on the assistant path: the standard's description as the next revision will record it (it is content; null or "" clears it). Omit it to leave the draft's as it is. Sent with only baseVersion, the save changes the description and no clause, and POST /:id/publish then saves it as a revision. GET /:id/working-copy returns the draft's descriptionconfirmReplace — booleanopenIfMissing — boolean — with no baseVersion: a standard with no draft gets one opened (as POST /:id/edit) and the save goes onto it; an open draft nobody has changed is saved onto as it stands. A draft holding changes still needs baseVersion (400 BASE_VERSION_REQUIRED). HTTP callers onlypublish — object { summary, severity?, tag_ids?, source_note? } — after a clean save, also save the revision, by the POST /:id/publish rules and gate (standard:revision:save, asked before anything is written). The 200 carries publish: { saved: true, revision, suggested_severity } and version: null (the draft is closed), or publish: { saved: false, code, message } when the save left problems (DRAFT_HAS_PROBLEMS), was merged with someone else's changes (DRAFT_MERGED) or the publish refused (its status, code and metadata); the draft is saved either way. HTTP callers onlyresponse — "full" or "summary" — HTTP callers only. Default: "summary" for an API key or connected app, "full" for a browser session. "summary" leaves baseElements and clauseIdentities out of the 200 and counts them instead (baseElementCount, clauseIdentityCount), with response: "summary"; version, identityWarnings, problems and the rest are kept. Without baseElements a later save that turns out stale is refused with 409 EDIT_CONFLICT instead of merged. To see the saved ids afterwards, read GET /:id/working-copy?view=identities. Other values are 400 and nothing is saveddeleteMissing — boolean — from an API key or connected app: your consent to delete the clauses and datasheet fields the draft holds that this save leaves out. Without it, a list that leaves clauses out is refused with 400 CLAUSES_MISSING, and a save that leaves fields out, sends no datasheetElements, or sends markdown with no datasheet block for them, with 400 FIELDS_MISSING. It also stands for confirmReplace. It does not let markdown delete clauses: that takes deletions_okdeletions_ok — boolean, with markdown — from an API key or connected app: you intend the clause deletions this markup makes. Without it, markup that would delete any clause of the draft (left out, or rewritten so far that it no longer pairs) is refused with 409 DELETIONS_NOT_CONFIRMED listing them, and nothing is saved. Read the list before you resend with true. It stands for deleteMissing too. Browser sessions are not asked for it. HTTP callers onlydeleteWithheld — array of up to 200 withheld-clause tokens (32 hex characters, as the working copy served them). Browser sessions (the SynC editor) only: from an API key or connected app it is refused with 403 DELETE_WITHHELD_EDITOR_ONLY and nothing is saved. Each named withheld clause, left out of the save, is deleted from the draft and recorded as deleted by the person saving; the hold on it still stands. A named clause the save still carries is 400, a token that belongs to no withheld clause of this draft is 409, and a draft whose whole body is withheld refuses it with 400. A token for a clause already deleted from this draft is not an error: the save goes through and that token counts for nothing. The 200 reports deletedSlots, the number this save deleted, which can be fewer than the tokens named. POST /:id/working-copy/preview ignores itmarkdown — string — the whole standard as SynC markup (see notes); API-key and MCP callers only, not accepted on the assistant pathclauseIdentities — array of identity_uuid or null, with markdown only — one entry per heading, in document order: the identity_uuid of the clause that heading is, or null for a new clause. Held to the same rules as identity_uuid on elements (see CLAUSE IDENTITY): a null entry is saved as a new clause, never matched by its text. If the count does not match the markdown's clauses, the whole array is ignored and every clause is matched by its text and its place. The response's clauseIdentities lists each saved clause’s identity_uuid in the same orderfieldIdentities — array, with markdown only, browser sessions (the editor) only: from an API key, connected app or the assistant it is ignored as if not sent, the fields pair by label and the response carries none of the field-identity keys below. One entry per heading, in document order: null, or an array of the identity_uuid (or null) of each datasheet field under that heading, every block under it in document order. A named field keeps that identity whatever its label. A heading whose array count is not its field count, or one with a block whose entries cannot be told apart by their - markers, falls back to matching its fields by label, as does every field naming an id that is malformed, named twice, or carried by no field; an id of another standard is refused with 400 FIELD_IDENTITY_FOREIGN (metadata addresses and headings, the heading indexes) and nothing is saved. An outer count that is not the headings’ falls back for every heading. The response reports fieldIdentitiesDropped (the addresses that fell back) and fieldIdentityWarnings ({ address, field, identity_uuid, reason: malformed | duplicate | unknown }). In a browser session, a markdown save that was not merged also returns fieldIdentities, the saved identity of each field per heading, and datasheetElements, the saved fields with identity_uuidbaseElements — array of { elementId, address, hash } — HTTP callers only: the per-clause base from the same read or save as baseVersion (each element's element_id, address and hash). With it, a save onto a draft someone else changed is merged clause by clause (see notes); without it, that save is a 409resolvedConflicts — array of { elementId, choice: 'mine' | 'theirs' } — HTTP callers only: how an EDIT_CONFLICT was settled, sent with the save that settles it (baseVersion = the conflict's currentVersion). Recorded in the audit logMARKDOWN: an API key or MCP client may send `markdown` instead of `elements`: the whole standard written in SynC markup (syntax: https://synergyinconstruction.com/standards/about/standards-markup-syntax.md), parsed server-side, full replace. SynC markup in short, with an example that validates: the notes of POST /api/standards/validate-markdown. Only a structural error (markup that cannot be stored as written: bad YAML, an unknown key or type, a constraint the type does not take, a range missing min, max or step) is refused, with 422 and an errors list, plus problems giving each one its class and line; nothing is saved. A datasheet finding (a default outside its options and the like) is saved as written and listed in problems on the 200 with its line. A leading YAML frontmatter block is accepted and ignored. This is the easiest way to convert an existing specification. If you are the in-app SynC assistant, markdown is NOT available to this assistant: send `elements`, or `datasheetElementsOnly: true` for a fields-only patch; a markdown-only body is rejected with "Elements array is required". In `elements`, a section heading carries attributes { inToc: true } and a note attributes { isNote: true }; a clause carries neither. DATASHEET FIELD DEFAULTS vs DRAWING REFERENCES: default_value is a literal value pre-filled into the field — for select/radio/checkbox/listbox/combobox it MUST be one of the values in options, or it silently matches nothing ("As indicated on the drawings" is NOT a valid default_value). To make a field defer to the drawings instead of carrying a default, set starting_disposition: 'per_drawings' (this is what actually seeds the "per drawings" state; legacy starts_deferred: true still works) plus drawing_ref: true and optionally drawing_ref_locator, and leave default_value null/omitted — the field can still keep its full options list for when it IS specified later. To make a field start as "Manufacturer's standard" (terminal — the vendor's standard design value governs, no coordination follow-up), set starting_disposition: 'manufacturer_standard'; no drawing_ref needed. constraint: on a range field min, max or exact; on a checkbox or listbox field all_of or any_of; omit it when the direction is not known, never guess. The label then names the quantity without "Minimum" or "Maximum". ADDRESS HIERARCHY (enforced): element addresses are dot-separated numeric outline addresses forming a heading tree — every dotted address requires its parent to be in the submission (submitting '1.1' without '1' is a 400; levels cannot be skipped), addresses must be unique, and top-level sections are plain integers. ATTACHMENT (enforced): every datasheetElements item's element_address must equal the address of an element in the same submission — datasheet fields attach to an existing requirement/heading element; a field pointing at a nonexistent address is a 400, never a silent drop. EDIT CONFLICTS (HTTP): a save whose baseVersion is stale is merged when it carries baseElements — each clause (an element with its datasheet fields) takes whichever side changed it since the base; additions and deletions follow by presence. The merged save returns merged: true, mergedChanges: [{ elementId, address, change: "changed" | "added" | "deleted" | "moved", editedBy, editedAt }] naming whose changes came in ("moved": they only moved the clause; editedBy is null unless one save came in between; a clause rewritten past recognition is one "changed" entry under its new id with replacedElementId, the element it replaced), and workingCopy (the merged draft). Both sides changing the same clause, or a merge that breaks the outline, is 409 EDIT_CONFLICT with metadata { code, reason, currentVersion, editedBy, editedAt, conflicts: [{ elementId, address, baseAddress, theirsAddress, mineAddress, reason, editedBy, editedAt }] }. Nothing is written on a 409. The assistant never merges: its stale save is always a 409.
PATCH /api/standards/:id/working-copyChange a few clauses or datasheet fields of the draft without sending the whole standard. Each op names a clause of the draft as you read it, by identity_uuid or address (its address in that draft, before any op moves it); ops run in order. Clause ops: { identity_uuid | address, set: { toc_content?, content?, kind? } } (toc_content is the heading line, content the lines under it, kind "clause" | "section" | "note"); { insert_after: <identity_uuid | address>, element: { toc_content, content?, kind?, fields? } } (a sibling after the clause and its children); { insert_into: <ref>, element } (the last child of the clause); { delete: <ref>, withChildren?: true } (a clause with clauses under it needs withChildren). Field ops, by clause and label: { field: { identity_uuid | address, label }, set: { ...datasheet keys } } (a key set to null is removed); { add_field: { identity_uuid | address, field: { label, type, options?, default?, ... } } }; { delete_field: { identity_uuid | address, label } }. Datasheet keys are those of the markup: label, type, options, default, unit, min, max, step, setpoints, drawing_ref, derived, constraint. The result is saved by the markdown save of PUT /:id/working-copy, with one identity per heading: untouched clauses keep their identity and text, an inserted clause is new, fields pair by clause and label, and the same guards and problems apply (a patch the parser refuses is 422 with errors; nothing is saved). An op naming no clause or field is 400 PATCH_TARGET_NOT_FOUND, a malformed one 400 PATCH_OP_INVALID (metadata.op is its index); nothing is saved. EDIT VERSION: baseVersion is the version of the draft as you read it (GET /:id/markdown?draft=true, GET /:id/working-copy or the answer of the last save). A draft that moved since is 409 EDIT_CONFLICT with currentVersion: re-read and patch again; a patch is never merged. openIfMissing: true opens a draft when none is open (or uses one nobody changed), so no baseVersion is needed then. publish: { summary } saves the revision after a clean patch, as on PUT. A draft with a withheld clause is 409 CONTENT_WITHHELD: use the element save of PUT. The 200 is the short answer of the save (response: "full" for the whole) plus ops: { changed, inserted, deleted, fieldsChanged, fieldsAdded, fieldsDeleted, insertedClauses: [{ address, identity_uuid }] }. SynC markup in short, with an example that validates: the notes of POST /api/standards/validate-markdown.
Required permission: standard:update
ops — array of patch ops (see the description), at most 200baseVersion — string — the version of the draft as read; required unless openIfMissing finds no draft or an untouched oneopenIfMissing — boolean — as on PUT /:id/working-copypublish — object { summary, severity?, tag_ids?, source_note? } — as on PUT /:id/working-copyresponse — "summary" (default) or "full"GET /api/standards/:id/markdownThe standard as SynC markup: the form PUT /:id/working-copy takes back, so you can edit it and send it back (a round trip with no edit changes nothing). Much smaller than the element read. Returns { standardId, name, source, markdown, clauseCount, fieldCount } plus, for the saved revision, revisionId, revisionCode and hasOpenDraft, and for a draft (draft=true) its version, to send as baseVersion. With include=identities, clauseIdentities: one identity_uuid per heading in document order, as PUT takes them. To cite clause numbers, send include=addresses: each heading starts with its address, e.g. "## [6.1.3] Zone pressures" (for reading; never PUT that markup back). A standard with a withheld clause (a moderation hold) is 409 CONTENT_WITHHELD: read it as elements. To change a few clauses, PATCH /:id/working-copy with ops is shorter still. ONE SECTION: address=3 (or addresses, depth) answers the markup of that part only, with `section_read` {addresses, depth, outline, elements_total, elements_returned}; outline=true answers `outline` rows instead of markdown, and its section_read adds depth_counts (how many clauses sit at each depth, so you can pick a depth before reading deeper) and, on an outline deeper than 2 of more than 150 rows, size_note; from an API key or connected app, an outline deeper than 2 whose rows would pass 30 KB answers depth 2 with depth_capped and section_counts instead (outline_full=true for the whole). For clause numbers with the text, read the markdown with include=addresses rather than a deep outline. An unknown address is 404 ADDRESS_NOT_FOUND with the nearest addresses. A part is for reading: PUT /:id/working-copy replaces the WHOLE standard, so never send a part back there; change it with PATCH. With include=addresses on a standard not numbered in decimal, each heading shows the number as shown, then the decimal address where they differ: "## [1.02.A (1.2.1)] Zone pressures". The answer states numbering_applied ("1" is decimal), numbering_source and numbering_setting.
Required permission: standard:read
| Name | In | Type | Description |
|---|---|---|---|
| draft | query | string | "true": the open working copy, which needs standard:view_drafts and edit rights on the standard (404 when no draft is open). Otherwise the revision GET /:id serves. |
| revisionId | query | integer | A saved revision to read instead (not with draft). |
| include | query | string | Comma-separated: "identities" adds clauseIdentities; "addresses" starts each heading with its clause address in brackets ("## [6.1.3] Zone pressures"), for citing clause numbers without an outline read, with addresses_note. Markup read with addresses is for reading only: PUT would save them as heading text. |
| address | query | string | Read one element and its subtree, e.g. 3 (section 3 and all of 3.x) or 3.1. Clause address as shown (1.01.A.1) or in decimal (1.1.1.1). Resolved against the revision you read, or for an edit, the draft your baseVersion names. Optional. |
| addresses | query | string | Several subtrees, comma-separated (3.1,4.2), at most 50, answered in document order. Each as shown or in decimal. Optional. |
| depth | query | integer | Only elements whose address has at most this many parts, 1-20, counted from the top of the standard: depth=1 is the top sections, depth=2 adds 3.1 but not 3.1.1. Optional. |
| outline | query | boolean | true: outline rows {address, heading} (heading = the first ~80 characters) in place of markdown, depth 2 unless depth is sent. Pick an address from it. |
| outline_full | query | boolean | true: answer an outline deeper than 2 whole. Without it, an API key or connected app asking for an outline deeper than 2 whose rows would pass 30 KB gets the depth=2 outline instead, with section_read.depth_asked, depth_capped {rows_asked, bytes_asked, cap_bytes, note} and section_counts (clauses under each clause listed), so it can read one section by address. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
POST /api/standards/validate-markdownCheck a whole standard written in SynC markup without saving it. Returns 200 with ok, errors (each one would stop PUT /:id/working-copy from saving, worded as that save words it: structural errors only), warnings (the save succeeds, but saving the revision would refuse or flag it: a default outside its options, a range default out of bounds, and the like), problems (the parser messages and the Save revision findings, each { id, class: "structural" | "content" | "revision", line, address, field, message }), and a preview of what the markup parses into: element counts by kind, each element with its address, kind (section, clause or note) and opening text, and each datasheet field with its type, unit, constraint (null when not yet curated, which the page reads as exact on a range and all_of on a checkbox or listbox), default, drawing reference and starting state. Send standardId to also see how a save onto that standard would match its saved revision (matched, new and removed elements) and its open draft (hasOpenDraft; a draft that changed nothing reads as none). PUT /:id/working-copy (and POST /api/standards with markdown) returns these same errors and problems and saves nothing on a structural error, so you need this check only when there is no draft to save into: checking a file before you know which standard it becomes. Do not validate and then save the same markup.
Required permission: standard:read
markdown — string — the whole standard as SynC markup; a leading YAML frontmatter block is ignoredstandardId — integer — a standard you may read; adds comparison: { matched, new, removed, ... } against itWRITES NOTHING: no draft is opened, changed or saved, so it needs no baseVersion and can be called as often as you like. It parses exactly as PUT /:id/working-copy parses a markdown body, so markup that validates with ok: true saves without parse errors. Element ids are not assigned here: addresses in the preview are outline positions, not ids. errors lists at most 100 messages (errorCount is the total); the preview lists at most 300 elements and 300 fields (truncated: true when cut). Markup longer than 1,000,000 characters is a 413. A standardId you may not read is a 404. SYNC MARKUP IN SHORT. Each heading is one element, numbered by nesting (1, 1.1, 1.1.1): never type numbers. `# Title {toc}` is a section, an unmarked heading a requirement clause, `## Text {note}` a note (no shall/should/may). Once one heading has {toc}, mark every section with it. Go one level deeper at most per heading (# then ##, never # then ###), six levels at most. One line per heading. Lines under a heading (text, - lists, | tables) belong to it. A YAML frontmatter block is ignored. FIELDS: a ```datasheet block under a heading holds one field (a YAML mapping) or several (a YAML list of mappings, each with its own label). Keys: label and type (required), options, default, unit (range and text only), constraint (range: min, max or exact; checkbox and listbox: all_of or any_of), drawing_ref (true or a locator), derived (a basis or true), attrs. Any other key is an error. Types: text (options: { multiline: true } optional), radio and select (one choice), checkbox and listbox (several; the default is a list), range (options min, max, and step or setpoints; the default must be on that grid). A range needs both bounds and a step or setpoints: when the source gives none, ask the person for the range and steps; never invent them. default: deferred (needs drawing_ref), manufacturer or derived (needs derived) sets a starting state, not a value. Leaving default out is allowed: the project decides. Quote an option that contains ": ". Never put [[...]] inside a block. REFERENCES: [[sync/slug]] another standard ([[sync/slug|text]] with link text), [[sync/slug@7#4.2]] clause 4.2 of its revision 7 (revision required), [[#2.1]] clause 2.1 of this standard, [[drawing: locator]] a value the drawings give, [[parameter: name]] a project fact (lower case, hyphens). [[lib/name]] a standard of this library or project. Copy cite_as from a read; never invent a name. EXAMPLE (validates with no problem), between the ~~~ lines: ~~~ # Submittals {toc} ## This section lists what is submitted. {note} ## The Contractor shall submit the following: - Product data - Shop drawings ```datasheet label: Format type: radio options: - Electronic - Paper ``` # Exhaust Fans {toc} ## Fans shall deliver the airflow below, tested to [[sync/fan-testing]]. ```datasheet - label: Airflow type: range unit: cfm constraint: min options: min: 500 max: 5000 step: 100 default: 1500 - label: Housing Finish type: select options: - Galvanized - Painted default: manufacturer - label: Accessories type: checkbox constraint: any_of options: - Damper - Bird screen default: - Bird screen - label: Sound Data type: listbox options: - Octave band - Overall dBA - label: Location type: text drawing_ref: roof plan default: deferred - label: Motor Size type: text unit: hp derived: airflow and static pressure default: derived ``` ## Fans shall be de-rated for [[parameter: altitude]] and placed [[drawing: per the roof plan]]. ~~~
POST /api/standards/:id/publishSave the current working copy as a new numbered revision (saving a revision) — the final step after POST /:id/edit and PUT /:id/working-copy. The revision is sealed; further edits require opening a new working copy. The revision records the draft's description, and the standard's description becomes it. A draft whose only change is its description (PUT /:id/working-copy `description`) can be saved as a revision; a draft with no change to its clauses, datasheet fields, description or tags is refused with 400. A PROJECT'S OWN COPY (a standard homed in a project): that project's open draft always uses the copy's latest saved revision, so this save moves the draft to the new revision, recorded like Change Revision with the rationale "Saved from the project", in the same transaction: if the move fails, nothing is saved. Datasheets built on the standard stay on their revision and read as needing reconcile, as after Change Revision. The draft stays where it is never left behind: a caller without project:draft:edit on the project (an API key granted standard edits only, for one) may not save the copy, a 403 before anything is written. A copy no open draft of its project holds is not saved at all: 409 "Open a draft of this project to change its standards." (code PROJECT_DRAFT_REQUIRED), asked before the permission. The response then carries `projectDraft: { projectId, projectRevisionId, moved: true, holds, holdsRevisionId }`, `holds` being the revision code the draft now uses. Absent for any other standard. SAME-DOCUMENT REFERENCES: a draft that holds an unbound reference [[#?2.3.1]], or a [[#2.3.1]] naming no clause of the draft, is refused with 422 `code: "SELF_REFERENCE_UNRESOLVED"` and nothing is saved. metadata.problems lists every one as { citing, target, reason: 'removed' | 'no-clause', message }. Re-read the draft (an unbound reference keeps the address it last had, which may now be another clause), fix or remove each one with PUT /:id/working-copy, then save the revision. DATASHEET FIELDS: the working copy as stored, however it was written (markup or elements), is checked before anything is saved. A default that is not one of its options, a range default out of bounds or off its step, `default: deferred` (starting_disposition per_drawings) without drawing_ref, an option field with no options, a choice that is not text, or `[[drawing:` markup inside a label, option or default (kind legacy-deferral) is refused with 400 `code: "DATASHEET_FINDINGS"`; the message names the first, and metadata.problems lists every one as { class: 'content' | 'revision', kind, address, field, message }. Fix each with PUT /:id/working-copy, then save the revision.
Required permissions: standard:update, standard:revision:save
summary — stringbaseVersion — string — the `version` of the working copy you are saving as a revision, from your most recent read or save. If the draft changed since, no revision is saved: 409 `code: "EDIT_CONFLICT"`; re-read it and review before saving the revisionseverity — stringsource_note — string — optional, at most 200 characters: your integration's own source line (e.g. "From Revit model sync"). Stored apart from the summary and shown beside it; the summary is always exactly what you wrotetag_ids — array of tag UUIDs — the COMPLETE set of topic tags to seal onto the revision being saved. See the notes: omitting it and sending an empty array are DIFFERENT requests.severity is optional; accepted values are major|minor|patch (case-insensitive). Omitted, SynC computes it from what the draft changes against the last revision: PATCH when only the description, tags, whitespace or numbering changed; MINOR when a clause was added, edited or moved, or a field label, default or starting state changed; MAJOR when a clause was removed, or a datasheet field was added, removed or had its type, choices, unit, range or constraint changed. A severity you send overrules it, higher or lower. The first revision is MAJOR (1.0.0). The response carries suggested_severity beside revision.severity, and GET /:id/working-copy?view=severity reads the computed level before you save. tag_ids is the revision's topic tag set, and saving the revision is the moment that set becomes the standard's answer to "what is this about?" — the tag filters read the current revision. It REPLACES the set rather than adding to it, so send every tag the revision should end up with. Choose ids from GET /api/standards/tags; only an active tag can be added, and an unknown or retired id is a 400 naming it. ABSENT AND EMPTY ARE NOT THE SAME REQUEST: omit tag_ids to say nothing about tags, which leaves the standard's existing tags in place, and send an empty array ONLY to say the revision should carry no tags at all, which removes every one of them. Anything else that is not an array (null included) is a 400 rather than a guess. If you have no instruction about tags, omit the field.
POST /api/standardsONE CALL: send markdown (the whole standard as SynC markup) and publish: { summary } with the fields below, and this creates the standard, saves the markup in its first draft and saves revision 1.0.0. Leave out publish to leave a draft for a person to review (the answer gives draft.version to save onto). Send idempotency_key (a UUID) so a retry never makes a second standard. Markup or a gate refused before the write creates nothing; the answer is { standard: { id }, draft: { version, elementCount, datasheetElementCount, problems }, publish? }. Create a new standard FROM SCRATCH. Standards are reusable assets — before using this, search for an existing wiki/company/personal standard covering the subject (GET /api/standards/search-content or the standards list) and prefer importing or customizing it into the project. Create from scratch only when the user explicitly asks for a brand-new standard or no usable existing standard was found (and say which of those it was). A project standard (subject_type 'project') is created IN the project's open draft: it is placed in the draft, in the section category_id names, with its first working copy, and `standard.projectDraft` says where. No open draft is a 409 (`metadata.code = "PROJECT_DRAFT_REQUIRED"`), and creating one needs project:draft:edit on the project (403). The project cannot be published until the new standard has a saved revision (POST /:id/publish). category_id: for a company or personal standard, a category of the library the standard goes in (library_id, or the one the scope decides); for a project standard, one of its project's sections or a SynC (global) category. Any other (a SynC category for a library standard, a category of another library, or one that does not exist) is a 404 and nothing is written; the refusal names the library and where to list its categories. In a scope with no library yet, create the category first with POST /api/categories, which makes the scope's Default library, then create the standard under it. EVERY STANDARD IS IN A LIBRARY. library_id, when sent, must be a library of the standard's own scope (its company's, or your own personal library); any other, or one that does not exist, is a 404 "Library not found". Omit it and the scope decides: its only library is used; a scope with several is a 400 (`metadata.code = "LIBRARY_CHOICE_REQUIRED"`, `metadata.libraries` lists {id, name}: retry with one of them, asking the user which when it is not clear); a scope with none is a 409 (`metadata.code = "LIBRARY_REQUIRED_FIRST"`) for an API key or connected app, which never creates a library implicitly: create one with POST /api/libraries (needs library:create), then retry with its id. A project standard always joins the project's own library, and library_id is ignored there.
Required permission: standard:create
name — stringcategory_id — integersubject_type — stringdescription — stringlibrary_id — integersubject_id — integermarkdown — string — the whole standard as SynC markup, as PUT /:id/working-copy takes it. The create opens the first draft and saves the markup there by the rules of that save. Markup with a structural error is 422 (errors, problems, created: false) and nothing is created. A new standard has no clause to delete, so a create needs no deletions_ok; a later PUT of markup that would delete clauses doespublish — object { summary, severity?, tag_ids?, source_note? } — with markdown: also save revision 1.0.0, by the POST /:id/publish rules (needs standard:revision:save). Markup whose problems Save revision would refuse is 422 DRAFT_HAS_PROBLEMS (metadata.problems) and nothing is createdidempotency_key — string (1-255 printable characters, e.g. a UUID) — or the Idempotency-Key header: a retry with the same key within 24 hours returns the first answer (header Idempotent-Replayed: true) instead of a second standard. The same key with a different body is 422 IDEMPOTENCY_KEY_REUSEDsubject_id scopes ownership: for subject_type 'user' it MUST be your own user id, for 'company' your own company id. Another account's id is rejected before anything is written, and the rejection names the id to use — do not retry with a guessed id, and never create a standard in someone else's scope. GET /api/whoami?fields=ids lists your user id, your companies and your personal libraries. From an API key or connected app, subject_id may be left out: for 'user' it is your own id, for 'company' the one company you act for (with several, the refusal lists their ids). A personal library (subject_type 'user') needs a live company seat to write in: creating, editing, saving a revision, retiring or deleting there, and customizing into it, are refused with 403 `metadata.code = "PERSONAL_LIBRARY_NEEDS_SEAT"` when you hold no seat. A project role is not a seat. Without one you can still read your personal library; nothing in it is deleted. With a seat, your OWN personal library is yours to author whichever company roles you hold: the standard/library/category create, update and delete permissions this endpoint names are not needed there for a signed-in person (a plain company member creates personal libraries and sections). An API key or connected app must still carry the permission in its own list; without it the call is 403 `permission_denied`, even though its seated owner may. To learn ahead of a write whether you hold a seat, read `personal_library_seated` on GET /api/whoami?fields=ids (a signed-in person also finds it on GET /api/users/profile): true when you may write in your personal library, false when the write would be refused. SYNC MARKUP IN SHORT. Each heading is one element, numbered by nesting (1, 1.1, 1.1.1): never type numbers. `# Title {toc}` is a section, an unmarked heading a requirement clause, `## Text {note}` a note (no shall/should/may). Once one heading has {toc}, mark every section with it. Go one level deeper at most per heading (# then ##, never # then ###), six levels at most. One line per heading. Lines under a heading (text, - lists, | tables) belong to it. A YAML frontmatter block is ignored. FIELDS: a ```datasheet block under a heading holds one field (a YAML mapping) or several (a YAML list of mappings, each with its own label). Keys: label and type (required), options, default, unit (range and text only), constraint (range: min, max or exact; checkbox and listbox: all_of or any_of), drawing_ref (true or a locator), derived (a basis or true), attrs. Any other key is an error. Types: text (options: { multiline: true } optional), radio and select (one choice), checkbox and listbox (several; the default is a list), range (options min, max, and step or setpoints; the default must be on that grid). A range needs both bounds and a step or setpoints: when the source gives none, ask the person for the range and steps; never invent them. default: deferred (needs drawing_ref), manufacturer or derived (needs derived) sets a starting state, not a value. Leaving default out is allowed: the project decides. Quote an option that contains ": ". Never put [[...]] inside a block. REFERENCES: [[sync/slug]] another standard ([[sync/slug|text]] with link text), [[sync/slug@7#4.2]] clause 4.2 of its revision 7 (revision required), [[#2.1]] clause 2.1 of this standard, [[drawing: locator]] a value the drawings give, [[parameter: name]] a project fact (lower case, hyphens). [[lib/name]] a standard of this library or project. Copy cite_as from a read; never invent a name. EXAMPLE (validates with no problem), between the ~~~ lines: ~~~ # Submittals {toc} ## This section lists what is submitted. {note} ## The Contractor shall submit the following: - Product data - Shop drawings ```datasheet label: Format type: radio options: - Electronic - Paper ``` # Exhaust Fans {toc} ## Fans shall deliver the airflow below, tested to [[sync/fan-testing]]. ```datasheet - label: Airflow type: range unit: cfm constraint: min options: min: 500 max: 5000 step: 100 default: 1500 - label: Housing Finish type: select options: - Galvanized - Painted default: manufacturer - label: Accessories type: checkbox constraint: any_of options: - Damper - Bird screen default: - Bird screen - label: Sound Data type: listbox options: - Octave band - Overall dBA - label: Location type: text drawing_ref: roof plan default: deferred - label: Motor Size type: text unit: hp derived: airflow and static pressure default: derived ``` ## Fans shall be de-rated for [[parameter: altitude]] and placed [[drawing: per the roof plan]]. ~~~
POST /api/standards/:id/customizeCreate a standalone customization. WARNING: Does not add to project draft. Use POST /api/projects/:projectId/standards with action: "customize" instead for project workflows. A project destination (projectId) is refused with 409 "Customize into a project from its draft.": a copy into a project is made only through that route, which places it in the open draft.
Required permission: standard:customize
name — stringcategoryId — integerprojectId — integer — refused with 409: customize into a project from its draftcompanyId — integerpersonal — booleanlibraryId — integer — the destination library, one of the company's or your own personal librariessourceRevisionId — integerSnake_case (category_id, project_id, company_id, source_revision_id) is accepted for each, and is the spelling the validation errors use — an error reading "category_id is required" refers to the categoryId you sent, not a second field. Exactly one destination: companyId or personal: true (projectId is refused with 409, see the description). Sending two is a 400, sending none is a 400. companyId may be any company where you hold standard:create, not only your primary one; any other is a 403. personal: true puts the copy in YOUR personal library: the owner is always the signed-in account, never a body field, it goes in one of your personal libraries, and categoryId must be a global category or one of your own personal categories. With companyId, categoryId must be a global category or one of that company's. Any other category, or one that does not exist, is a 404. A copy is always filed under a category of its own library. When categoryId is a category of another library (a SynC Standards category, or one from another of the company's libraries), the copy goes under the category with the same name and the same parent in the destination library, and that category is created there if it is missing. libraryId (or library_id) names the destination library; one outside the destination is a 404 "Library not found". Omitted, the destination decides by the same rule as POST /: its only library; several is a 400 (`metadata.code = "LIBRARY_CHOICE_REQUIRED"`, `metadata.libraries`); none is a 409 (`metadata.code = "LIBRARY_REQUIRED_FIRST"`) for an API key or connected app, which must create a library first with POST /api/libraries. A personal library (subject_type 'user') needs a live company seat to write in: creating, editing, saving a revision, retiring or deleting there, and customizing into it, are refused with 403 `metadata.code = "PERSONAL_LIBRARY_NEEDS_SEAT"` when you hold no seat. A project role is not a seat. Without one you can still read your personal library; nothing in it is deleted. With a seat, your OWN personal library is yours to author whichever company roles you hold: the standard/library/category create, update and delete permissions this endpoint names are not needed there for a signed-in person (a plain company member creates personal libraries and sections). An API key or connected app must still carry the permission in its own list; without it the call is 403 `permission_denied`, even though its seated owner may. To learn ahead of a write whether you hold a seat, read `personal_library_seated` on GET /api/whoami?fields=ids (a signed-in person also finds it on GET /api/users/profile): true when you may write in your personal library, false when the write would be refused. A source whose home is a company library or a project needs standard:customize there; reading it is not enough. GET /:id/customize-destinations lists the destinations you may use. sourceRevisionId names the revision to copy (default: the current one). It must be a published revision of this standard: another standard's or a missing revision is a 404, a working copy or a revoked wiki edition a 400. When there are any, `citationsDiffer` in the answer lists the [[lib/x]] citations in the copy that name another standard than in the source, or none (`names` null). A deprecated source standard is a 400. A revision that retires the standard (a "(Superseded)" stub, including a current revision that is one) is a 409. A source standard under a moderation notice is refused with 409 and `metadata.code = "STANDARD_UNDER_MODERATION_NOTICE"` — the copy would inherit the notice, so upgrade to the replacement edition named in the error instead, or remove/swap the standard when there is none.
GET /api/standards/:id/customize-destinationsWhere you may put a customized copy of this standard, in one read: `companies` ({id, name}: the companies whose library you may add to), `personal` ({available, reason}: your personal library; available false without a live company seat, which writing there needs, and then reason "PERSONAL_LIBRARY_NEEDS_SEAT"; reason is null otherwise), and `projects`: the projects where you may edit the draft and customize, each with `has_draft`, `can_open_draft` (you hold project:draft:create there), `held` (null, or {revision_id, revision_code, section: {id, name, label}} when the open draft holds this standard, so a customize there replaces it), `held_copy` (null, or {standard_id, name} when the draft holds an earlier copy of it) and `datasheet_count` (the draft datasheets a replace moves onto the copy). `standard` carries the source name, its `home` ({type: "global"|"company"|"user"|"project", name}: who holds it, name "SynC" for the SynC library), current revision and the revisions a copy may start from, newest first. Every list is filtered by the gates of the write it leads to: company and personal by POST /:id/customize, projects by POST /api/projects/:id/standards with action "customize". A project without an open draft is listed so it can be shown, but a customize into it is refused until a draft is opened. Read through a project, the revisions offered are the ones that project uses.
Required permission: standard:read
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
PATCH /api/standards/:id/deprecateDeprecate a standard (soft removal without deleting). Deprecated standards remain accessible in projects that already use them but are hidden from standard lists by default. A project's own copy that an issued project revision holds is deprecated only while the project's open draft holds it: otherwise 409 "Open a draft of this project to change its standards."
Required permission: standard:delete
reason — stringPATCH /api/standards/:id/reactivateReactivate a deprecated standard. Fails if an active standard with the same name already exists in the same scope. A project's own copy that an issued project revision holds is reactivated only while the project's open draft holds it: otherwise 409 "Open a draft of this project to change its standards."
Required permission: standard:delete
DELETE /api/standards/:idPERMANENTLY delete a standard, and the SECOND of two steps. Refused with 409 unless the standard has already been deprecated (PATCH /api/standards/:id/deprecate, which is reversible via /reactivate) — destruction is never a single call. Also refused with 409 if the standard is used in any PUBLISHED project revision, and that refusal is terminal: deprecating it first will not unlock this. Customizations derived from it are not deleted; they lose their parent reference.
Required permission: standard:delete
confirmName — string — the standard's exact nameconfirmName is MANDATORY and must match the standard's name EXACTLY (character for character) — there is no unconfirmed form of this call. Anything else returns 400 with requiresConfirmation:true plus the real name and the number of customizations that will lose their parent reference. Read the standard first (GET /api/standards/:id) for its exact name, and tell the user that customization count before deleting.
DELETE /api/standards/:id/working-copyDiscard a working copy without saving a revision. WARNING: If the standard has no saved revision yet, this permanently deletes the standard (there is no revision to revert to). Allowed for a project's own copy even with no open project draft: it removes an unsaved change rather than making one. Always a full discard; to discard only a draft that changed nothing, use POST /:id/working-copy/discard-if-untouched.
Required permission: standard:update
POST /api/standards/:id/working-copy/discard-if-untouchedDiscard the working copy only if it changed nothing: identical to the saved revision it was opened from, in content and tags, and not a merge draft. Returns { discarded: true|false }. A draft holding a change, a standard's never-saved first draft, or no draft at all is left as it is (discarded: false). The editor calls it on the way out, because opening the editor opens a working copy before anything changes.
Required permission: standard:update
POST /api/standards/:id/working-copy/previewSee how PUT /:id/working-copy would pair your clauses with the draft before you save. Send the same body as the save (`elements`, or `markdown` with optional `clauseIdentities`); baseVersion is not needed. Nothing is written. Returns clauses, one per clause you sent, in your order: { address, previousAddress, identity_uuid, tier, score, outcome, markedNew?, refused? }. outcome is "kept" (it keeps the identity of the clause at previousAddress) or "new" (it gets a new identity). markedNew means you sent identity_uuid null; refused (unknown or duplicate) means an id you sent was not used. tier and score say how it was matched: T1 by the id you sent, which is kept whatever the text (score says how far the text moved), T2 to T7 by its text and place. Also removed (the draft's clauses nothing keeps: { address, identity_uuid }) and summary: { kept, new, removed, warnings }. Each warning is { kind, address, previousAddress, message, ... }: kind "cross_section" when a clause keeps the identity of a clause from another section by similar text, "note_to_requirement" or "requirement_to_note" when a note and a requirement are paired by text (these two carry tier and score), "possible_shift" when a clause's text is much closer to another named clause's old text than to the clause it names (score, betterMatch { previousAddress, identity_uuid, score }, and run { first, last, length } when consecutive clauses look shifted the same way: a misaligned list). Warnings never stop the save. Check every warning and every previousAddress that differs from address: if a clause is not the one it is paired with, send it with identity_uuid null (a new clause) or with the identity_uuid it should keep, then save. changes is the change list against the last saved revision, as the Save revision dialog shows it: { against: { revisionId, revisionCode } or null, clauses, summary: { added, removed, modified, moved, replaced } }. Each clause is { change, address, previousAddress?, previousSection?, identity_uuid, changed?, score?, comments?, fields?, note? }, change one of added, removed (address is where it was), modified (changed names which parts differ: "heading", "text", "attributes"; score is the word similarity against the saved text, which ignores punctuation, case and common words such as "the", "shall" and "not", so an edit in only those, such as brackets removed, is modified with score 1), moved (its text unchanged: a clause renumbered and also changed counts as modified and carries previousAddress, so moved is not every renumbered clause), or replaced (a removed and an added clause at the same number in the same section; replacedIdentity names the removed one). comments and fields count what rides on the old clause; a clause modified so far that its score is under 0.25 carries note, "N comments and N fields stay with this clause", when either is nonzero. clauseIdentitiesDropped: true means your clauseIdentities count did not match the headings and was ignored, as the save would ignore it. problems lists, first, what the save itself would refuse, one entry per problem with class "save" and the code the save would answer with: ELEMENTS_INCOMPLETE (outline_row, text_truncated, keys_missing), IDENTITY_DUPLICATE, and, from an API key or connected app, CLAUSES_RESHAPED and, without deleteMissing: true, CLAUSES_MISSING and FIELDS_MISSING. Each is { id, class: "save", line: null, address, field: null, code, reason, count, addresses, keys?, fields?, duplicates?, message }. Send deleteMissing as you will send it to the save. Then the datasheet findings the save would store and Save revision would refuse, as the save returns them (no problems key when the body has neither markdown nor datasheetElements and the save would refuse nothing); a markdown body with a structural error is a 422 here too. The preview cannot foresee a moderation hold or a change someone saves to the draft before you do.
Required permission: standard:update
elements — array — as PUT /:id/working-copydatasheetElements — array — as PUT /:id/working-copymarkdown — string — as PUT /:id/working-copyclauseIdentities — array of identity_uuid or null, with markdown only — as PUT /:id/working-copydeleteMissing — boolean — as PUT /:id/working-copy: with true, the problems leave out CLAUSES_MISSING and FIELDS_MISSINGbaseVersion — string — optional: the version you read. With it, a draft changed since is read as the save would merge it (a clause someone else added since is not counted as left out)fieldIdentities — array, with markdown only — as PUT /:id/working-copy, and likewise ignored from an API key, connected app or the assistant. The response then carries fieldIdentities (per heading, the identity_uuid each field would carry, null where its label decides), fieldIdentitiesDropped and fieldIdentityWarnings, as the save reports thembaseElements — array of { elementId, address, hash } — as PUT /:id/working-copyPOST /api/standards/:id/mergeApply a settled merge plan from GET /:id/merge-plan to a CUSTOMIZED standard. The result is a DRAFT (working copy) of this copy carrying the merged document — NO REVISION IS SAVED; review it and then save the revision with POST /:id/publish. Every conflict in the plan must carry a resolution: there is no default and no suggested side, and a missing one is a 409 with nothing written. The auto-resolved, new and removed lanes apply exactly as the plan listed them. Taking "theirs" keeps the SOURCE clause identity, "mine" and "combine" keep this copy's — never a third one. Datasheet fields follow the plan's `fields` lanes: carried fields arrive under the source field identity on their clause, dropped ones go, and each field conflict needs "theirs" or "mine". Refused with 409 when: the plan is stale (planHash mismatch — re-fetch and settle again), this standard already has an unpublished draft open (one that changed nothing is discarded instead), a clause the merge would bring in from the source is under a moderation notice, a conflict whose clause is withheld in this copy was settled as "combine", or the merge would remove a held clause carrying a field. A field this copy keeps on a clause the merge removes goes with the clause (listed in `datasheetFields.removedWithClause`); datasheet values on it are settled by the datasheet reconcile. Every outline question in the plan (`outline.questions`) needs an answer too, keyed by its `questionId`, or the merge is a 409 the same way. The merged outline is three-way: this copy's own moves and reorders survive. The response's `outlineReports` lists what the outline placed on its own (by identity and number, never text). A refused merge leaves no draft open. On success `parent_current_revision_id` advances to the merged revision, so the "parent has been updated" signal stops firing for it. Refused with 400 when `toRevisionId` is not an eligible revision of the source (the set Change Revision offers: a saved revision of that standard, not revoked, not a retirement stub); 404 "Standard not found" when the caller cannot read the source; for a project's own copy, 409 "Open a draft of this project to change its standards." (code PROJECT_DRAFT_REQUIRED) when no open draft of the project holds it, and 403 when the caller lacks project:draft:edit there, as for its save.
Required permission: standard:update
toRevisionId — integer — the parent revision to merge FROM (the same one passed to GET /:id/merge-plan)planHash — string — the planHash that merge plan returnedresolutions — object keyed by the conflict's conflictId (or by its address when only one conflict sits there), valued 'theirs' | 'mine' | 'combine', or { choice: 'combine', combinedText: '…' } to supply the combined clause text (combinedText is the canonical key; content is accepted as an alias, and combinedTocContent sets the heading). A field conflict is keyed by its "field:<identity>" conflictId and valued 'theirs' | 'mine'. An outline question is keyed by its questionId ("outline:heading:…", "outline:place:…", "outline:order:…", "outline:nesting:…") and valued with one of its `options`: 'keep_heading' | 'move_to_previous' | 'remove' for a removed heading, 'theirs' | 'mine' for the others. Required whenever the plan reports conflicts or outline questions.Read GET /:id/merge-plan first and show the user BOTH sides of every conflict plus the auto-resolved lanes — the author is confirming a whole plan, not adjudicating exceptions. Never settle a conflict on their behalf and never describe one side as recommended: the plan deliberately carries no suggestion. A "combine" needs the text they want, not a merge of the two sides invented for them. An outline question shows a `default`; show it as the default, but send it only when the user chose it.
POST /api/standards/:id/acknowledge-sourceKeep a CUSTOMIZED standard as it is after its source saved a new revision: advances the copy's last-seen source revision WITHOUT merging, so the "source updated" signal stops firing until the source saves another. Writes no content and saves no revision; the acknowledgement is recorded (who, when, which source revision). Refused with 409 when the standard is not a customization, is already current with its source, or the source has saved another revision since toRevisionId (review the newer revision first), and for a project's own copy that no open draft of its project holds ("Open a draft of this project to change its standards.").
Required permission: standard:update
toRevisionId — integer — the source revision the user reviewed (the merge plan's toRevision.id)Only on the user's explicit decision to stay on their current content, after they have seen what the source changed (GET /:id/merge-plan). To take the changes instead, use POST /:id/merge.
POST /api/standards/:id/commentsAdd review comment(s) to standard requirement elements. CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
Required permission: standard:comment
CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
GET /api/standards/:id/commentsList comments on a standard. Omit element_id for all comments, or filter by specific element. Comments on a standard come from three places, each row saying which in `home`: comments on the library standard itself (`home: "library"`, for a reader of the standard); comments made in projects that reached the standard's own firm (or owner), from any project, for a holder of the permission to manage that library (library:update); and, with project_id, that project’s own comments on it as the project comment plane serves them (`home: {projectId, projectRevisionId}`). Each row is {id, home, standardId, standardRevisionId, elementId, anchorType, fieldId, parentId, author: {id, name, companyId}, body, state, answer, direction, disposition, intent, createdAt}: `anchorType` is `standard_element` (a clause) or `datasheet_field` (a field of one of the standard’s datasheets, with `fieldId` the datasheet field and `elementId` the clause it sits on); `parentId` names the comment a reply answers and `answer` is the latest resolution’s answer in full. `direction` is `internal` (kept inside the author’s organization) or `external`. `disposition` is `comply`, `deviation`, `exception` or `na`, or `comment` for a plain library comment; `intent` (`position`, `question`, `suggestion`, `scope_assertion`) is set on project comments only. Either is null where the comment has none. A project comment, on a clause or on a datasheet field, is received only when it was addressed to the library’s firm (the firm is its recipient or it was forwarded to the firm), or it is the firm’s own in a thread that reached the firm (the thread’s first comment, or any reply in it, was addressed to the firm); never an internal one. Each reply is judged on its own: a reply between other parties is private and is not listed, nor is what the firm wrote in a thread that never reached it.
Required permission: standard:read
Optional permissions (unlock additional behaviour): project:read, library:update
| Name | In | Type | Description |
|---|---|---|---|
| element_id | query | integer | Filter to a specific element (optional) |
| project_id | query | integer | The project the standard is read in (optional): adds that project’s own comments. A reader who reaches the standard only through a project must name it, or gets 404. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. |
PUT /api/standards/:id/comments/:commentId/resolveResolve or reopen a comment on a standard. CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
Required permission: standard:comment:resolve
CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
GET /api/standards/:id/changelogFor a CUSTOMIZED standard, show what the company changed relative to the source revision the copy was last synced to: the source revision of the latest merge on that revision’s own history, or, with no merge, the one it was customized from (`customized_from_revision_id`). An acknowledgement without a merge does not move it. The delta is listed clause by clause and datasheet field by field, matched on element identity so a renumber does not mispair clauses. Each change carries `change_type` (INSERT added, UPDATE modified, DELETE removed, ADDRCHG moved with unchanged text) and, except for an INSERT, `change_details` with the source side (`previous`, and the previous address when it moved). A fork with no edits has no changes. Authorship is per revision, not per clause: every row names who saved the revision and when. Returns nothing meaningful for a standard that is not a customization.
Required permission: standard:view_revisions
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| revisionId | query | integer | Compare a specific revision of THIS standard against the source instead of the current one (optional) |
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
GET /api/standards/:id/merge-planFor a CUSTOMIZED standard, the three-way merge plan against a revision of the standard it was customized from: base (the source revision this copy last merged or kept, else the fork point), theirs (the parent revision) and mine (this copy). Clauses are matched on element identity, never on section number, so a renumber on either side does not mispair them. THIS IS A READ — it computes a plan and changes nothing; POST /:id/merge applies one. `conflicts` are the clauses a person must settle and carry BOTH sides with no suggested answer, each under a stable `conflictId`; `autoResolved`, `newElements` and `removedElements` are the changes that need no decision, listed rather than hidden. Each `autoResolved` entry with resolution "auto_moved" carries a display-only `movedItself` flag: list or show as moved only the entries with `movedItself: true`. One with `movedItself: false` was renumbered only because a parent clause moved; the plan still carries it so the merge moves it with its parent, but it is not a move of its own, and `summary.moved` counts only the true ones. An "auto_fast_forwarded" entry carries `movedItself` too (true when the source also moved the clause it edited), and both kinds carry `previousSection`: the heading of the clause’s parent in this copy when the source moved it under another parent, else null. Both are display only. `planHash` names this plan and must be sent back to POST /:id/merge, which refuses a stale one. `baseRevision`, `fromRevision` and `toRevision` each carry their revision `code` beside the id, and `parent` carries `libraryName` and `home` ({type: "global"|"company"|"user"|"project", name}, name "SynC" for the SynC library; null when the reader may not be told who holds it) — name a revision by its code and a parent by where it lives, never by a database id. A conflict of type "identity_replaced" is the case where the parent corrected a clause at the same address where this copy has its own authored replacement: two different identities at one address, neither preferred. DATASHEET FIELDS merge too, matched on field identity: every entry carries `fields.theirs` / `fields.mine` (the fields on that clause on each side), and the plan's `fields` object lists `carried` (added or changed by the source only), `kept` (changed or added in this copy only), `dropped` (removed by the source, untouched here) and `conflicts` (each with a `conflictId` of the form "field:<identity>", settled "theirs" or "mine", no suggested side). A carried field lands with the source version of its clause; when that clause is a conflict its `clauseConflictId` names it, and keeping this copy's clause keeps this copy's fields. THE OUTLINE is merged three-way (whoever moved or reordered a clause wins): `outline.questions` are what a person must answer, each with a `questionId`, its `options` and the `default` it shows — kind "orphaned" (the source removed a heading that holds clauses only this copy has; asked once per outermost removed heading: keep_heading, move_to_previous under `target`, or remove), "place" (both sides moved a clause to different places), "order" (both reordered one heading's clauses) and "nesting" (each side nested one clause under the other). `outline.reports` are what the merge settled and only says: same_place (both added at one place, the source's first), placed_after, anchor_moved, removed_after_your_move and kept_removed_source_moved. Returns isCustomized false and empty lists for a standard that is not a customization. A `toRevisionId` that is not an eligible revision of the source (the set Change Revision offers) is 400; a caller who cannot read the source gets 404 "Standard not found". The source is read through the same project_id; a source that is itself a project's copy is read through its own project. With only project reach on the source, toRevisionId must be a revision that project uses, and omitted it defaults to that one rather than the source head.
Required permission: standard:view_revisions
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| toRevisionId | query | integer | Merge from THIS revision of the parent instead of the parent current one (optional). |
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
GET /api/standards/:id/field-value-countsFor a project's own copy of a standard: per datasheet field, how many of the project's datasheets hold a value and, for a choice field, which values they hold. Counts the datasheets built on this standard (at any revision) that the project's open draft lists, or with no open draft its latest published revision; archived and deleted datasheets and deferred fields are not counted, and only current values are, not history. Returns { projectId, datasheetCount, fields: [{ identity_uuid, valueCount, multiHeldCount, values?, valuesOmitted? }] }, fields keyed by field identity so a renamed field still matches. multiHeldCount is how many datasheets hold more than one choice. values ([{ value, count }], most held first, at most 50) and valuesOmitted (the distinct values not listed) are given only for choice fields (select, radio, checkbox, listbox); a checkbox or listbox value counts each of its choices. Use it before removing or renaming an option: a value that names an option the standard no longer offers becomes an option conflict when its datasheet is upgraded. A standard that is not a project copy returns projectId null and no fields. Needs the same permissions as saving the copy (standard:update and permission to edit the project's draft), and with no open draft also datasheet:read.
Required permission: standard:update
GET /api/standards/:id/upgrade-statusList the datasheets built on this standard that are out of sync with a given revision of it, with a conflict count each. The batch counterpart of GET /api/datasheet/:id/upgrade-status, and the read to run BEFORE POST /:id/batch-upgrade. `availableRevision` is the revision being measured against.
Required permission: standard:read
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | Limit to datasheets in one project (optional). With no toStandardRevisionId, the revision measured against is then the one the project's open draft uses, or, with no open draft, the one its latest published revision uses; never the newest. A reader who reaches the standard only through that project must name it, and is told about its datasheets only. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. |
| toStandardRevisionId | query | integer | Measure against THIS revision instead of the default (the revision the project holds when project_id is given, otherwise the standard's current one). A project's datasheets follow the revision the project holds, and an upgrade to any other is refused with 409; an earlier revision is a legitimate target once the project holds it. |
GET /api/standards/:id/comments/countsComment counts per element for a standard: exactly the comments GET /:id/comments lists for the same caller and project_id, so a count never shows what the list hides.
Required permission: standard:read
Optional permissions (unlock additional behaviour): project:read, library:update
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
GET /api/standards/:id/usageComment usage of a standard from your own library: the projects whose comments on it reached your firm. NOT the list of projects that hold it: a project that holds it but sent no comment back is not here (that list is GET /api/standards/:id/projects). For each project counted: the revisions that project issued it at (`holds`: [{standardRevisionId, revisionCode}]), how many copies the project made from it (`copies`), and how many comments came back (`comments`, and `commentsByElement` keyed by standard element id, a datasheet field comment counted under the clause the field sits on), plus `totals`: the comments GET /:id/comments lists as received. A project is counted only when its comments on this standard reached your firm (or you, for a personal library); a project whose comments did not reach you adds nothing, not even to a count. For the people who manage the library (library:update on it; its owner for a personal library): anyone else who can read the standard gets 403, and a reader through a project gets 404.
Required permission: standard:read
Optional permission (unlock additional behaviour): library:update
GET /api/standards/:id/projectsWhich of your projects hold this standard, and at which revision: for each project you may read that holds it (or its own copy of it), `draft` (what the open draft holds; null when you do not see the draft or it does not hold it) and `published` (what the newest published revision you may read that holds it holds, with project_revision_code, published_at, and latest_issue: false when a later issue dropped it). Each hold has project_revision_id, standard_id (a project copy has its own, with copy: true), standard_revision_id, revision_code, and behind (true when it is not the standard's current revision; null for a copy). The answer also names the current_revision_id and current_revision_code. Use it for "which projects are behind on X" before reading each project. Lists only projects you may read (an API key: its own grants, share-link and company gates), so it names nothing else; at most 200, then truncated: true. Any reader of the standard may ask; an API key or connected app needs project:read granted (else 403). A standard you read only through a project (another company's, held by a project you are on) needs project_id, as GET /:id does; the list is still every project of yours that holds it.
Required permission: standard:read
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
GET /api/standards/:id/comment-resolutionsList the available comment-resolution types (the vocabulary a resolution_id comes from). Site-wide reference data — the :id in the path is vestigial and no standard is read.
Required permission: standard:read
GET /api/standards/citation-searchFind a standard to cite by name, with the citation ready to write. Each result has cite_as (write it between [[ and ]]), cite_clause_as (add #<address> for one clause; null when no clause can be cited), name, category_name, revision_code, revision_date and source: library (the citing standard’s own), project (held by the project) or sync (SynC Standards). `place` says where the text is read: library, project or none (SynC Standards only).
Required permission: standard:read
| Name | In | Type | Description |
|---|---|---|---|
| q | query | string | Words of the name, in any order (at most 100 characters) |
| citing_standard_id | query | integer | The standard you are writing. Without it only SynC Standards are found. |
| project_id | query | integer | The project the text is read in (optional). A project’s own standard is always read in its project. |
| project_revision_id | query | integer | With project_id, the project revision (optional; default the open draft, else the newest you see) |
| limit | query | integer | Max results, 1-50 (default 20) |
POST /api/standards/resolve-referencesBatch-resolve `[[library/slug]]` wiki-style cross-references to the standards they point at. A reference that resolves to nothing comes back marked as such rather than omitted, which is how a dangling link is detected. Each resolution has a state, as on GET /:id; citedNotIncluded.fixed is its `fixed`. CLAUSE NUMBERS: `numbering` states the numbering once {numbering_applied ("1" is decimal), numbering_source, and project_revision_id in a project}; `standards` (by id) lists only the standards numbered differently, and only their rows carry address_label (the number as shown) beside the decimal address.
Required permission: standard:read
references — array of "library/slug" stringsproject_id — integer — the project the citations are read inproject_revision_id — integer — with project_id, the project revision you are reading: what it holds decides each state, and its numbering labels the clauses. Without it, the open draft if you can see it, else the newest revision you can. projectRevisionId is accepted as an older name for the same field.citing_standard_id — integer — the standard whose text carries the citations. A lib/ citation is read from it (its library, or the project revision you are reading) and is invalid without it. A citation of that standard itself comes back with selfCitation: true (cite a clause of the same standard with [[#…]] instead)project_revision_id without project_id is a 400, and so is sending both names with different values. A revision you cannot see, or a project you cannot read, counts as no project.
GET /api/standards/:id/library-errataEvery library-owner erratum on a company-library standard, active and withdrawn, each with issued_at, severity, recommended action, affected revisions and the owning firm; plus permissions.can_issue / can_withdraw for the caller.
Required permission: standard:read
Optional permission (unlock additional behaviour): project:read
| Name | In | Type | Description |
|---|---|---|---|
| project_id | query | integer | The project the standard is being read in (optional). A reader who reaches the standard only through a project must name it, or gets 404 "Standard not found"; through it they read only the revisions that project uses. Ignored for a standard in your own library. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
| projectRevisionId | query | integer | With project_id, read through that one project revision only (optional). Without project_id: 400. Over HTTP only: SynC's in-app assistant does not read this parameter, so sending it from the assistant changes nothing about the result. |
POST /api/standards/:id/library-errataIssue an erratum on a standard in your firm's library, as the library owner. Only a holder of library:errata:issue in the firm's own scope may issue — reach through site-wide roles does not count. The issue date is stamped by the server and cannot be changed afterwards.
Required permission: library:errata:issue
severity — 'minor' | 'major' | 'critical'description — string — what is wrongrecommended_action — 'use_corrected_revision' | 'discard_section' | 'await_correction' | 'consult_other_source' | 'clarification_only' | 'do_not_use' | 'verify_independently' | 'other'affected — array of { standard_revision_id: integer, element_address?: string }recommended_action_note — string — required when recommended_action is 'other'corrected_by_revision_id — integer — a published revision of the same standard that corrects itPOST /api/standards/:id/library-errata/:errataId/withdrawWithdraw a library-owner erratum. A state, never a delete: the record, its issue date and the reason stay readable to everyone who could read it.
Required permission: library:errata:withdraw
reason — stringPATCH /api/standards/:id/library-errata/:errataId/correctionLink (or clear, with null) the published revision of the same standard that corrects the erratum.
Required permission: library:errata:issue
corrected_by_revision_id — integer | nullPOST /api/standards/:id/batch-upgradeUpgrade many datasheets to a newer revision of this standard in one call, each with its own conflict resolutions. Gated on project:draft:edit, not a standard permission — it writes datasheet revisions into a project's draft. A target that retires the standard (a "(Superseded)" stub) is refused with 409 before any datasheet is touched.
Required permission: project:draft:edit
projectId — integer — the project whose draft the datasheets belong to. It scopes the project:draft:edit check, so it is required: missing or not an integer is a 400, and every datasheet in the batch must belong to ittoStandardRevisionId — integer — the standard revision to move todatasheetResolutions — object keyed by datasheet id: { [datasheetId]: { resolutions: [{ elementId, resolution, newValue? }, ...], summary } } — one resolutions entry per conflict in the upgrade-plan of that datasheet, keyed by the integer elementId (or address) shown for the conflict there, resolution being user_accepted | user_modified | user_discarded. An added field (conflictType new_element) left out takes its suggestedValue, or blank when it has none; every other conflict needs an entryRun GET /:id/upgrade-status first to learn which datasheets are behind and GET /api/datasheet/:id/upgrade-plan for each one's conflicts. Valid resolution values: user_accepted (keeps the recorded value — an accept with no newValue is safe, the current value is carried forward; send newValue only to accept a DIFFERENT value), user_modified (writes newValue — a user_modified with no newValue would clear the field and is rejected before it is proposed), user_discarded (drops the value deliberately). Resolve EVERY conflict in the plan and propose it: use the upgrade-plan suggestedValue when one is given, otherwise pick the option that best fits the datasheet as recorded and the standard text. For a definition_changed conflict the suggestedValue is the current value, which still meets the new rules: keep it. For options_replaced, the project deferred this field (per drawings, TBD or not applicable) and every choice has since been replaced: keep the deferral unless the user asks for a specific choice. A removed field may name likelySuccessor, the added field that may have replaced it under a new name, with a score and the old answer as `value` (null when it does not fit or the new field starts deferred); the added field names it back as likelyPredecessor. An option_invalid conflict may name likelyOption with likelyOptionScore. Both are guesses: suggestedValue never changes and nothing is carried unless you send it. Send a guess only when the user asked to carry old answers, as user_modified, and call it a guess in the summary; otherwise leave the field and name the guess. Never leave a conflict out. Before you send the upgrade, show the user each field with the value you chose and ask them to confirm in your conversation: nothing in SynC asks them before this change is made. Say in the summary which choices were your own reading rather than the plan suggestion. REQUIRES AN OPEN DRAFT: this change lands in the project's current unpublished draft. If the project has no open draft the call is rejected outright — check GET /api/projects/:id/revisions (a revision with is_draft true) and, if there is none, propose POST /api/projects/:id/draft/create first, then make this call. Opening a draft is its own user-approved change; never publish or revert a project to bring a draft into existence.
PUT /api/standards/:id/comments/:commentIdEdit a comment on a standard. CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
Required permission: standard:comment
CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
DELETE /api/standards/:id/comments/:commentIdDelete a comment on a standard. CLOSED — answers 410 Gone to every caller. The legacy comment plane (standard_user_comments) is write-closed: commenting on the standards/wiki side is being replaced by a threaded discussion system, and the project-scoped half moved to project_comments. Existing comments stay READABLE through the GET endpoints and are neither deleted nor migrated. Project correspondence — including a comment on a datasheet field, via anchorType 'datasheet_field' — is authored on POST /api/projects/:projectId/comments.
Required permission: standard:comment