# List Documents

> Perform List Documents through Medsender.

Source: [https://genhealth.ai/docs/workflows/integrations/medsender/medsender_list_documents](https://genhealth.ai/docs/workflows/integrations/medsender/medsender_list_documents)

Integration: [Medsender](https://genhealth.ai/docs/workflows/integrations/medsender.md)

- Handler: `medsender_list_documents`

- Connection type: `medsender`

## Use in a workflow

Copy this discovered node config, fill params from the input contract, and validate the complete graph. Integration results are available as {{node_id.default.field}}. Check business success before dependent writes; completion alone does not prove business success.

```json

{
  "_group": "Medsender",
  "params": {
    "page": 1,
    "sort_dir": "desc",
    "max_pages": 20,
    "fetch_all_pages": true
  },
  "handler": "medsender_list_documents"
}

```

[Action contracts](https://genhealth.ai/docs/workflows/action-contracts.md) · [Run recovery](https://genhealth.ai/docs/workflows/operations.md)

## Inputs

- `fetch_all_pages` — Fetch All Pages (boolean)
  Optional true-or-false value.
  Default: `true`
- `page` — Page (number)
  Optional numeric value.
  Default: `1`
- `max_pages` — Max Pages (number)
  Optional numeric value.
  Default: `20`
- `page_size` — Page Size (number)
  Optional numeric value.
- `sort_dir` — Sort Dir (select)
  Optional selected identifier or value.
  Default: `"desc"`
  Options: Newest First ("desc"), Oldest First ("asc")

## Outputs

- `success` — Success
- `documents` — Documents
- `count` — Count
- `page` — Page
- `per_page` — Per Page
- `has_more` — Has More
- `pages_fetched` — Pages Fetched
- `scanned` — Scanned
- `error` — Error

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `read`
- Confirmation recommended: no
- Retry safe: yes
- Dry run supported: no

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "page": {
      "type": "number",
      "default": 1,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "sort_dir": {
      "enum": [
        "desc",
        "asc"
      ],
      "type": "string",
      "default": "desc",
      "description": "Optional selected identifier or value.",
      "x-workflow-field-type": "select"
    },
    "max_pages": {
      "type": "number",
      "default": 20,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "page_size": {
      "type": "number",
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "fetch_all_pages": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "page": {},
    "count": {},
    "error": {},
    "scanned": {},
    "success": {},
    "has_more": {},
    "per_page": {},
    "documents": {},
    "pages_fetched": {}
  },
  "additionalProperties": true
}
```
