> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cairhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Transactions

> Stedi Core-compatible **List Transactions**. Drop-in replacement: point a Stedi `2023-08-01` client at `https://<your-cair-host>/api/stedi/2023-08-01` and authenticate with your Cair access token.

Transactions are returned newest-first by `processedAt`. Every transaction that is visible to your organization is included regardless of how it entered Cair (`stedi` webhooks and uploaded / EOB-converted X12). Pages are traversed with the opaque `nextPageToken`; there is no offset paging.

## Overview

Returns your organization's processed transactions, newest first by `processedAt`. This is a 1:1 drop-in for Stedi's [List Transactions](https://www.stedi.com/docs/healthcare/api-reference/get-list-transactions) operation.

Results include every source (`stedi` webhooks, uploaded X12, and EOB-converted X12) that your organization can see. Use it to build transaction browsers, reconciliations, or backfills; use [Poll Transactions](/api-reference/endpoint/stedi/poll-transactions) to follow the stream incrementally.

## Authentication

JWT Bearer token from [`POST /api/token`](/api-reference/endpoint/token), with the `api-access` feature.

## Query parameters

<ParamField query="pageSize" type="integer" default="100">
  Number of transactions per page, `1`–`500`. Values outside the range return `400`.
</ParamField>

<ParamField query="pageToken" type="string">
  Opaque cursor from a previous response's `nextPageToken`. It is bound to your organization and to the filters it was minted with; changing filters mid-pagination returns `400`.
</ParamField>

<ParamField query="transactionSetId" type="string">
  Restrict to one X12 transaction type. Accepts any 3-digit Transaction Set Identifier Code: `835` (remit), `837` (claim), `277` (claim status), and others.
</ParamField>

<ParamField query="direction" type="string">
  `INBOUND`, `OUTBOUND`, or `UNKNOWN`. `837` claims are `OUTBOUND`; `835` remits and `277` statuses are `INBOUND`.
</ParamField>

<ParamField query="mode" type="string">
  `test`, `production`, or `other` (from `ISA15`).
</ParamField>

<ParamField query="status" type="string">
  `succeeded` or `failed`.
</ParamField>

<ParamField query="from" type="string">
  Inclusive lower bound on `processedAt`. ISO 8601 date-time, e.g. `2026-10-01T00:00:00Z`.
</ParamField>

<ParamField query="to" type="string">
  Inclusive upper bound on `processedAt`. ISO 8601 date-time.
</ParamField>

<ParamField query="businessIdentifier" type="string">
  Restrict to transactions containing a matching business identifier. Matches the transaction's `businessIdentifiers` (for example the patient control number `CLP-01` / `CLM-01`, element `1028`, or the trace number `TRN-02` / `BHT-03`, element `127`) and falls back to the item patient control number / trace number for uploaded X12.
</ParamField>

<ParamField query="elementId" type="string">
  Restrict `businessIdentifier` to one X12 element ID (e.g. `1028` or `127`). **May only be supplied together with `businessIdentifier`**; supplying it alone returns `400`.
</ParamField>

<ParamField query="partnershipId" type="string">
  Accepted for Stedi compatibility and ignored. All Cair transactions use Cair's shared Stedi connection.
</ParamField>

<ParamField query="sender" type="string">
  Accepted for Stedi compatibility and ignored.
</ParamField>

<ParamField query="receiver" type="string">
  Accepted for Stedi compatibility and ignored.
</ParamField>

## Example

Fetch the first page of 835 remits:

```bash theme={null}
curl "https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions?transactionSetId=835&pageSize=50" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

Walk every page:

```ts theme={null}
let pageToken: string | undefined;
const transactions: unknown[] = [];

do {
  const url = new URL('https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions');
  url.searchParams.set('transactionSetId', '835');
  if (pageToken) url.searchParams.set('pageToken', pageToken);

  const response = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.CAIR_ACCESS_TOKEN}` },
  });
  if (!response.ok) throw new Error(await response.text());

  const page = await response.json();
  transactions.push(...page.items);
  pageToken = page.nextPageToken;
} while (pageToken);
```

## Response

```json theme={null}
{
  "items": [
    {
      "transactionId": "c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6",
      "fileExecutionId": "b0a1c2d3e4f5a6b7c8d9e0f1a2b3c4d5",
      "status": "succeeded",
      "direction": "INBOUND",
      "mode": "production",
      "processedAt": "2026-10-05T14:12:00.000Z",
      "artifacts": [
        {
          "artifactType": "application/edi-x12",
          "usage": "input",
          "sizeBytes": 2048,
          "url": "https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/input",
          "model": "transaction"
        },
        {
          "artifactType": "application/json",
          "usage": "output",
          "sizeBytes": 8192,
          "url": "https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/output",
          "model": "transaction"
        }
      ],
      "partnership": {
        "partnershipId": "local-clearinghouse",
        "partnershipType": "x12",
        "sender": { "profileId": "local" },
        "receiver": { "profileId": "clearinghouse" }
      },
      "businessIdentifiers": [
        {
          "elementId": "1028",
          "element": "CLP-01",
          "name": "Patient Control Number",
          "value": "PCN123456"
        }
      ],
      "x12": {
        "metadata": {
          "interchange": { "acknowledgmentRequestedCode": "0", "controlNumber": 42 },
          "functionalGroup": {
            "controlNumber": 1,
            "release": "005010X221A1",
            "date": "2026-10-05",
            "time": "14:12:00",
            "functionalIdentifierCode": "HP"
          },
          "transaction": { "controlNumber": "0001", "transactionSetIdentifier": "835" },
          "sender": { "applicationCode": "ZZ", "isa": { "qualifier": "ZZ", "id": "SUBMITTER" } },
          "receiver": { "applicationCode": "ZZ", "isa": { "qualifier": "ZZ", "id": "RECEIVER" } }
        }
      }
    }
  ],
  "nextPageToken": "be08e5ba4bf36da9da27dcb651e64a6e5502685499994f354"
}
```

## Pagination

* `nextPageToken` is present only when there are more matching transactions. When it is absent, you have reached the end.
* Always pass the token back **with the same filters**; the token records a hash of the filter set and a mismatch returns `400 Bad RequestException`.
* Tokens are opaque. Do not parse, modify, or persist them across filter changes.

See the [Transaction Stream Overview](/api-reference/endpoint/stedi/overview) for the `TransactionSummary` field reference and the shared error model.


## OpenAPI

````yaml GET /api/stedi/2023-08-01/transactions
openapi: 3.1.0
info:
  title: Cair Health APIs
  description: APIs for the Cair Health platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://forecaster.cairhealth.com
security:
  - bearerAuth: []
paths:
  /api/stedi/2023-08-01/transactions:
    get:
      summary: List transactions
      description: >-
        Stedi Core-compatible **List Transactions**. Drop-in replacement: point
        a Stedi `2023-08-01` client at
        `https://<your-cair-host>/api/stedi/2023-08-01` and authenticate with
        your Cair access token.


        Transactions are returned newest-first by `processedAt`. Every
        transaction that is visible to your organization is included regardless
        of how it entered Cair (`stedi` webhooks and uploaded / EOB-converted
        X12). Pages are traversed with the opaque `nextPageToken`; there is no
        offset paging.
      operationId: stediListTransactions
      parameters:
        - name: pageSize
          in: query
          required: false
          description: >-
            Maximum number of transactions to return in a page (1–500). Defaults
            to 100.
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
        - name: pageToken
          in: query
          required: false
          description: >-
            Opaque cursor returned as `nextPageToken` by a previous call. Supply
            it to fetch the next page. The cursor is bound to your organization
            and to the filter set it was minted with; reusing it with different
            filters returns `400`.
          schema:
            type: string
        - name: transactionSetId
          in: query
          required: false
          description: >-
            List only a given X12 transaction type. Accepts any 3-digit X12
            Transaction Set Identifier Code, e.g. `835`, `837`, `277`.
          schema:
            type: string
            pattern: ^\d{3}$
          example: '835'
        - name: direction
          in: query
          required: false
          description: >-
            Transaction direction. `837` claims are `OUTBOUND`; `835` remits and
            `277` statuses are `INBOUND`.
          schema:
            type: string
            enum:
              - INBOUND
              - OUTBOUND
              - UNKNOWN
        - name: mode
          in: query
          required: false
          description: >-
            Whether the transaction carries test or production data (from
            `ISA15`).
          schema:
            type: string
            enum:
              - test
              - production
              - other
        - name: status
          in: query
          required: false
          description: Whether Cair was able to successfully process the transaction.
          schema:
            type: string
            enum:
              - succeeded
              - failed
        - name: from
          in: query
          required: false
          description: >-
            Inclusive lower bound on `processedAt`. ISO 8601 date-time, e.g.
            `2026-10-01T00:00:00Z`.
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          description: Inclusive upper bound on `processedAt`. ISO 8601 date-time.
          schema:
            type: string
            format: date-time
        - name: businessIdentifier
          in: query
          required: false
          description: >-
            List only transactions containing a business identifier with this
            value. Matches the transaction-level `businessIdentifiers` (for
            example the `CLP-01` / `CLM-01` patient control number, element
            `1028`, or the `TRN-02` / `BHT-03` trace number, element `127`), and
            falls back to the item patient control number / trace number for
            uploaded X12.
          schema:
            type: string
          example: PCN123456
        - name: elementId
          in: query
          required: false
          description: >-
            Restrict `businessIdentifier` to a specific X12 element ID. May only
            be supplied together with `businessIdentifier`; supplying it alone
            returns `400`.
          schema:
            type: string
          example: '1028'
        - name: partnershipId
          in: query
          required: false
          description: >-
            Accepted for Stedi compatibility and currently ignored. All Cair
            transactions are exchanged on Cair's shared Stedi connection.
          schema:
            type: string
        - name: sender
          in: query
          required: false
          description: >-
            Accepted for Stedi compatibility and currently ignored. All Cair
            transactions use Cair-managed profile IDs.
          schema:
            type: string
        - name: receiver
          in: query
          required: false
          description: >-
            Accepted for Stedi compatibility and currently ignored. All Cair
            transactions use Cair-managed profile IDs.
          schema:
            type: string
      responses:
        '200':
          description: A page of transactions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediListTransactionsResponse'
              example:
                items:
                  - transactionId: c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6
                    fileExecutionId: b0a1c2d3e4f5a6b7c8d9e0f1a2b3c4d5
                    status: succeeded
                    direction: INBOUND
                    mode: production
                    processedAt: '2026-10-05T14:12:00.000Z'
                    artifacts:
                      - artifactType: application/edi-x12
                        usage: input
                        sizeBytes: 2048
                        url: >-
                          https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/input
                        model: transaction
                      - artifactType: application/json
                        usage: output
                        sizeBytes: 8192
                        url: >-
                          https://forecaster.cairhealth.com/api/stedi/2023-08-01/transactions/c1f2e3d4a5b6c7d8e9f0a1b2c3d4e5f6/output
                        model: transaction
                    partnership:
                      partnershipId: local-clearinghouse
                      partnershipType: x12
                      sender:
                        profileId: local
                      receiver:
                        profileId: clearinghouse
                    businessIdentifiers:
                      - elementId: '1028'
                        element: CLP-01
                        name: Patient Control Number
                        value: PCN123456
                    x12:
                      metadata:
                        interchange:
                          acknowledgmentRequestedCode: '0'
                          controlNumber: 42
                        functionalGroup:
                          controlNumber: 1
                          release: 005010X221A1
                          date: '2026-10-05'
                          time: '14:12:00'
                          functionalIdentifierCode: HP
                        transaction:
                          controlNumber: '0001'
                          transactionSetIdentifier: '835'
                        sender:
                          applicationCode: ZZ
                          isa:
                            qualifier: ZZ
                            id: SUBMITTER
                        receiver:
                          applicationCode: ZZ
                          isa:
                            qualifier: ZZ
                            id: RECEIVER
                nextPageToken: be08e5ba4bf36da9da27dcb651e64a6e5502685499994f354
        '400':
          description: Invalid query parameter, cursor, or filter combination.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediError'
        '401':
          description: Missing or invalid Cair access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediError'
        '500':
          description: Unexpected server error while reading transactions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StediError'
      security:
        - bearerAuth: []
components:
  schemas:
    StediListTransactionsResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/StediTransactionSummary'
        nextPageToken:
          type: string
          description: >-
            Opaque cursor for the next page. Absent when this is the last page.
            Bound to the organization and the filter set.
    StediError:
      type: object
      description: Stedi-compatible error envelope.
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Stedi error code.
          enum:
            - BadRequestException
            - UnauthorizedException
            - AccessDeniedException
            - ResourceNotFoundException
            - UnprocessableEntityException
            - ServiceException
    StediTransactionSummary:
      type: object
      description: A processed transaction, matching Stedi Core `TransactionSummary`.
      required:
        - transactionId
        - fileExecutionId
        - status
        - direction
        - mode
        - processedAt
        - artifacts
        - partnership
      properties:
        transactionId:
          type: string
          description: Unique transaction identifier.
        fileExecutionId:
          type: string
          description: Identifier of the file execution the transaction belongs to.
        status:
          type: string
          enum:
            - succeeded
            - failed
        direction:
          type: string
          enum:
            - INBOUND
            - OUTBOUND
            - UNKNOWN
        mode:
          type: string
          enum:
            - test
            - production
            - other
        processedAt:
          type: string
          format: date-time
          description: >-
            When the transaction was processed, ISO 8601. For uploaded /
            EOB-converted X12 this is the historical check date from the X12
            `GS04` header.
        artifacts:
          type: array
          description: >-
            Downloadable artifacts. Only `input` and `output` artifacts are
            returned; URLs point back at Cair.
          items:
            $ref: '#/components/schemas/StediArtifact'
        partnership:
          $ref: '#/components/schemas/StediPartnership'
        x12:
          type: object
          required:
            - metadata
          properties:
            metadata:
              $ref: '#/components/schemas/StediX12Metadata'
            transactionSetting:
              type: object
              properties:
                guideId:
                  type: string
                transactionSettingId:
                  type: string
        fragments:
          type: object
          properties:
            keyName:
              type: string
            fragmentCount:
              type: integer
            batchSize:
              type: integer
        translationErrors:
          type: array
          description: >-
            Details about errors that prevented Cair from processing the
            transaction.
          items:
            $ref: '#/components/schemas/StediTranslationError'
        businessIdentifiers:
          type: array
          description: Business identifiers extracted from the transaction.
          items:
            $ref: '#/components/schemas/StediBusinessIdentifier'
    StediArtifact:
      type: object
      description: A downloadable artifact associated with a transaction.
      required:
        - artifactType
        - usage
        - sizeBytes
        - url
        - model
      properties:
        artifactType:
          type: string
          description: The MIME type of the artifact.
          enum:
            - text/csv
            - application/edifact
            - application/filepart
            - application/json
            - application/pdf
            - text/psv
            - text/tsv
            - application/edi-x12
            - application/xml
            - application/zip
            - image/jpeg
            - image/png
            - image/tiff
            - text/plain
            - unknown
        usage:
          type: string
          description: The role the artifact plays in the transaction.
          enum:
            - attachment
            - input
            - metadata
            - output
        sizeBytes:
          type: integer
          description: Artifact size in bytes.
          minimum: 0
        url:
          type: string
          description: >-
            Cair-hosted download URL. Following it returns a `302` to a
            presigned artifact URL.
        model:
          type: string
          description: The artifact model.
          enum:
            - execution
            - fragment
            - transaction
            - fault
    StediPartnership:
      type: object
      description: The EDI partnership the transaction was exchanged on.
      required:
        - partnershipId
        - partnershipType
        - sender
        - receiver
      properties:
        partnershipId:
          type: string
          description: Partnership identifier, e.g. `local-clearinghouse`.
        partnershipType:
          type: string
          enum:
            - x12
            - edifact
        sender:
          type: object
          required:
            - profileId
          properties:
            profileId:
              type: string
        receiver:
          type: object
          required:
            - profileId
          properties:
            profileId:
              type: string
    StediX12Metadata:
      type: object
      description: >-
        Metadata parsed from the X12 interchange, functional group, and
        transaction headers.
      required:
        - interchange
        - functionalGroup
        - transaction
        - sender
        - receiver
      properties:
        interchange:
          type: object
          required:
            - acknowledgmentRequestedCode
            - controlNumber
          properties:
            acknowledgmentRequestedCode:
              type: string
              description: X12 `ISA14`.
            controlNumber:
              type: integer
              minimum: 0
              maximum: 999999999
        functionalGroup:
          type: object
          required:
            - controlNumber
            - release
            - date
            - time
            - functionalIdentifierCode
          properties:
            controlNumber:
              type: integer
              minimum: 0
              maximum: 999999999
            release:
              type: string
              description: Implementation guide version, e.g. `005010X221A1`.
            date:
              type: string
              description: '`YYYY-MM-DD`.'
            time:
              type: string
              description: '`HH:MM:SS`.'
            functionalIdentifierCode:
              type: string
              description: X12 `GS01`, e.g. `HC`, `HP`.
        transaction:
          type: object
          required:
            - controlNumber
            - transactionSetIdentifier
          properties:
            controlNumber:
              type: string
            transactionSetIdentifier:
              type: string
              description: 3-digit X12 transaction set ID, e.g. `835`.
        sender:
          $ref: '#/components/schemas/StediX12Profile'
        receiver:
          $ref: '#/components/schemas/StediX12Profile'
    StediTranslationError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
        context:
          type: object
          properties:
            code:
              type: string
            schemaPath:
              type: string
        mark:
          type: object
          properties:
            start:
              type: object
              required:
                - line
                - column
              properties:
                line:
                  type: integer
                column:
                  type: integer
            end:
              type: object
              required:
                - line
                - column
              properties:
                line:
                  type: integer
                column:
                  type: integer
    StediBusinessIdentifier:
      type: object
      description: A business identifier extracted from the transaction.
      required:
        - elementId
        - element
        - name
        - value
      properties:
        elementId:
          type: string
          description: X12 element ID, e.g. `1028` or `127`.
        element:
          type: string
          description: The element where the value was found, e.g. `CLP-01`.
        name:
          type: string
          description: Human-readable name of the identifier.
        value:
          type: string
          description: The identifier value.
    StediX12Profile:
      type: object
      required:
        - applicationCode
        - isa
      properties:
        applicationCode:
          type: string
        isa:
          type: object
          required:
            - qualifier
            - id
          properties:
            qualifier:
              type: string
            id:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.