Upload the base document as a transient document using POST /transientDocuments; note the transientDocumentId
Create the library document with POST /api/rest/v6/libraryDocuments passing fileInfos (with transientDocumentId), name, state (ACTIVE), templateTypes (DOCUMENT for a reusable full document, or FORM_FIELD_LAYER for a field-only layer), and sharingMode (USER, GROUP, or ACCOUNT) to control visibility
Capture the libraryDocumentId from the response; this ID is used to reference the template when creating agreements
Create an agreement from the library document by including a libraryDocumentId entry in the fileInfos array of your POST /agreements request instead of a transientDocumentId
Manage the library document lifecycle with GET /libraryDocuments to list all templates, and PUT /libraryDocuments/{libraryDocumentId}/state to archive or reactivate a template
Known gotchas
FORM_FIELD_LAYER templates store only the field positions without the underlying document; they must be combined with a separate document at agreement creation time, and the documents must have identical page dimensions for field placement to be accurate
sharingMode ACCOUNT makes the template available to all users in the account; set it to GROUP or USER for templates that contain sensitive structural information not appropriate for the entire organization
Library documents count toward account storage limits; archive outdated templates to keep the account tidy and avoid confusion during template selection
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp