> 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/get-escrow-events.md).

# Get Escrow Events

Page an escrow event timeline.

### **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

## Page an escrow’s event timeline (keyset)

> Addressed by the on-chain contract address (C…). Returns the full timeline a page at a time, ordered by the event’s on-chain position (ledgerSeq, txIndex, eventIndex). Page with \`limit\` + opaque \`cursor\`; \`order\` defaults to asc (chronological). Returns 404 only if the escrow is unknown on this network.

```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/{contractId}/events":{"get":{"description":"Addressed by the on-chain contract address (C…). Returns the full timeline a page at a time, ordered by the event’s on-chain position (ledgerSeq, txIndex, eventIndex). Page with `limit` + opaque `cursor`; `order` defaults to asc (chronological). Returns 404 only if the escrow is unknown on this network.","operationId":"EscrowQueryController_events","parameters":[{"name":"contractId","required":true,"in":"path","description":"On-chain escrow contract address (C…, 56 chars).","schema":{"type":"string"}},{"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":"order","required":false,"in":"query","description":"Timeline direction. Defaults to asc (chronological); desc for newest-first.","schema":{"default":"asc","type":"string","enum":["asc","desc"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscrowEventListResponse"}}}},"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"}}}},"404":{"description":"Escrow not found.","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":"Page an escrow’s event timeline (keyset)","tags":["Escrows"]}}},"components":{"schemas":{"EscrowEventListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EscrowEventResponse"}},"hasMore":{"type":"boolean","description":"Whether more events 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"]},"EscrowEventResponse":{"type":"object","properties":{"kind":{"type":"string","description":"Event kind, e.g. \"tw_fund\"."},"actor":{"type":"string","nullable":true,"description":"Best-effort actor address."},"ledgerSeq":{"type":"string","description":"Ledger sequence (BigInt as string)."},"txHash":{"type":"string","nullable":true,"description":"Transaction hash."},"ledgerClosedAt":{"type":"string","description":"Ledger close time (ISO 8601)."},"topics":{"description":"Indexed values the contract emitted with the event (kind, engagement id, ...). Soroban event topics, passed through.","type":"array","items":{"type":"array"}},"payload":{"type":"object","description":"Decoded event body (shape depends on `kind`).","additionalProperties":true}},"required":["kind","ledgerSeq","ledgerClosedAt","topics"]},"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/{contractId}/events

Pages an escrow's event timeline — every on-chain action recorded against it, in order.

| Name       | Type            | In    | Description                                            |
| ---------- | --------------- | ----- | ------------------------------------------------------ |
| contractId | string          | path  | On-chain escrow address (`C…`)                         |
| limit      | number          | query | 1–200, default 50                                      |
| cursor     | string          | query | From the previous page's `nextCursor`                  |
| order      | `asc` \| `desc` | query | Default `asc` (chronological); `desc` for newest-first |

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

The same paginated envelope as the listing: `{ data, hasMore, nextCursor }`.

Use it to build an activity feed, or to reconstruct what happened to an escrow and when. `GET /escrows/{contractId}` already includes the first 200 events, so you only need this endpoint when `eventsHasMore` is true or when you want newest-first.

### 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 (contractId: string) => {
  const params = new URLSearchParams({ limit: "50", order: "desc" });

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

  return data;
}
```

{% 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/get-escrow-events.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.
