> **Source:** https://knowledge.leegality.com/document-execution/api/search-packs > **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 /v4/packs/search — Search packs :::info[Sandbox endpoint] **Authentication:** `X-Auth-Token` header required on every request. ## Request URL ``` GET https://app1.leegality.com/api/v4/packs/search?q=Home Loan&status=SENT&workflowId=049152d5-d719-495b-b0c4-9bbd1f827412&irn=IRN-2026-001234&max=20&offset=0&sortBy=createdAt&sortOrder=desc ``` **Environments:** - Production: `https://app1.leegality.com/api/v4/packs/search` - Sandbox: `https://sandbox.leegality.com/api/v4/packs/search` --- ## Parameters | Name | In | Required | Type | Description | Example | |------|----|----------|------|-------------|---------| | `q` | query | No | string | Free-text search across packs. | `Home Loan` | | `status` | query | No | string | Filter by pack status. | `SENT` | | `workflowId` | query | No | string | Filter by the workflow the packs were created from (workflow ID). An unknown value simply returns no records. | `049152d5-d719-495b-b0c4-9bbd1f827412` | | `irn` | query | No | string | Exact match on the pack's IRN (does not search document IRNs). | `IRN-2026-001234` | | `max` | query | No | integer | Page size. Default `20`, minimum `1`, maximum `40`. | `20` | | `offset` | query | No | integer | Number of results to skip (pagination). Default `0`. `offset` + `max` cannot exceed 1,000 unless a `status` filter is set. | `0` | | `sortBy` | query | No | string | Field to sort by. | `createdAt` | | `sortOrder` | query | No | string | Sort direction. Default `desc`. | `desc` | --- ## Responses ### 200 — A page of packs matching the search — the records for this page plus pagination totals. | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `data` | object | No | See **data** below. | — | | `pagination` | object | No | Paging information for the result set. See **pagination** below. | — | #### data | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `records` | array\ | No | The page of matching packs. See **records** below. | — | ##### records | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `packId` | string | No | Pack identifier (ULID). | `01KZ8JV4Z7T3EZWMXGF3RNAYR5` | | `packName` | string | No | Display name of the pack. | `Pack Test` | | `irn` | string | No | Your Internal Reference Number for the pack, or `null` if not set. | `packirn` | | `workflowId` | string | No | ID of the workflow the pack was created from, or `null`. | `a6295beb-650f-4dc0-81b4-df8e8faf2b7e` | | `workflowRunContextId` | string | No | ID of the workflow run that produced this pack. Use it with **Check request status** and **Check Pack Details**. | `8babd0af-a418-486e-b1cd-eb717fe97c35` | | `status` | string | No | Current status of the pack. | `SENT` | | `documentCount` | integer | No | Number of documents in the pack. | `1` | | `createdAt` | string | No | When the pack was created (ISO 8601). | `2026-08-05T09:07:33Z` | | `updatedAt` | string | No | When the pack was last updated (ISO 8601). | `2026-08-05T09:09:07Z` | #### pagination Paging information for the result set. | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `pageNumber` | integer | No | Current page number (1-based). | `1` | | `pageSize` | integer | No | Number of records per page (matches `max`). | `3` | | `totalRecords` | integer | No | Total number of packs matching the query. | `96` | | `totalPages` | integer | No | Total number of pages available. | `32` | ### 400 — The request was rejected. Possible errors: - `LE_ERR_AP_007` — `max` must be >= 1 - `LE_ERR_AP_066` — `max` must be <= 40 - `LE_ERR_AP_061` — invalid query parameter (for example, a non-integer `max` or `offset`) - `LE_ERR_AP_067` — `offset` must be a non-negative integer - `LE_ERR_AP_011` — `offset` + `max` cannot exceed 1,000 without a `status` filter - `LE_ERR_AP_009` — `sortBy` must be one of: `createdAt`, `updatedAt` - `LE_ERR_AP_010` — `sortOrder` must be `asc` or `desc` - `LE_ERR_AP_013` — `status` must be one of: `DRAFT`, `SENT`, `EXPIRED`, `COMPLETED` | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code (matches the first entry in `errors`). | `LE_ERR_AP_007` | | `traceId` | string | No | Trace identifier for the request, or `null`. | `null` | | `errors` | array\ | No | One or more errors describing why the request failed. See **errors** below. | — | #### errors | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Human-readable error message. | `max must be >= 1` | | `path` | string | No | Request path that produced the error. | `/api/v4/packs/search` | | `code` | string | No | Error code. | `LE_ERR_AP_007` | ### 401 — Authentication failed. - `LE_ERR_AP_080` — missing or invalid authentication token | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code (matches the first entry in `errors`). | `LE_ERR_AP_007` | | `traceId` | string | No | Trace identifier for the request, or `null`. | `null` | | `errors` | array\ | No | One or more errors describing why the request failed. See **errors** below. | — | #### errors | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Human-readable error message. | `max must be >= 1` | | `path` | string | No | Request path that produced the error. | `/api/v4/packs/search` | | `code` | string | No | Error code. | `LE_ERR_AP_007` | ### Sample Response (200) ```json { "data": { "records": [ { "packId": "01KZ8JV4Z7T3EZWMXGF3RNAYR5", "packName": "Pack Test", "irn": "packirn", "workflowId": "a6295beb-650f-4dc0-81b4-df8e8faf2b7e", "workflowRunContextId": "8babd0af-a418-486e-b1cd-eb717fe97c35", "status": "SENT", "documentCount": 1, "createdAt": "2026-08-05T09:07:33Z", "updatedAt": "2026-08-05T09:09:07Z" } ] }, "pagination": { "pageNumber": 1, "pageSize": 3, "totalRecords": 96, "totalPages": 32 } } ```