Edit a document
edit_documentChanges what is on a draft's pages: its fields, signatures included, its text and its lines, and whether signers share one copy or each get their own (type). Fields a signer fills need the signers, which prepare_document adds. Each list holds changes: an item without id adds one, an item with id changes only what it sends, and an item with id and delete true removes it. Ids come from get_document (page gives one page's text and lines) and from the added list of earlier answers. Positions are shares of the page width and height, from the top left. Every text on a page, the PDF's own included, can be moved, changed or deleted by its id. New text goes where it is placed, even over other text: the answer's notes name any text that overlaps other text, and the added list gives where each new text ends. A field goes on a line by the line's id, beside text on the page, at page, x and y, or in a free spot at the bottom of the last page. A field that does not sit on a line gets a line drawn under it, except a checkbox, and moving or deleting the field moves or deletes that line. With more than one signer, fields are placed once type is set: on a shared copy each field a signer fills names its signer by email, and when each gets their own copy no field names a signer. A detail Docflare fills in is a variable inside text. These are the only variables: {document.name}, {sender.name}, {sender.email}, {document.sent_date}, and a recipient's full_name, first_name, last_name, email, phone, company, job_title, street_address, city, postal_code, state_region, country, written {recipient1.full_name} with the signer's number from the preview on a shared copy, and {recipient.full_name} when each signer gets their own copy or there is one signer. get_document and every preview list the variables this document can use now, with what each shows (one value per signer, in order, when each gets their own copy); a variable left out has no value yet and would print nothing. Any other {name.name} is refused; the date a signer signs is a date field. On a document the user signs themselves (signed_by_sender), every field is the user's and takes its value now, saved for a signature or initials, which applies the user's saved one; no field names a signer, and the text uses no recipient variables. Variable fields from before become such text, except the reference, completed date and signed date, which stay fields. Nothing is sent. The answer is the same preview, preview_url and review_token as prepare_document gives.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "edit_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document id. | |
| type | No | With more than one signer, the user's choice: shared when they all sign one copy (each field a signer fills belongs to one of them), individual when each signer gets their own copy of the same fields and CCs get every copy. Kept for later calls. | |
| lines | No | Lines to add, change or delete. | |
| texts | No | Text to add, change or delete. | |
| fields | No | Fields to add, change or delete. |