/api/libraries
Standard libraries group related standards. Each library is scoped to a subject (global, company, or project).
GET /api/librariesList standard libraries accessible to you. Filterable by owning scope.
Required permission: library:read
| Name | In | Type | Description |
|---|---|---|---|
| subject_type | query | string | Owning scope: 'global' | 'company' | 'project' | 'user'. Pair with subject_id for the last three. |
| subject_id | query | integer | The id of that scope — the PROJECT id when subject_type is "project", the COMPANY id when it is "company". Sending it without subject_type does not scope anything. |
GET /api/libraries/:idGet a library by ID with its standard count.
Required permission: library:read
POST /api/librariesCreate a new standard library.
Required permission: library:create
name — stringsubject_type — stringdescription — stringsubject_id — integersubject_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 library in someone else's scope.
PUT /api/libraries/:idUpdate a library name or description.
Required permission: library:update
name — stringdescription — string — REPLACES the stored description wholesale; it never appends. To add, mention, append, or include something while keeping what is already there, first read the current value (GET /api/libraries/:id) and send the existing text WITH your addition merged into it. Sending only the new sentence deletes everything the description previously said.GET /api/libraries/:id/parametersThe library parameter register: every project-parameter name this library knows, its description, and the standards whose current published revision asserts it (via [[parameter: …]] in clause prose or in a derived datasheet field's basis). Names with no description yet are INCLUDED — an undescribed name is the register's main subject, not an omission — as are descriptions no standard asserts any more, which are retained rather than deleted. Use this to find the right existing name before authoring a new [[parameter: …]] marker. It reports nothing about what any project answered.
Required permission: library:read
PATCH /api/libraries/:id/parameters/:nameWrite a parameter's DESCRIPTION in this library. The description is the only editable field. A parameter's NAME is derived from the standards that assert it and cannot be changed here: sending a "name" field is rejected with a 400, and there is no merge, alias or delete operation. To rename or unify two parameters, edit the [[parameter: …]] markers in the asserting standards and publish a new revision — that is the only repair path, and proposing a merge instead will not work. The name must already exist in the library (it has an entry, or a published standard asserts it); this endpoint cannot mint one.
Required permission: library:update
| Name | In | Type | Description |
|---|---|---|---|
| name | path | string | The parameter name, URL-encoded. Matched case-insensitively with whitespace collapsed, the same way the scanner normalises it — "Site Ambient" and "site ambient" address the same entry. |
description — stringdescription REPLACES the stored text — read the register first (GET /api/libraries/:id/parameters) if you mean to amend rather than overwrite. Send null to clear it. Do NOT send a "name" field: names are derived from the asserting standards and a rename attempt is rejected outright.
DELETE /api/libraries/:idPERMANENTLY delete a library AND every standard filed in it (hard delete, cascading to those standards revisions and elements). There is no undo and no archive. If the intent is only to change the library's name or description, use PUT /api/libraries/:id instead — renaming a library to something like "(deleted)" is never a substitute for deleting it.
Required permission: library:delete
confirmName — stringconfirmName is REQUIRED whenever the library still contains at least one standard, and must match the library's name EXACTLY (character for character) — any other value is rejected with a 400 naming the count of standards that would be destroyed. Read the library first (GET /api/libraries/:id) to get its exact name and standard count, and tell the user how many standards will be destroyed before proposing this. An empty library needs no confirmName.