---
title: "List egress templates for a tenant"
method: GET
path: "/api/v1/egress-templates"
tags: ["EgressTemplate"]
---

# List egress templates for a tenant

`GET /api/v1/egress-templates`

Returns a page of egress templates scoped to the tenant identified by the required `tenant-id` header. Use this to browse, filter, or search for a template before fetching a single record with `GET /api/v1/egress-templates/{templateId}`.

Preconditions: `tenant-id` header must be present and non-blank; omitting it returns 400.

Filtering: supply `status` and/or `entityType` to narrow results; both filters are combined with AND. `status` accepts `active`, `inactive`, or `draft`; when omitted, only `active` and `draft` templates are returned — soft-deleted (`inactive`) templates are hidden by default and must be requested explicitly via `status=inactive`. `entityType` accepts `practitioner`, `facility`, or `group`; when omitted, all entity types are returned. `search` performs a case-insensitive substring match on `templateName`. An unrecognised `status` or `entityType` value returns 400.

Pagination: page-based. `page` is the zero-based page number and defaults to 0 when omitted or negative. `size` is the page size and defaults to 25 when omitted or non-positive; there is no enforced upper bound on `size`.

Returns: a page of egress template objects for the tenant, plus `total`, `page`, `size`, and `hasMore` for pagination. Returns an empty `templates` array (not 404) when no templates match. This operation is read-only with no side effects.

## Query parameters

- `createdBy` string
- `entityType` string
- `page` integer
- `scheduleEnabled` boolean
- `search` string
- `size` integer
- `status` string

## Headers

- `tenant-id` string
- `x-user-id` string

## Response `200`

A page of egress templates matching the tenant, filters, and search term, with pagination metadata

- EgressTemplateListResponse
  - `templates` EgressTemplateResponse[] — Egress templates on this page, in DAL-returned order. Empty (not null) when no templates match the filters.
    - `id` string — Server-assigned unique identifier of the template.
    - `tenantId` string — ID of the tenant that owns this template.
    - `createdAt` string, date-time
    - `createdBy` string — ID of the user who created the template.
    - `updatedAt` string, date-time
    - `updatedBy` string — ID of the user who last updated the template.
    - `templateName` string — Human-readable template name.
    - `description` string — Free-text description of the template's purpose.
    - `entityType` string — Entity type this template maps: `practitioner`, `facility`, or `group`. Immutable after creation.
    - `outputFormat` string — Output file format produced by exports run from this template, e.g. `csv`.
    - `separator` string — Delimiter used in the output CSV.
    - `status` string — Template lifecycle status: `draft`, `active`, or `inactive` (soft-deleted).
    - `version` integer — Version number, incremented on each successful update. Not incremented by delete.
    - `mappingsCsvUrl` string — GCS URL of the current mapping CSV for this template version.
    - `rowExpansionKeys` JsonNode
      - `empty` boolean
      - `valueNode` boolean
      - `containerNode` boolean
      - `missingNode` boolean
      - `array` boolean
      - `object` boolean
      - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
      - `pojo` boolean
      - `number` boolean
      - `integralNumber` boolean
      - `floatingPointNumber` boolean
      - `short` boolean
      - `int` boolean
      - `long` boolean
      - `float` boolean
      - `double` boolean
      - `bigDecimal` boolean
      - `bigInteger` boolean
      - `textual` boolean
      - `boolean` boolean
      - `null` boolean
      - `binary` boolean
    - `extExportConfig` JsonNode
      - `empty` boolean
      - `valueNode` boolean
      - `containerNode` boolean
      - `missingNode` boolean
      - `array` boolean
      - `object` boolean
      - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
      - `pojo` boolean
      - `number` boolean
      - `integralNumber` boolean
      - `floatingPointNumber` boolean
      - `short` boolean
      - `int` boolean
      - `long` boolean
      - `float` boolean
      - `double` boolean
      - `bigDecimal` boolean
      - `bigInteger` boolean
      - `textual` boolean
      - `boolean` boolean
      - `null` boolean
      - `binary` boolean
    - `scheduleEnabled` boolean — Whether scheduled (unattended) exports are enabled for this template.
    - `scheduleFrequency` string — Schedule cadence: `daily`, `weekly`, `monthly`, or `custom`. Null when no schedule is configured.
    - `scheduleTime` string — Time of day the schedule runs, 24-hour `HH:mm`. Null when scheduleFrequency is `custom` or no schedule is configured.
    - `scheduleDayOfWeek` integer — Day of week the schedule runs: 1 = Sunday ... 7 = Saturday. Only set when scheduleFrequency=`weekly`.
    - `scheduleDayOfMonth` integer — Day of month (1-31) the schedule runs. Only set when scheduleFrequency=`monthly`.
    - `scheduleCron` string — Quartz cron expression (6-7 fields, not standard 5-field Unix cron) defining the schedule. Only set when scheduleFrequency=`custom`.
    - `scheduleTimezone` string — IANA timezone identifier the schedule runs in, e.g. `America/New_York`.
    - `scheduleDaysOfWeek` string — Comma-separated days of week the schedule runs: 1 = Sunday ... 7 = Saturday. Only set when scheduleFrequency=`weekly`.
    - `scheduleInterval` integer — Interval in hours between runs (1, 2, 3, 4, 6, 8 or 12 — divisors of 24). Only set when scheduleFrequency=`hourly`.
    - `lastExportAt` string, date-time
    - `nextExportAt` string, date-time
    - `metadata` JsonNode
      - `empty` boolean
      - `valueNode` boolean
      - `containerNode` boolean
      - `missingNode` boolean
      - `array` boolean
      - `object` boolean
      - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
      - `pojo` boolean
      - `number` boolean
      - `integralNumber` boolean
      - `floatingPointNumber` boolean
      - `short` boolean
      - `int` boolean
      - `long` boolean
      - `float` boolean
      - `double` boolean
      - `bigDecimal` boolean
      - `bigInteger` boolean
      - `textual` boolean
      - `boolean` boolean
      - `null` boolean
      - `binary` boolean
    - `jobType` string — Derived export trigger type for the Activity Center UI: `SCHEDULED` when a schedule is enabled, `MANUAL` otherwise. Not persisted by the data store.
    - `createdByName` string — Display name resolved from createdBy, when resolvable. Null if resolution failed or has not been attempted; callers should fall back to createdByEmail then createdBy in that case.
    - `createdByEmail` string — Email resolved from createdBy, when resolvable. Null if resolution failed or has not been attempted; used as the display fallback between createdByName and the raw createdBy id.
    - `bqExportEnabled` boolean
    - `bqTableName` string
    - `bqDataset` string
  - `total` integer — Total number of templates matching the filters across all pages.
  - `page` integer — Zero-based page number returned, per the `page` query parameter.
  - `size` integer — Number of templates requested per page, per the `size` query parameter.
  - `hasMore` boolean — Whether at least one further page is available after this one.

## Other responses

- `401` — The request is missing a valid bearer token; re-authenticate and retry
- `403` — The authenticated caller lacks the read-template permission for this tenant

---

[API](https://skmtc.net/certifyos/apis/certify-api-layer.md) · [All operations](https://skmtc.net/certifyos/apis/certify-api-layer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/certifyos/certify-api-layer/revisions/563848e0ecc0/schema)
