تخطَّ إلى المحتوى

Contracts

Contract creation, participant routing, lifecycle, and evidence APIs.

v1 · 2026-01-15

GET/contractsيتطلب مصادقة

List/search readable contracts

Lists contracts by applying requested filters and then intersecting every result with the current actor's read authorization. Filters such as organization, counterparty, status, participant action, and date range never bypass access control. Default scope is `readable`. Scopes: - `owned`: contracts controlled by the current actor/context - `organization`: contracts controlled by the current acting organization - `shared_with_me`: contracts where the actor has an active viewer access grant - `readable`: all contracts the actor can read via controller, organization membership, signer grant, or viewer grant Platform read access is grant-based. `action="view"` creates read-only platform access; `action="receive_copy"` does not create platform access and does not appear in readable/shared results unless another access grant exists. Examples: - `GET /contracts?scope=readable&status=completed&dateField=completedAt&from=2026-05-01T00:00:00Z&to=2026-05-31T23:59:59Z` - `GET /contracts?scope=shared_with_me` - `GET /contracts?scope=readable&counterpartyOrganizationId=org_123`

المعاملات

الاسمالموضعالنوعمطلوب
scopequerystringلا
statusquerystringلا
dateFieldquerystringلا
fromquerystringلا
toquerystringلا
organizationIdquerystringلا
counterpartyOrganizationIdquerystringلا
participantActionquerystringلا
accessRolequerystringلا
qquerystringلا
limitqueryintegerلا
cursorquerystringلا

الاستجابات

  • 200Contract list
  • defaultStandardized API error
POST/contractsيتطلب مصادقة

Recommended simple happy path - schema-driven create contract with optional participants/role assignment/send

Primary external integrator endpoint for the common flow. Document this operation in two conceptual modes: - Create Draft Contract (`sendNow` omitted or `false`) - Create and Send Contract (`sendNow=true`) In one request, this endpoint can: - create a contract from a template - accept structured `data` generated from template `inputSchema` (recommended) - apply direct `fieldValues` and optional `tableData` (alternate advanced mode) - create participants - auto-assign signer roles using `participants[].templateRoleId` - send immediately when `sendNow=true` Structured data mapping: - request `data` accepts section-based objects from `GET /templates/{id}/published-version` `inputSchema` - field `key` is the canonical submission key inside each section object - server maps `data` internally to contract `fieldValues` and `tableData` - direct `fieldValues` and `tableData` payloads are supported as an alternate advanced mode - in Dynamic Tables V2, `fieldValues` is for non-table fields and table cell values must be provided in `tableData` Role assignment behavior with `participants[].templateRoleId`: - role identity and signature placement are inherited from the template version - participant assignment is set by the provided participant object - `routingOrder` and `providerConfigRef` can be overridden per participant - mismatch cases (unknown role id, invalid routing config, duplicate/invalid bindings) fail with role-binding errors - when `sendNow=true` and explicit `roleBindings` are not supplied, signer participants must provide `templateRoleId`; otherwise the request fails with `CONTRACT_ROLE_BINDING_INVALID` - using `participants[].templateRoleId`, explicit `roleBindings`, `signingSettings`, or `sendNow=true` requires `contracts:send` permission in addition to `contracts:create` Signing execution behavior: - `executionChannel` is valid only when `action="sign"` - `action="sign"` requires `executionChannel` - `action="view"` and `action="receive_copy"` must not include `executionChannel` - person signers (`recipientType="individual"`) may use `platform_hosted` or `integrator_managed` - organization signers (`recipientType="organization"`) must use `provider_managed` `organizationSigningMode` is not writable by this endpoint. It is snapshotted from template version settings during contract creation and defaults to `automatic` when template settings omit it.

جسم الطلب

  • titlestringمطلوب
  • templateIdstringمطلوب
  • templateVersionIdstring
  • dataobjectSchema-driven structured payload aligned with `inputSchema` from `GET /templates/{id}/published-version`. Submit values using each field's canonical `key`. Primary recommended submission mode. Server maps this to contract `fieldValues` and schema-based `tableData`.
  • fieldValuesarrayAlternate direct mode for non-table fields. Dynamic table cells must be provided in `tableData`.
  • tableDataobjectSchema-based dynamic table rows keyed by `tableKey`. Each row must be an object keyed by the dynamic table column keys.
  • participantsarray
  • roleBindingsarray
  • signingSettingsobject
  • sendNowbooleanWhen true, the server prepares the draft contract and sends it in the same request. This is the primary simple integrator path and requires send-level permissions.
  • notificationsobjectOptional per-event email notification override for this contract. Merged into the contract's snapshotted settings on top of platform/organization/template defaults. Omit an event or a setting to inherit the broader default ("inherit" = key absent); set `enabled: false` to explicitly disable an event. Invalid settings (unknown event key or a setting not supported by the event) fail the request before any send with `400` `INVALID_NOTIFICATION_SETTINGS`.

الاستجابات

  • 201Contract created
  • defaultStandardized API error
GET/contracts/{id}يتطلب مصادقة

Get contract details (includes snapshotted organization signing mode)

Returns contract metadata including `organizationSigningMode`. The mode is snapshotted from the selected template version at contract creation time and defaults to `automatic` if missing in template settings.

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 200Contract details
  • defaultStandardized API error
PUT/contracts/{id}/dataيتطلب مصادقة

Update contract field values and optional table data (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

جسم الطلب

  • fieldValuesarrayمطلوب
  • tableDataobject

الاستجابات

  • 200Contract updated
  • defaultStandardized API error
GET/contracts/{id}/documents/artifact-revisionsيتطلب مصادقة

List signed artifact revisions (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 200Artifact revisions
  • defaultStandardized API error
GET/contracts/{id}/documents/artifact-revisions/{revision}/downloadيتطلب مصادقة

Download artifact revision bytes (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم
revisionpathintegerنعم
downloadquerybooleanلا

الاستجابات

  • 200Artifact bytes
  • defaultStandardized API error
GET/contracts/{id}/documents/rendered-unsignedيتطلب مصادقة

Download rendered unsigned PDF

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم
downloadquerybooleanلا

الاستجابات

  • 200PDF bytes
  • defaultStandardized API error
GET/contracts/{id}/documents/signed-latestيتطلب مصادقة

Download signed-latest document

Returns the stored signed PDF when `signedPdfKey` is present on the contract. If no stored signed PDF exists, the endpoint falls back to the current rendered contract version PDF. If neither source is available, returns `404 CONTRACT_SIGNED_DOCUMENT_NOT_AVAILABLE`. Integrators that require a strictly signed artifact should call `/contracts/{id}/documents/signed-only`.

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم
downloadquerybooleanلا

الاستجابات

  • 200PDF bytes
  • defaultStandardized API error
GET/contracts/{id}/documents/signed-onlyيتطلب مصادقة

Download signed PDF only (strict)

Returns only the stored signed artifact for the contract. If no signed artifact exists, returns `404 CONTRACT_SIGNED_DOCUMENT_NOT_AVAILABLE`.

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم
downloadquerybooleanلا

الاستجابات

  • 200Signed PDF bytes
  • defaultStandardized API error
GET/contracts/{id}/evidence/audit-trailيتطلب مصادقة

Get contract audit trail (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 200Audit trail
  • defaultStandardized API error
GET/contracts/{id}/evidence/bundleيتطلب مصادقة

Build and fetch evidence bundle payload (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 200Evidence bundle
  • defaultStandardized API error
POST/contracts/{id}/evidence/bundleيتطلب مصادقة

Persist evidence bundle as artifact revision (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 201Artifact revision created
  • defaultStandardized API error
GET/contracts/{id}/evidence/verificationيتطلب مصادقة

Get contract verification report (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 200Verification report
  • defaultStandardized API error
PUT/contracts/{id}/participantsيتطلب مصادقة

Replace participants for a contract (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

جسم الطلب

  • participantsarrayمطلوب

الاستجابات

  • 200Participants replaced
  • defaultStandardized API error
PUT/contracts/{id}/role-bindingsيتطلب مصادقة

Set role bindings and signing settings (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

جسم الطلب

  • roleBindingsarrayمطلوب
  • signingSettingsobject

الاستجابات

  • 200Role bindings updated
  • defaultStandardized API error
POST/contracts/{id}/sendيتطلب مصادقة

Send contract for signing (advanced; prepares drafts automatically)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

جسم الطلب

  • roleBindingsarray
  • signingSettingsobject
  • notificationsobjectOptional per-event email notification override applied to this send. Same semantics as on contract creation. Invalid settings fail with `400` `INVALID_NOTIFICATION_SETTINGS` before the contract is sent.

الاستجابات

  • 200Contract sent
  • defaultStandardized API error
GET/contracts/{id}/statusيتطلب مصادقة

Primary contract status endpoint (includes lifecycle + signing participant summary)

Preferred polling fallback endpoint when webhook delivery is unavailable. Returns contract status, lifecycle summary, participant-level signing summary, and snapshotted `organizationSigningMode`. The mode is template-version-driven and defaults to `automatic` when not explicitly configured on the template version.

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

الاستجابات

  • 200Contract status
  • defaultStandardized API error
PUT/contracts/{id}/table-dataيتطلب مصادقة

Update schema-based dynamic table rows only (advanced)

المعاملات

الاسمالموضعالنوعمطلوب
idpathstringنعم

جسم الطلب

  • tableDataobjectمطلوب

الاستجابات

  • 200Table data updated
  • defaultStandardized API error