{
  "openapi": "3.1.0",
  "info": {
    "title": "LimeSign API",
    "version": "v1",
    "description": "Create, populate, and send e-signature envelopes. Authenticate every request with an API key as a Bearer token (`Authorization: Bearer lsk_live_…`). All bodies are JSON unless noted. Errors return `{ \"error\": \"…\" }` with a 4xx status."
  },
  "servers": [
    {
      "url": "https://api-dev.lime-sign.com",
      "description": "Development"
    },
    {
      "url": "https://api.lime-sign.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Envelopes"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Fields"
    },
    {
      "name": "Signers"
    },
    {
      "name": "Accounts"
    }
  ],
  "paths": {
    "/v1/envelopes": {
      "post": {
        "tags": [
          "Envelopes"
        ],
        "summary": "Create an envelope",
        "description": "Creates a draft envelope with its recipients. Add documents and fields, then send.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "signers"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "example": "Consulting agreement"
                  },
                  "accountId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Optional branding account."
                  },
                  "signers": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "email"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "example": "Jordan Rivera"
                        },
                        "email": {
                          "type": "string",
                          "format": "email",
                          "example": "jordan@acme.com"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "signer",
                            "cc",
                            "viewer",
                            "approver"
                          ],
                          "default": "signer"
                        },
                        "signingOrder": {
                          "type": "integer",
                          "example": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Envelopes"
        ],
        "summary": "List envelopes",
        "description": "Your organization's envelopes, newest first. List items omit `signers` — fetch a single envelope for its recipients.",
        "responses": {
          "200": {
            "description": "Envelopes.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Envelope"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}": {
      "get": {
        "tags": [
          "Envelopes"
        ],
        "summary": "Get an envelope",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "responses": {
          "200": {
            "description": "The envelope (with signers).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/documents": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Upload a document",
        "description": "Send the raw PDF bytes with `Content-Type: application/pdf`. Set the file name with the optional `X-Document-Name` header. 25 MB max.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          },
          {
            "name": "X-Document-Name",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "agreement.pdf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created document.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "description": "Not a valid PDF, empty, or too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "List documents",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "responses": {
          "200": {
            "description": "Documents on the envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/documents/{docId}/content": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "Download the original PDF",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          },
          {
            "name": "docId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Document id."
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF bytes.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Document not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/documents/{docId}/sealed": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "Download the signed (sealed) PDF",
        "description": "Available only after the envelope is completed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          },
          {
            "name": "docId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Document id."
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF bytes.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Sealed document not available yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/certificate": {
      "get": {
        "tags": [
          "Envelopes"
        ],
        "summary": "Download the Certificate of Completion",
        "description": "Available only after the envelope is completed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF bytes.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Certificate not available yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/fields": {
      "post": {
        "tags": [
          "Fields"
        ],
        "summary": "Place fields",
        "description": "Position signature/date/text fields on a document for a signer. Coordinates are page-ratios in [0,1].",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fields"
                ],
                "properties": {
                  "fields": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "signerId",
                        "documentId",
                        "page",
                        "x",
                        "y",
                        "w",
                        "h"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "signature",
                            "initial",
                            "date",
                            "date_signed",
                            "text",
                            "checkbox",
                            "dropdown",
                            "email",
                            "phone",
                            "address",
                            "ssn",
                            "business_entity",
                            "ein",
                            "bank_account_owner",
                            "business_bank_account_owner",
                            "bank_routing_number",
                            "bank_account_number"
                          ]
                        },
                        "signerId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "documentId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "page": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "x": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "y": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "w": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "h": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        "required": {
                          "type": "boolean",
                          "default": true
                        },
                        "config": {
                          "type": "object",
                          "description": "Placement options. `certified` applies only to signature fields and `options` only to dropdown fields; `label` renames any field for the signer.",
                          "properties": {
                            "certified": {
                              "type": "boolean",
                              "description": "Signature fields: stamp a certified perimeter (timestamp, IP, verification id)."
                            },
                            "options": {
                              "type": "array",
                              "maxItems": 40,
                              "items": {
                                "type": "string",
                                "maxLength": 80
                              },
                              "description": "Dropdown fields: the choices this field offers the signer.",
                              "example": [
                                "Yes",
                                "No"
                              ]
                            },
                            "label": {
                              "type": "string",
                              "maxLength": 60,
                              "description": "Overrides the field type's name above the control.",
                              "example": "Spouse's SSN"
                            },
                            "group": {
                              "type": "object",
                              "description": "Checkbox fields: boxes sharing a group name are answered together, with `min`/`max` deciding how many may be ticked (min 1 / max 1 is 'pick exactly one'). A grouped checkbox is never individually required — the rule decides. The rule is clamped to the group's real size.",
                              "required": [
                                "name"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "maxLength": 60,
                                  "example": "Delivery method"
                                },
                                "min": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "default": 0,
                                  "example": 1
                                },
                                "max": {
                                  "type": [
                                    "integer",
                                    "null"
                                  ],
                                  "minimum": 0,
                                  "default": null,
                                  "description": "No limit when null.",
                                  "example": 1
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created fields.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Field"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error, or a signer/document not on this envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Fields"
        ],
        "summary": "List fields",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "responses": {
          "200": {
            "description": "Fields on the envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Field"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/send": {
      "post": {
        "tags": [
          "Envelopes"
        ],
        "summary": "Send an envelope",
        "description": "Flips the draft to sent and notifies the first signing group. Requires at least one signer and every signer to have a field. The response lists every non-CC recipient; those notified now carry a `signingUrl` you can deliver over your own channel (e.g. SMS). Later signing groups have `signingUrl: null` until they become active — fetch theirs with the issue-link endpoint.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "sent"
                    },
                    "notified": {
                      "type": "integer",
                      "description": "Signers notified in the first group.",
                      "example": 1
                    },
                    "signers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SignerLink"
                      },
                      "description": "Every non-CC recipient, each with a signingUrl where one was issued now."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not sendable (no signer, missing fields, already sent).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/signers": {
      "get": {
        "tags": [
          "Signers"
        ],
        "summary": "List recipients",
        "description": "Every recipient on the envelope and their status, in signing order. No signing links (issue one with the endpoint below).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          }
        ],
        "responses": {
          "200": {
            "description": "Recipients.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Signer"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Envelope not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/envelopes/{id}/signers/{signerId}/link": {
      "post": {
        "tags": [
          "Signers"
        ],
        "summary": "Issue a signing link",
        "description": "Mint a fresh signing link for one recipient — to deliver over your own channel (SMS, chat) or replace one they lost. Issuing rotates: the recipient's previous link stops working. Valid only while the envelope is sent or in progress and the recipient can still sign; CC/viewer recipients have no signing link.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Envelope id."
          },
          {
            "name": "signerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Signer id."
          }
        ],
        "responses": {
          "200": {
            "description": "A fresh signing link.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignerLink"
                }
              }
            }
          },
          "400": {
            "description": "Recipient does not sign (e.g. a CC).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Envelope or signer not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Envelope not active, or the signer already finished.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Create an account",
        "description": "Create a sending/branding account. Envelopes reference one via `accountId`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountWrite"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List accounts",
        "description": "Your organization's sending accounts, the default first.",
        "responses": {
          "200": {
            "description": "Accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Get an account",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Account id."
          }
        ],
        "responses": {
          "200": {
            "description": "The account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Accounts"
        ],
        "summary": "Update an account",
        "description": "Partial update — only the fields you send change.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Account id."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "summary": "Delete an account",
        "description": "Envelopes that used it fall back to the org default. The default account can't be deleted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Account id."
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "404": {
            "description": "Account not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The default account can't be deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your API key, e.g. `lsk_live_…`. Create one in the dashboard under Settings → Developer."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "example": "envelope not found"
          }
        }
      },
      "Signer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "Jordan Rivera"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "jordan@acme.com"
          },
          "role": {
            "type": "string",
            "enum": [
              "signer",
              "cc",
              "viewer",
              "approver"
            ],
            "description": "signer signs; cc receives the finished copy; viewer must open; approver must approve."
          },
          "signingOrder": {
            "type": "integer",
            "example": 1,
            "description": "Same number = parallel; different = sequential."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "notified",
              "signed",
              "declined",
              "voided"
            ]
          },
          "signedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SignerLink": {
        "type": "object",
        "description": "A recipient plus their live signing link. The link is a bearer capability — anyone holding it can open the signing session — so treat it as a secret. It is returned only when issued (at send, or from the issue-link endpoint) and cannot be fetched later; issue a fresh one to replace it.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "Jordan Rivera"
          },
          "email": {
            "type": "string",
            "format": "email",
            "example": "jordan@acme.com"
          },
          "role": {
            "type": "string",
            "enum": [
              "signer",
              "cc",
              "viewer",
              "approver"
            ],
            "description": "signer signs; cc receives the finished copy; viewer must open; approver must approve."
          },
          "signingOrder": {
            "type": "integer",
            "example": 1,
            "description": "Same number = parallel; different = sequential."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "notified",
              "signed",
              "declined",
              "voided"
            ]
          },
          "signedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "channel": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "both"
            ],
            "description": "How LimeSign notifies this recipient."
          },
          "signingUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "The recipient's signing link, or null when none is live yet — e.g. a later signing group, or an SMS recipient who hasn't opted in.",
            "example": "https://sign.lime-sign.com/sign/xY3f…"
          }
        }
      },
      "Envelope": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "example": "Consulting agreement"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "in_progress",
              "completed",
              "declined",
              "voided",
              "expired"
            ]
          },
          "accountId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Branding/sending account, or null for the org default."
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "signers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Signer"
            }
          }
        }
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "agreement.pdf"
          },
          "contentType": {
            "type": "string",
            "example": "application/pdf"
          },
          "sizeBytes": {
            "type": "integer",
            "example": 48213
          },
          "pageCount": {
            "type": "integer",
            "example": 3
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Field": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "signature",
              "initial",
              "date",
              "date_signed",
              "text",
              "checkbox",
              "dropdown",
              "email",
              "phone",
              "address",
              "ssn",
              "business_entity",
              "ein",
              "bank_account_owner",
              "business_bank_account_owner",
              "bank_routing_number",
              "bank_account_number"
            ]
          },
          "signerId": {
            "type": "string",
            "format": "uuid"
          },
          "documentId": {
            "type": "string",
            "format": "uuid"
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "example": 1
          },
          "x": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Page-ratio (0..1) from the left."
          },
          "y": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Page-ratio (0..1) from the top."
          },
          "w": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "h": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "required": {
            "type": "boolean"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "example": "Acme Legal"
          },
          "isDefault": {
            "type": "boolean",
            "description": "The org's fallback account. Can't be deleted."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "senderName": {
            "type": [
              "string",
              "null"
            ],
            "example": "Acme Legal"
          },
          "replyTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "primaryColor": {
            "type": [
              "string",
              "null"
            ],
            "example": "#b7f13a",
            "description": "Accent color (hex)."
          },
          "emailSubject": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invite subject template. Vars: {signerName} {envelopeTitle} {senderName} {accountName} {link}."
          },
          "emailBody": {
            "type": [
              "string",
              "null"
            ],
            "description": "Invite body template (same vars)."
          },
          "redirectUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Where signers land after completing."
          },
          "notifyCompletion": {
            "type": "boolean",
            "description": "Send signers the completion email."
          },
          "notifyVoided": {
            "type": "boolean",
            "description": "Notify engaged signers when an envelope is voided."
          },
          "hasLogo": {
            "type": "boolean",
            "description": "Whether a brand logo is set (upload it in the dashboard)."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountWrite": {
        "type": "object",
        "description": "Account branding fields. On create, `name` is required; on update (PATCH) every field is optional and only the ones you send change.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "example": "Acme Legal"
          },
          "senderName": {
            "type": [
              "string",
              "null"
            ]
          },
          "replyTo": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "primaryColor": {
            "type": [
              "string",
              "null"
            ],
            "example": "#b7f13a"
          },
          "emailSubject": {
            "type": [
              "string",
              "null"
            ]
          },
          "emailBody": {
            "type": [
              "string",
              "null"
            ]
          },
          "redirectUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "notifyCompletion": {
            "type": "boolean",
            "default": true
          },
          "notifyVoided": {
            "type": "boolean",
            "default": true
          }
        }
      }
    }
  }
}
