> **Source:** https://knowledge.leegality.com/document-execution/api/list-completed-documents > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # GET /v3.0/document/completed — List completed documents Retrieves a paginated list of all completed documents from your Leegality account. Documents are returned in **ascending order** by completion date (oldest first). **Authentication:** `X-Auth-Token` header required on every request. ## Request URL ``` GET https://app1.leegality.com/api/v3.0/document/completed?max={max}&offset={offset}&name={name}&irn={irn}&startDate={startDate}&endDate={endDate} ``` **Environments:** - Production: `https://app1.leegality.com/api/v3.0/document/completed` - Sandbox: `https://sandbox.leegality.com/api/v3.0/document/completed` --- ## Parameters | Name | In | Required | Type | Description | Example | |------|----|----------|------|-------------|---------| | `max` | query | No | integer | Maximum number of documents to return per request. **Default:** `20` **Valid range:** `1` to `40` **Note:** If a value greater than `40` is passed, the API silently resets it to `20` (the default) instead of returning an error or capping at 40. | — | | `offset` | query | No | integer | Number of documents to skip before returning results. Used for pagination. **Default:** `0` **Example:** To get the second page of results with 20 per page, use `offset=20`. If `offset` exceeds the total number of documents, an empty `documents` array is returned with the correct `totalCount`. | — | | `name` | query | No | string | Filter documents by name using **pattern matching** (case-insensitive partial match). **Example:** `name=dummy` will match documents named `dummy PDF.pdf`, `My dummy document`, etc. The `totalCount` in the response reflects the filtered count. | — | | `irn` | query | No | string | Filter documents by Invoice Reference Number (IRN). This is an **exact match** filter — partial IRN values will not return results. **Example:** If a document has IRN `12222223`, searching for `irn=12222223` returns it, but `irn=12222` returns nothing. | — | | `startDate` | query | No | string | Filter documents completed on or after this date. **Format:** `dd-MM-yyyy` **Example:** `01-01-2026` Can be used alone (without `endDate`) to get all documents completed from this date onwards. **Note:** The filter is based on the document's completion date, not the creation date. An invalid format returns error code `validator.invalid`. | — | | `endDate` | query | No | string | Filter documents completed on or before this date. **Format:** `dd-MM-yyyy` **Example:** `28-02-2026` Can be used alone (without `startDate`) to get all documents completed up to this date. **Note:** The filter is based on the document's completion date, not the creation date. An invalid format returns error code `validator.invalid`. | — | --- ## Responses ### 200 — Default Response Response for the List Completed Documents API. | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `status` | integer | No | API response status. `1` = Success `0` = Failure (e.g., invalid date format) | `1` | | `data` | CompletedDocumentsData | No | Contains the paginated list of completed documents and the total count. See **CompletedDocumentsData** below. | — | | `messages` | array\ | No | Array of error/validation messages. Empty array on success. On validation failure (e.g., invalid date format), contains objects with `code` and `message` fields. See **Message** below. | — | #### CompletedDocumentsData Contains the paginated list of completed documents and the total count. | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `totalCount` | integer | No | Total number of completed documents matching the applied filters. This count reflects all matching documents, not just those in the current page. Use this with `max` and `offset` to implement pagination. | `130` | | `documents` | array\ | No | Array of completed document objects, sorted in **ascending order** by `completionDate` (oldest first). The number of items is limited by the `max` parameter (default 20, maximum 40). See **CompletedDocumentItem** below. | — | ##### CompletedDocumentItem A completed document summary object. | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `documentId` | string | No | The unique identifier for the document, generated by Leegality when the eSigning request was created. | `FR601AA019` | | `documentName` | string | No | The name of the document as specified when creating the eSigning request. > **Note:** This field is named `documentName` (not `name` as in the List Documents API). | `Template-VuMT` | | `irn` | string | No | Invoice Reference Number associated with the document. Returns `null` if no IRN was assigned. | `12222223` | | `completionDate` | string | No | The date and time when the document was completed (all signatures collected). **Format:** `yyyy-MM-dd HH:mm:ss.S` Documents are sorted by this field in ascending order. | `2024-01-02 11:20:04.0` | | `dateCreated` | string | No | The date and time when the eSigning request was created. **Format:** `yyyy-MM-dd HH:mm:ss.S` | `2024-01-02 11:17:36.0` | | `folderId` | string | No | The unique identifier of the folder containing this document. Returns `null` if the document is not in a folder. | `null` | | `folderName` | string | No | The name of the folder containing this document. Returns `null` if the document is not in a folder. | `null` | #### Message Message object containing a machine-readable code and a human-readable description. Used for success confirmations, errors, and warnings. | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Response message code. | `simpleWorkFlow.success` | | `message` | string | No | Human-readable success or error message. | `Invitations sent successfully.` | ### Sample Response (200) ```json { "status": 1, "data": { "totalCount": 130, "documents": [ { "documentId": "FR601AA019", "documentName": "Template-VuMT", "irn": "12222223", "completionDate": "2024-01-02 11:20:04.0", "dateCreated": "2024-01-02 11:17:36.0", "folderId": null, "folderName": null } ] }, "messages": [ { "code": "simpleWorkFlow.success", "message": "Invitations sent successfully." } ] } ```