# Update contract state and appearance Update the contract's state values and appearance using JSON Patch (RFC 6902) operations. The available operations depend on the path, as does the value. See more detailed description and examples here. Endpoint: PATCH /api/builder/sessions/{session_id}/contract Version: 0.1.0 Security: APIKey ## Path parameters: - `session_id` (string, required) The UUID of the session Example: "7f3f5f62-2c69-7d4e-8a3d-9c0f0e2c5f3a" ## Header parameters: - `X-Participant` (string, required) The participant ID for the builder session. This header is required for updating the contract state. Example: "123e4567-e89b-12d3-a456-426614174000" ## Request fields (application/json): - `operations` (array) - `operations.op` (string) Enum: "replace", "remove", "add" - `operations.path` (string) Example: "/document_name" - `operations.value` (any) Example: "My document" ## Response 200 fields (application/json): - `data` (object) - `data.state` (object) Contract current state - `data.state.id` (string) - `data.state.status` (string) If document is finalized, it cannot be edited. Enum: "draft", "finalized" - `data.state.document_name` (string) Name of the document. End-users can edit this. This is not visible on the document itself. - `data.state.jurisdiction` (string) Jurisdiction of the agreement. Example: "FI" - `data.state.languages` (array) Languages in which the document is drafted. It usually contains just one. Example: ["en-GB"] - `data.state.value` (object) Values filled in to the form. The schema varies in every template. See [this](/embeddable-builder-api#update-document-field-values) for more information. - `data.state.sections` (array) List of sections included in the document. It contains templates and custom sections added by end-users. The sections are presented in the same order as they appear in the document. - `data.state.appearance` (object) - `data.state.appearance.logo` (object) - `data.state.appearance.logo.enabled` (boolean) - `data.state.appearance.logo.content` (string,null) Data URI with base64 encoded JPG,PNG or SVG image. - `data.state.appearance.logo.scale` (number) Size of the logo, scale 20-100 where 20 is the smallest and 100 is the largest. Example: 50 - `data.state.appearance.footer` (object) - `data.state.appearance.footer.content` (string) - `data.state.appearance.heading1` (object) - `data.state.appearance.heading1.family` (string) Example: "arial" - `data.state.appearance.heading1.color` (string) Example: "#000000" - `data.state.appearance.heading1.size` (string) Example: "20" - `data.state.appearance.heading1.weight` (string) Example: "bold" - `data.state.appearance.heading1.alignment` (string) Example: "left" - `data.state.appearance.heading1.transform` (string) Example: "none" - `data.state.appearance.heading2` (object) - `data.state.appearance.heading3` (object) - `data.state.appearance.heading4` (object) - `data.state.appearance.heading5` (object) - `data.state.appearance.heading6` (object) - `data.state.appearance.paragraph` (object) - `data.state.appearance.table` (object) - `data.state.appearance.table.bgColor` (string) Example: "#ffffff" - `data.state.appearance.table.headerBgColor` (string) Example: "#e7e5e4" - `data.state.appearance.table.headerColor` (string) Example: "#000000" - `data.state.appearance.table.borderColorEnabled` (boolean) Example: true - `data.state.appearance.table.borderColor` (string) Example: "#ffffff" - `data.state.appearance.table.alternatingRowBgColorEnabled` (boolean) Example: true - `data.state.appearance.table.alternatingRowBgColor` (string) Example: "#fafaf9" - `data.signees` (array) List of signees found from the document. - `data.signees._type` (string) - `data.signees.id` (string, required) Unique ID for the signature. - `data.signees.first_name` (string, required) - `data.signees.last_name` (string, required) - `data.signees.job_title` (string) - `data.signees.company_name` (string) - `data.signees.fieldset_name` (string, required) Name of the fieldset from which this signee originates. - `data.signees.page` (integer, required) Number of the page where the signature area of this signee is located. It is 1-based. - `data.signees.x` (number, required) X position of the signature area's location. The value is % of the page's width. For e.g. 0.10 means it is 10% of the page width. Example: 0.1 - `data.signees.y` (number, required) Y position of the signature area's location. The value is % of the page's height. For e.g. 0.10 means it is 10% of the page height. Example: 0.1 - `data.signees.width` (number, required) Width of the signature area. The value is % of the page's width. For e.g. 0.10 means it is 10% of the page width. Example: 0.1 - `data.signees.height` (number, required) Height of the signature area. The value is % of the page's height. For e.g. 0.10 means it is 10% of the page height. Example: 0.1