/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. Gated on STANDARD authoring in the library's scope, not on editing the library: whoever may write the [[parameter: …]] marker may say what it means.
Required permission: standard: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/:idDelete an EMPTY library. It does NOT delete the standards filed in it, and it refuses with 409 while it still holds any — move them to another library (PUT /api/standards/:id) or delete them one at a time (DELETE /api/standards/:id), then delete the library. Deleting a container must never destroy its contents, so there is no confirm-and-take-everything option. 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
No body. The library must be empty: a 409 names how many standards it still holds and gives one by name, so read that message back to the user rather than guessing. GET /api/libraries/:id reports standard_count up front if you want to check before calling. This endpoint never deletes a standard, so it can never remove one that a published project revision serves.