Skip to main content
Effective date: 2026-05-20. Use this guide when updating code that reads agreement records or input history from the Agreements API or @shodai-network/agreements-api-client.

What changed

Authenticated agreement routes return response envelopes. Raw single-resource HTTP responses use data and meta; raw list responses use data, pageInfo, and meta. The TypeScript client unwraps single-resource methods such as getAgreement(...), validateTemplate(...), validateDeployment(...), deployWithPermit(...), getAgreementState(...), and submitAgreementInput(...). List methods return the list envelope so callers can read data, pageInfo, and meta.

Upgrade checklist

  1. Upgrade to @shodai-network/agreements-api-client 0.2.0 or newer. This is the minimum version for the response-envelope changes described here.
  2. Update raw HTTP consumers to read resource responses from response.data.
  3. Update list consumers to iterate over response.data.
  4. Use response.pageInfo.nextCursor for the next page when present.
  5. Store or log response.meta.requestId when support traceability matters.
  6. Update error handling to read error.code, error.message, optional error.details, and error.requestId.

SDK before and after

Before 0.2.0, list methods returned arrays:
In 0.2.0, list methods return paged envelopes:
Single-resource SDK methods continue to return the resource directly:
Agreement list items are summaries. Use getAgreement(id) when you need full agreement JSON, participants, observers, variables, or on-chain context.

Query parameters

Agreement lists support limit, cursor, state, createdAt, updatedAt, and one sort field from createdAt, updatedAt, or displayName. Input history lists support limit, cursor, userId, inputId, status, createdAt, updatedAt, and one sort field from createdAt or updatedAt. Date filters use bracket operators:
Use --globoff with curl when sending bracket query parameters.

Error responses

Errors use a top-level error object:
Branch on error.code and include error.requestId when reporting a failure.