> For the complete documentation index, see [llms.txt](https://docs.trustlesswork.com/trustless-work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/escrow-information/list-escrows.md).

# List Escrows

List escrows with filters and keyset pagination via GET /escrows.

### **Headers**

<table><thead><tr><th width="366">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>x-api-key</td><td><code>&#x3C;token></code></td></tr></tbody></table>

### Open API

## List escrows (paginated) — the caller’s by default

> With \`scope=mine\` (the default) returns the escrows that concern the caller: participation via verified wallets and platform attribution. With \`scope=all\` returns every escrow on this network. Filter with \`status\`, \`type\`, \`engagementId\`, \`contractIds\` (batch), \`participant\`, \`role\`, \`platformId\`, \`subjectId\`; page with \`limit\` + opaque \`cursor\` (keyset). The \`platformId\`/\`subjectId\` filters are tenant-scoped: they require the caller to be (or own) that platform — 403 \`ESCROW\_FILTER\_FORBIDDEN\` otherwise.

```json
{"openapi":"3.0.0","info":{"title":"👋🏼 Trustless Work Core API — All Endpoints (Unified)","version":"1.0"},"servers":[{"url":"https://beta.api.trustlesswork.com"}],"security":[{}],"paths":{"/escrows":{"get":{"description":"With `scope=mine` (the default) returns the escrows that concern the caller: participation via verified wallets and platform attribution. With `scope=all` returns every escrow on this network. Filter with `status`, `type`, `engagementId`, `contractIds` (batch), `participant`, `role`, `platformId`, `subjectId`; page with `limit` + opaque `cursor` (keyset). The `platformId`/`subjectId` filters are tenant-scoped: they require the caller to be (or own) that platform — 403 `ESCROW_FILTER_FORBIDDEN` otherwise.","operationId":"EscrowQueryController_list","parameters":[{"name":"scope","required":false,"in":"query","description":"Listing reach. `mine` (default) returns only the escrows that concern the caller: participation via their verified wallets and escrows attributed to their platform. `all` returns every escrow on this network (escrow state is public on-chain).","schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"limit","required":false,"in":"query","description":"Page size. 1–200, defaults to 50.","schema":{"minimum":1,"maximum":200,"default":50,"type":"number"}},{"name":"cursor","required":false,"in":"query","description":"Opaque cursor from the previous page’s `nextCursor`. Omit for page one.","schema":{"type":"string"}},{"name":"includeSnapshot","required":false,"in":"query","description":"Set to false to receive rows WITHOUT the full contract `snapshot` (served as null) — a much lighter page when only the typed summary is needed. Defaults to true.","schema":{"default":true,"type":"boolean"}},{"name":"sort","required":false,"in":"query","description":"Sort column. Defaults to updatedAt.","schema":{"default":"updatedAt","type":"string","enum":["createdAt","updatedAt"]}},{"name":"order","required":false,"in":"query","description":"Sort direction. Defaults to desc.","schema":{"default":"desc","type":"string","enum":["asc","desc"]}},{"name":"createdAfter","required":false,"in":"query","description":"Only escrows created at/after this time (ISO 8601).","schema":{"format":"date-time","type":"string"}},{"name":"createdBefore","required":false,"in":"query","description":"Only escrows created at/before this time (ISO 8601).","schema":{"format":"date-time","type":"string"}},{"name":"status","required":false,"in":"query","description":"Filter by lifecycle status (exact match).","schema":{"type":"string"}},{"name":"type","required":false,"in":"query","description":"Filter by detected contract flavor (exact match). Matches the `type` field of the response rows.","schema":{"type":"string"}},{"name":"contractVersion","required":false,"in":"query","description":"Contract generation reach of the listing. **Defaults to `v2`**: omitting the param returns only V2 escrows. Pass `v1` for the legacy generation, or `all` for every escrow (including rows whose generation could not be derived from the on-chain shape). Matches the `contractVersion` field of the response rows — the on-chain contract generation, not the `apiVersion` provenance label.","schema":{"default":"v2","type":"string","enum":["v1","v2","all"]}},{"name":"engagementId","required":false,"in":"query","description":"Filter by engagement id (exact match).","schema":{"type":"string"}},{"name":"contractIds","required":false,"in":"query","description":"Only these on-chain contract addresses (repeat the param: `contractIds=C…&contractIds=C…`, 1–50). Batch lookup within the caller’s accessible set — inaccessible or unknown ids are silently absent from the page.","schema":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},{"name":"participant","required":false,"in":"query","description":"Filter to escrows where this wallet (G…) is an on-chain participant — within the caller’s accessible set. Lets a platform segment its escrows by end-user.","schema":{"type":"string"}},{"name":"role","required":false,"in":"query","description":"Filter to escrows with a participant acting in this role (e.g. `approver`, `receiver`, `platform`). Combined with `participant`, both must match the same participant — \"escrows where wallet X is an approver\".","schema":{"type":"string"}},{"name":"platformId","required":false,"in":"query","description":"Filter to escrows attributed to this platform. Tenant-scoped: the caller must be (or own) that platform — 403 `ESCROW_FILTER_FORBIDDEN` otherwise. Useful for an account that owns several platforms.","schema":{"type":"string"}},{"name":"subjectId","required":false,"in":"query","description":"Filter to escrows attributed to this subject (the platform’s end-user). Subject id from the Subjects API. Tenant-scoped like `platformId`: the subject must belong to a platform the caller is or owns — 403 `ESCROW_FILTER_FORBIDDEN` otherwise.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscrowListResponse"}}}},"400":{"description":"Request body or query params fail schema validation (wrong type, missing required field, unknown property).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"401":{"description":"Missing, malformed, expired, revoked or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"403":{"description":"API key is valid but does not have the role required for this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}},"422":{"description":"Payload is well-formed but a business rule rejects it (e.g. amount out of range, role not allowed for this user).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetailsResponseDto"}}}}},"summary":"List escrows (paginated) — the caller’s by default","tags":["Escrows"]}}},"components":{"schemas":{"EscrowListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EscrowSummaryResponse"}},"hasMore":{"type":"boolean","description":"Whether more results exist after `nextCursor`."},"nextCursor":{"type":"string","nullable":true,"description":"Cursor to fetch the next page, or null if this is the last."}},"required":["data","hasMore"]},"EscrowSummaryResponse":{"type":"object","properties":{"network":{"type":"string","description":"Stellar network."},"contractId":{"type":"string","description":"On-chain escrow contract (C...)."},"type":{"type":"string","description":"Detected contract flavor. Null until the first state.","nullable":true},"contractVersion":{"type":"string","nullable":true,"description":"Contract generation (\"v1\" | \"v2\") detected from the on-chain shape. The column the `contractVersion` list filter matches (lists default to v2). Null until the first state, or when the shape matches no known generation. Distinct from `apiVersion`, which records which API CREATED the escrow."},"apiVersion":{"type":"string","nullable":true,"description":"API generation this escrow was created through, e.g. \"v1\" for escrows backfilled from the legacy API. Null when unknown (the current API generation does not label its escrows)."},"status":{"type":"string","nullable":true,"description":"Lifecycle status."},"anomalies":{"description":"TW invariant violations visible in the projected state (empty = compliant). The factory is a public contract, so an escrow can be deployed outside this API with trap parameters (e.g. a platform fee above the ceiling locks every deposit); a non-empty list means DO NOT treat this escrow as a compliant TW escrow.","type":"array","items":{"type":"string"}},"amount":{"type":"string","nullable":true,"description":"Total escrowed amount in token units (decimal string): the single-release amount, or the sum of the milestone amounts for multi-release. Null until the first state is projected."},"balance":{"type":"string","description":"Projected balance (total deposited − total released), derived from the read-model deposit trail; eventually consistent with the on-chain token balance. Always present (decimal string), \"0\" when nothing is deposited."},"asset":{"nullable":true,"description":"The trustline asset funding this escrow. Null until the first state is projected.","type":"object","allOf":[{"$ref":"#/components/schemas/EscrowAssetResponse"}]},"lastLedgerSeq":{"type":"string","description":"Highest ledger applied to this row (BigInt as string)."},"createdAt":{"type":"string","description":"Row creation timestamp (ISO 8601)."},"updatedAt":{"type":"string","description":"Last update timestamp (ISO 8601)."},"firstLedgerClosedAt":{"type":"string","nullable":true,"description":"Chain clock: close time of the first ledger whose state was projected (ISO 8601). Unlike createdAt (ingestion wall-clock), it survives replays and rebuilds. Null until a state carries it."},"lastLedgerClosedAt":{"type":"string","nullable":true,"description":"Chain clock: close time of the latest ledger applied to this row (ISO 8601). Null until a state carries it."},"snapshot":{"type":"object","nullable":true,"description":"Full contract state (camelCased for the wire; amounts in token units, platformFee as percent).","additionalProperties":true}},"required":["network","contractId","anomalies","amount","balance","lastLedgerSeq","createdAt","updatedAt"]},"EscrowAssetResponse":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"Asset code / SEP-41 symbol. Null while unresolved."},"address":{"type":"string","nullable":true,"description":"Issuer account (G...) of the wrapped classic asset. Null for pure Soroban tokens or while unresolved."},"contractId":{"type":"string","nullable":true,"description":"Soroban token contract (C...) from the escrow trustline."},"decimals":{"type":"number","description":"Decimals every amount in this payload was scaled with. Falls back to 7 (Stellar classic) while the token metadata is unresolved — check `resolved`."},"resolved":{"type":"boolean","description":"False while the token metadata is unresolved: `decimals` is then the 7-decimal fallback, so amounts of a custom token may be scaled wrong until the cache self-heals. Re-scale client-side or hold rendering while false."}},"required":["decimals","resolved"]},"ProblemDetailsResponseDto":{"type":"object","properties":{"type":{"type":"string","description":"Stable URI identifying the error type. Hash-link points to the docs."},"title":{"type":"string","description":"Short human-readable summary of the problem."},"status":{"type":"number","description":"HTTP status code, repeated here for typed clients."},"code":{"type":"string","description":"Machine-readable error code. Stable across versions; safe to switch on."},"detail":{"type":"string","description":"Human-readable explanation specific to this occurrence."},"instance":{"type":"string","description":"URI of the request that triggered the error."},"traceId":{"type":"string","description":"Correlation id propagated from the `X-Trace-Id` header (or generated). Use it when contacting support to reference a specific request."},"extensions":{"type":"object","description":"Optional structured context. Shape depends on the error code; documented per-endpoint when relevant.","additionalProperties":true}},"required":["type","title","status","code","detail"]}}}}
```

## GET /escrows

The main listing endpoint. Returns escrows the caller can see, filtered and keyset-paginated.

### Scope

| Value            | Returns                                                                                |
| ---------------- | -------------------------------------------------------------------------------------- |
| `mine` (default) | Escrows your verified wallets participate in, plus escrows attributed to your platform |
| `all`            | Every escrow on the network                                                            |

### Filters

All filters are AND-combined.

| Name                         | Type      | Description                                              |
| ---------------------------- | --------- | -------------------------------------------------------- |
| status                       | string    | Lifecycle status (exact match)                           |
| contractType                 | string    | Contract flavor (exact match)                            |
| engagementId                 | string    | Your own correlation id (exact match)                    |
| contractIds                  | string\[] | Only these addresses. Repeat the param                   |
| participant                  | string    | Wallet (`G…`) that is an on-chain participant            |
| role                         | string    | Combined with `participant`: "wallet X acting as role Y" |
| platformId                   | string    | Escrows attributed to this platform (**tenant-scoped**)  |
| subjectId                    | string    | Escrows attributed to this subject (**tenant-scoped**)   |
| createdAfter / createdBefore | ISO 8601  | Creation window                                          |
| includeSnapshot              | boolean   | `false` drops the heavy `snapshot` field                 |

### Pagination

| Name   | Type                       | Description                           |
| ------ | -------------------------- | ------------------------------------- |
| limit  | number                     | 1–200, default 50                     |
| cursor | string                     | From the previous page's `nextCursor` |
| sort   | `createdAt` \| `updatedAt` | Default `updatedAt`                   |
| order  | `asc` \| `desc`            | Default `desc`                        |

### **What this Endpoint returns?**

Always the paginated envelope — **never a bare array**:

```json
{ "data": [ /* escrow summaries */ ], "hasMore": true, "nextCursor": "eyJ..." }
```

Keep `sort` and `order` identical across pages, or the cursor is rejected with `INVALID_CURSOR`.

### Use Example:

```typescript
import axios from "axios";

const http = axios.create({
  baseURL: "https://beta.api.trustlesswork.com",
  timeout: 10000,
  headers: {
    "Content-Type": "application/json",
    "x-api-key": your_api_key,
  },
});

export const useExample = async () => {
  const params = new URLSearchParams({
    scope: "mine",
    limit: "20",
    sort: "updatedAt",
    order: "desc",
  });

  const { data } = await http.get(`/escrows?${params.toString()}`);
  return data; // { data, hasMore, nextCursor }
}
```

### Paging through everything

```typescript
export const listAll = async () => {
  const all = [];
  let cursor = null;

  do {
    const params = new URLSearchParams({ limit: "100" });
    if (cursor) params.append("cursor", cursor);

    const { data } = await http.get(`/escrows?${params.toString()}`);
    all.push(...data.data);
    cursor = data.hasMore ? data.nextCursor : null;
  } while (cursor);

  return all;
}
```

{% hint style="warning" %}
Filtering by a `platformId` or `subjectId` you do not own returns `403 ESCROW_FILTER_FORBIDDEN`. Filtering by `participant` has no such restriction — on-chain participation is public.
{% endhint %}

{% hint style="info" %}
These reads come from the read-model, which is eventually consistent. Right after submitting a transaction a `404` usually means "not projected yet", not "does not exist" — poll briefly instead of treating it as an error.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/escrow-information/list-escrows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
