openapi: 3.0.3 info: title: SpotDraft V1 Contract APIs V2.1 Clickwrap API version: v1 x-version: v1 x-logo: url: https://cdn.spotdraft.com/assets/logo-black-new.png backgroundColor: transparent altText: SpotDraft Logo href: https://spotdraft.com x-favicon: https://cdn.spotdraft.com/assets/favicon.png x-footer: © SpotDraft Inc. All rights reserved. description: "# SpotDraft Public API\n\nWelcome to the **SpotDraft Public API**. Use this documentation to authenticate requests, choose the right product workflow, and move from guide content into the endpoint-level API reference.\n\n## Start here\n\nIf you are new to the API, use this sequence:\n\n1. Confirm your **regional base URL / cluster** and authentication headers.\n2. Start with one workflow: Embedded signing, Clickthrough, contract operations, or webhook ingestion.\n3. Use the **API Reference** section for endpoint schemas, request examples, and version-specific details.\n4. Verify redirects, authentication, errors, and webhook validation before going live.\n\n## Quick navigation\n\n| I want to... | Start here |\n| --------------------------------------------------- | ------------------------------------------------------------------------------------ |\n| Authenticate requests and choose the right hostname | [Authentication](/api/docs#description/authentication) |\n| Subscribe to lifecycle events | [Webhooks](/api/docs#description/webhooks) |\n| Understand error behavior and retry logic | [Errors](/api/docs#description/errors) |\n| Embed signing inside my product | [Embedded Contract API](/api/docs#description/embedded-contract-api) |\n| Add pre-acceptance flows with the SDK | [Clickthrough SDK](/api/docs#description/clickthrough-sdk) |\n| Explore the analytics SQL catalog | [Analytics Query Table Catalog](/api/docs#description/analytics-query-table-catalog) |\n| Explore endpoint-level details | [API Reference](/api/docs#tag/v21-contract-apis) |\n\n## Versioning and conventions\n\n- SpotDraft uses **versioning in the path**.\n- Versioning is **scoped to each API family**, not to the full public API surface.\n- Different families currently expose different path versions, including `v1`, `v2`, and `v2.1`.\n- The version in the request path is the contract for that endpoint. Do not infer version availability across unrelated API families.\n- A family can expose only one documented version, even if other families expose newer-looking path versions.\n- Documentation links, tags, and operation references should match the exact versioned path shown in the schema for that endpoint.\n- Composite ids such as `T-123` or `H-123` are identifiers, not plain integers. Send them exactly as documented.\n- Datetimes are returned in ISO 8601 UTC form such as `2025-06-07T00:00:00Z`.\n- Optional fields may be omitted or returned as `null`. Rely on field names and descriptions instead of assuming presence.\n- Pagination uses `page` and `limit`. Version-specific list endpoints document any additional filters or sorting options.\n\n## Base URL and regions\n\nPick the cluster that matches where your SpotDraft workspace is provisioned. The API reference server picker exposes the same four options.\n\n| Region | Domain |\n| ------------------- | ----------------------------------- |\n| IN (India) | `https://api.in.spotdraft.com/api/` |\n| US (United States) | `https://api.us.spotdraft.com/api/` |\n| ME (Middle East) | `https://api.me.spotdraft.com/api/` |\n| EU (European Union) | `https://api.eu.spotdraft.com/api/` |\n\nAlways use **`https://`**. Keep your API calls, webhook configuration, and embedded flows in the same regional cluster where the workspace is provisioned.\n\n## Redirects\n\nThe API commonly returns **`302 Found`** in two cases:\n\n1. **HTTP instead of HTTPS**\n2. **Trailing slash mismatch**\n\nSome HTTP clients do not preserve the original method on redirect. Disable automatic redirects while debugging so you can fix the real URL issue directly.\n\n---\n\n# Authentication\n\nAll API requests must include a **Client ID** in the HTTP headers.\n\n## Authentication quick reference\n\n| Scenario | Required headers |\n| -------- | ---------------- |\n| Server-to-server request | `client-id`, `client-secret` |\n| Act on behalf of a workspace user | `client-id`, `client-secret`, `user-email` |\n| OAuth JWT request | `Authorization: Bearer ` |\n| OAuth JWT request to a dual CLM bearer/OAuth endpoint | `Authorization: Bearer `, `X-SD-Auth-Type: oauth-jwt` |\n| Debugging auth failures | Confirm the workspace region, credential pair, and whether the impersonated user is active |\n\n## Requests as the application\n\nFor server-to-server access, send both **Client ID** and **Client Secret** in headers. SpotDraft audits these calls as the integration, not as a browser user session.\n\n### User impersonation\n\nYou may pass **`user-email`** with the email of a user to act on their behalf. That user must be an active member of the workspace tied to the credentials.\n\nTypical uses:\n\n- respecting per-user permissions\n- user-scoped list endpoints\n- audit attribution\n\nIf you omit **`user-email`**, the integration runs as the user linked to the API credentials.\n\nUse impersonation only when you want permission checks and audit attribution to resolve to a specific workspace user. Keep the credential pair and the selected user in the same workspace and region.\n\n## Header reference\n\n| Type | Header | Value |\n| ---- | ------ | ----- |\n| HEADER | `client-id` | string |\n| HEADER | `client-secret` | string |\n| HEADER | `user-email` | string (optional) |\n| HEADER | `Authorization` | `Bearer ` for OAuth JWT access |\n| HEADER | `X-SD-Auth-Type` | `oauth-jwt` when an endpoint explicitly supports both standard CLM bearer tokens and OAuth JWT bearer tokens |\n\n## OAuth JWT access\n\nOAuth-enabled routes accept a user-scoped OAuth JWT in the standard `Authorization` header:\n\n```http\nAuthorization: Bearer \n```\n\nSome internal routes support both standard CLM bearer tokens and OAuth JWT bearer tokens. For those dual-auth routes, callers must opt into OAuth JWT authentication explicitly:\n\n```http\nAuthorization: Bearer \nX-SD-Auth-Type: oauth-jwt\n```\n\nThis opt-in header prevents Django from treating an OAuth JWT string as a CLM bearer token before OAuth JWT authentication runs. Routes that only declare OAuth JWT authentication continue to use the standard bearer header without the opt-in header. Guide and guideline CRUD endpoints use the dual-auth pattern so existing CLM bearer-token clients continue to work while Sidebar and agent clients can call them with user-scoped OAuth JWTs.\n\n## Interactive auth in the API reference\n\nThe API reference exposes the supported auth mechanisms per endpoint:\n\n- `client-id` + `client-secret` for public API integrations\n- `Bearer ` for OAuth-enabled routes\n- `Bearer ` plus `X-SD-Auth-Type: oauth-jwt` for routes that explicitly support both standard CLM bearer tokens and OAuth JWT bearer tokens\n- clickthrough-specific headers on clickthrough browser endpoints\n\n`user-email` remains an optional request header for impersonation when the endpoint supports client-header authentication.\n\n## Creating credentials\n\nIn SpotDraft, open **Settings → Developer settings**, then **Generate API credential**. Copy the **Client ID** and **Client Secret** at creation time and store them in a secrets manager or password vault.\n\nIf requests fail unexpectedly, first confirm:\n\n- you are calling the correct regional cluster\n- the credential pair belongs to the same workspace\n- any impersonated `user-email` is active in that workspace\n\nReference: [Developer settings](https://help.spotdraft.com/articles/8632014145-developer-settings)\n\n---\n\n# Webhooks\n\nWebhooks notify **your server** when contract lifecycle events happen in SpotDraft. Register one or more **HTTPS endpoints** in **Settings → Developer settings → Webhooks**, choose the event types, and SpotDraft delivers an HTTP `POST` with a JSON payload.\n\nReturn a **`2xx`** response quickly. Queue slow work so timeouts do not count as failed deliveries.\n\n## Delivery requirements\n\n- **HTTPS** with a publicly trusted certificate\n- reliable endpoint behavior\n- support for multiple webhook URLs per account\n- event-type filtering so you only receive what you need\n- fast acknowledgement with asynchronous downstream processing\n\n## Verifying webhooks\n\nUse **`X-SD-WEBHOOK-CONTENT-HASH`** for verification. Validate the raw request body with **HMAC-SHA512** using the `hmac_key` returned by the HMAC key API.\n\n```python\nimport base64\nimport hashlib\nimport hmac\n\nsignature = hmac.new(\n base64.b64decode(sample_hmac_key),\n request.body,\n digestmod=hashlib.sha512,\n).hexdigest()\n\nassert signature == request.headers[\"X-SD-WEBHOOK-CONTENT-HASH\"]\n```\n\nCompare against the **raw** request body bytes before any JSON parsing or normalization.\n\n## Logs and troubleshooting\n\nDeveloper Settings also exposes webhook logs for operational debugging. Use them to:\n\n- search deliveries by contract id\n- inspect the request payload sent by SpotDraft\n- confirm delivery failures before retrying downstream processing\n\nWhen investigating failures, confirm that the destination URL belongs to the same cluster strategy you use for the rest of the integration and that your endpoint returns a `2xx` quickly.\n\n## Common activity types\n\n| `activity` value | When it fires |\n| ---------------- | ------------- |\n| `CONTRACT_CREATED` | A new contract is created |\n| `CONTRACT_SENT_TO_COUNTERPARTY` | Sent for counterparty review / redlining |\n| `CONTRACT_SIGNATURE_REQUESTED` | Marked for signature |\n| `CONTRACT_SIGNED` | Any required signatory completes signing |\n| `CONTRACT_EXECUTED` | All signatures are complete |\n| `CONTRACT_PROCESS_METRIC_UPDATED` | Workflow metrics change |\n\nUse the API reference for version-specific webhook endpoints and sample payload operations.\n\nReference: [Developer settings](https://help.spotdraft.com/articles/8632014145-developer-settings)\n\n---\n\n# Errors\n\nSpotDraft uses conventional HTTP status codes so clients can branch without parsing proprietary error enums first.\n\n## Error handling guidance\n\n- Treat the HTTP status code as the primary branch condition.\n- Parse the response body for fields such as `detail`, `message`, `code`, or field-level validation errors.\n- Preserve the original request URL and method in logs. Redirects and trailing-slash mismatches can otherwise look like unrelated auth or validation problems.\n\n## HTTP status summary\n\n| Code | Meaning |\n| ---- | ------- |\n| `200` | Success |\n| `400` | Invalid or incomplete input |\n| `401` | Credentials missing, expired, or not accepted |\n| `402` | Request failed due to business-rule or workflow state |\n| `403` | Authenticated, but not allowed |\n| `404` | Resource not found or not visible to the caller |\n| `409` | Conflict, duplicate, or version mismatch |\n| `429` | Rate limited |\n| `500`, `502`, `503`, `504` | SpotDraft or upstream infrastructure error |\n\n## Retry guidance\n\n- Retry `429` and `5xx` responses with exponential backoff.\n- Do **not** blindly retry `4xx` responses without fixing the request.\n- Disable automatic redirect following while debugging `302` responses so URL issues are visible.\n\n---\n\n# Embedded Contract API\n\nUse the Embedded Contract flow to create contracts through the Public API and render SpotDraft’s signing experience inside your product with an iframe.\n\n## High-level flow\n\n1. Create the contract with user-supplied data.\n2. Generate a short-lived embedded URL for the counterparty.\n3. Render the iframe.\n4. Listen for `postMessage` events to detect completion, decline, or error states.\n\n## Step 1 — Create a contract\n\nAuthenticate with your application credentials and call the **Create Contract** API using the data you collect in your product.\n\nUse a credential pair linked to the SpotDraft user who should:\n\n- receive notifications\n- appear as the business user when relevant\n- own the integration-level audit trail\n\n## Step 2 — Generate the embed URL\n\nUse the contract id returned by Create Contract together with the counterparty email to call the embedded URL endpoint. Treat the returned URL like a capability token: load it only for the intended user session and avoid logging it without redaction.\n\n## Step 3 — Render the iframe\n\nListen for `postMessage` events from the iframe and validate `event.origin` before trusting them.\n\n| Event | Message name | Payload |\n| ----- | ------------ | ------- |\n| Success | `spotdraft.embedded.sign_successful` | `{ contract_id }` |\n| Declined | `spotdraft.embedded.sign_declined` | `{ contract_id }` |\n| Signing error | `spotdraft.embedded.sign_error` | `{ contract_id, error: { code, upstream_error } }` |\n\n## Integration notes\n\n- Large agreements can take several seconds to render. Show a loader or skeleton state.\n- Keep API calls and embed URLs in the same region as the tenant.\n- Handle iframe close / completion without polling where possible.\n\n---\n\n# Clickthrough SDK\n\nThe **Clickthrough** JavaScript SDK lets you capture recorded acceptance of one or more agreements before a user continues with signup, checkout, or access to a gated feature.\n\n## Prerequisites\n\nBefore integrating, confirm the following in the SpotDraft Clickthrough console:\n\n- Clickthrough is enabled for the workspace\n- the relevant agreements are attached and published\n- your supported domains are allowlisted\n- production pages are served over HTTPS\n- you are using the snippet values for the same regional cluster as your workspace\n\n## Installation\n\n### NPM\n\n```bash\nnpm install @spotdraft/clickwrap-client\n```\n\n### CDN\n\n```html\n\n```\n\n## Initialization\n\n```typescript\nimport { SdClickthrough } from \"@spotdraft/clickwrap-client\";\n\nconst clickthrough = new SdClickthrough({\n clickwrapId: \"CLICKWRAP_ID_FROM_CONSOLE\",\n hostLocationDomId: \"HOST_ELEMENT_DOM_ID\",\n baseUrl: \"BASE_URL_FROM_CONSOLE\",\n});\n\nawait clickthrough.init();\n```\n\nUse the `clickwrapId` and `baseUrl` exactly as provided by the SpotDraft console snippet for that clickthrough.\nFor the latest SDK package details, installation metadata, and published package versions, use the npm package page for `@spotdraft/clickwrap-client`.\n\n## Submit payload\n\n`user_identifier` is the only required payload field for `submit(payload)`. It should uniquely identify the user in your product, such as their email address or mobile number.\n\n```typescript\nconst payload = {\n user_identifier: \"johndoe@example.com\",\n first_name: \"John\",\n last_name: \"Doe\",\n user_email: \"johndoe@example.com\",\n};\n```\n\n## Common methods\n\n| Method | Description |\n| ------ | ----------- |\n| `init()` | Mount embedded UI |\n| `isAccepted()` | Check whether required agreements are accepted |\n| `submit(payload)` | Record acceptance |\n| `openConsentDialog()` | Open modal mode |\n| `closeConsentDialog()` | Close modal mode |\n| `isReacceptanceRequired(id)` | Check whether a user must accept again |\n\n## Common events\n\n| Event | When it fires |\n| ----- | ------------- |\n| `acceptanceToggled` | Aggregate acceptance changed |\n| `acceptanceComplete` | All mandatory agreements are accepted |\n| `cancelClicked` | User dismisses the flow |\n| `sdClickthroughLoaded` | CDN SDK is ready |\n| `sdClickthroughLoadFailed` | CDN SDK failed to load |\n\n## Common setup issue\n\nIf the SDK returns **`Request received from invalid domain`**, the request origin is not allowlisted in Clickthrough settings. Add the full domain, including protocol such as `https://app.example.com`. `localhost` is typically allowlisted for local testing.\n\nUse the API reference for clickthrough endpoints and keep the product console’s **View snippet** output as the source of truth for tenant-specific ids and base URLs.\n\nReferences:\n\n- [@spotdraft/clickwrap-client on npm](https://www.npmjs.com/package/@spotdraft/clickwrap-client)\n- [How to Implement Clickthrough in Your Application](https://help.spotdraft.com/articles/3574375021-how-to-implement-clickthrough-in-your-application)\n- [How to Implement SpotDraft Clickthrough in Mobile Application](https://help.spotdraft.com/articles/9120222930-how-to-implement-spotdraft-clickthrough-in-mobile-application)\n\n---\n\n# Analytics Query Table Catalog\n\n**Dialect:** GoogleSQL (Google Standard SQL).\n\n---\n\n## Using this catalog\n\n| Topic | Behaviour |\n| --- | --- |\n| **Enablement** | The flag `PUBLIC_ANALYTICS_QUERY_API` must be enabled; otherwise the endpoint returns **501**. Contact SpotDraft support. |\n| **Endpoint** | [POST /api/v2.1/public/analytics/query/](#tag/v21-analytics-query/POST/api/v2.1/public/analytics/query/) |\n| **Column names** | Use **snake_case public** names (e.g. `execution_time`, `workflow_id`). |\n| **SQL** | Single `SELECT` (optional `WITH`, `UNION`). |\n| **Contract-scoped rows** | By default limited to contracts the user may access (server `user_access`). Optional `user_scoped` or `X-Spotdraft-Analytics-User-Scoped`; workspace-wide mode requires the workspace Admin role (see API overview). |\n\n---\n\n## Table contents\n\nJump to a table definition:\n\n- [`contracts`](#table-contracts)\n- [`users`](#table-users)\n- [`workflows_setup`](#table-workflows_setup)\n- [`approvals_setup`](#table-approvals_setup)\n- [`contract_types_setup`](#table-contract_types_setup)\n- [`counterparties_setup`](#table-counterparties_setup)\n- [`entities_setup`](#table-entities_setup)\n- [`signatures_setups`](#table-signatures_setups)\n- [`contract_lifecycle`](#table-contract_lifecycle)\n- [`contract_tat_details`](#table-contract_tat_details)\n- [`contract_sign`](#table-contract_sign)\n- [`contract_approvals`](#table-contract_approvals)\n- [`contracts_review`](#table-contracts_review)\n- [`signatories`](#table-signatories)\n- [`contract_level_metrics`](#table-contract_level_metrics)\n- [`contract_level_metrics_lc`](#table-contract_level_metrics_lc)\n- [`legal_intake`](#table-legal_intake)\n\n---\n\n## Dataset overview\n\n| Public table id | Description |\n| --- | --- |\n| `contracts` | Core fact table — one row per contract. Lifecycle timing, negotiation metrics, workflow linkage, counterparty name, entity name, and expiry. |\n| `users` | One row per user — activity, teams, licensing, and account flags. |\n| `workflows_setup` | Frozen (versioned) workflow configuration per workspace. |\n| `approvals_setup` | Approval steps configured within workflow versions. |\n| `contract_types_setup` | Contract type directory per workspace. |\n| `counterparties_setup` | Registered counterparties per workspace. |\n| `entities_setup` | Legal entities (customer signing companies) per workspace. |\n| `signatures_setups` | Signatory slots per workflow version. |\n| `contract_lifecycle` | Core contract register — one row per contract. Volume, status, type, expiry, counterparty, entity, workflow. |\n| `contract_tat_details` | Turnaround time per contract — one row per contract. Lifecycle stage timing, negotiation rounds, ownership. Time columns are in hours (FLOAT64). |\n| `contract_sign` | Signing-stage summary per contract — one row per contract. Signature SLA and pending-signature analysis. Time columns in hours where applicable. |\n| `contract_approvals` | Approval-step detail — one row per approval step per contract. Approval SLA and bottleneck analysis. Time columns in hours. |\n| `contracts_review` | Review-request detail — one row per review instance per contract. Legal workload and review SLA. Time columns in hours (FLOAT64). |\n| `signatories` | Individual signatory records — one row per signatory per contract. Per-signatory analytics. time_to_sign_hours is in hours (FLOAT64). |\n| `contract_level_metrics` | Event-level lifecycle tracking — multiple rows per contract. time_spent_seconds is in seconds (INT64); divide by 3600 for hours. |\n| `contract_level_metrics_lc` | Lifecycle-focused variant of contract_level_metrics — same structure without review_filter, approval_filter, sign_filter. time_spent_seconds in seconds. |\n| `legal_intake` | Legal intake requests — one row per intake item. Legal ops workload and intake SLA. |\n\nPhysical table names and cloud project or dataset identifiers are resolved server-side and are not part of this reference.\n\n---\n\n## `contracts`\n\n\n\nCore fact table — one row per contract. Lifecycle timing, negotiation metrics, workflow linkage, counterparty name, entity name, and expiry.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | Primary key — unique contract identifier |\n| `workspace_id` | `INT64` | Yes | Workspace this contract belongs to |\n| `contract_kind` | `STRING` | Yes | How the contract entered the system |\n| `contract_status` | `STRING` | Yes | Current lifecycle stage |\n| `contract_type_id` | `INT64` | Yes | FK to contract_types_setup |\n| `contract_type` | `STRING` | Yes | Human-readable contract type name |\n| `created_date` | `DATE` | Yes | Date the contract was created |\n| `execution_date` | `DATE` | Yes | Date the contract was fully executed |\n| `expiry_date` | `DATE` | Yes | Expiry or renewal date |\n| `term_length` | `STRING` | Yes | Contract term as text |\n| `counterparty_name` | `STRING` | Yes | Counterparty label on the contract (free text) |\n| `entity_name` | `STRING` | Yes | Signing company / entity name on the contract |\n| `redlining_starts` | `TIMESTAMP` | Yes | When redlining began |\n| `sign_starts` | `TIMESTAMP` | Yes | When signing began |\n| `sign_email_sent` | `TIMESTAMP` | Yes | When the signature request email was sent |\n| `draft_time` | `FLOAT64` | Yes | Days spent in Draft |\n| `redlining_time` | `FLOAT64` | Yes | Total days in Redlining |\n| `client_redlining_time` | `FLOAT64` | Yes | Days redlining on client side |\n| `counterparty_redlining_time` | `FLOAT64` | Yes | Days redlining on counterparty side |\n| `on_hold_time` | `FLOAT64` | Yes | Days spent On Hold |\n| `sign_nego_time` | `FLOAT64` | Yes | Days in sign negotiation |\n| `sign_time` | `FLOAT64` | Yes | Total days in Sign |\n| `sign_approvals` | `FLOAT64` | Yes | Days on sign-stage approvals |\n| `signature_collection` | `FLOAT64` | Yes | Days to collect signatures |\n| `execution_time` | `FLOAT64` | Yes | Total days from created to executed (key metric) |\n| `time_for_reviews` | `FLOAT64` | Yes | Days in internal reviews |\n| `reviews_requested` | `INT64` | Yes | Review requests made |\n| `pending_reviews` | `INT64` | Yes | Reviews still pending |\n| `client_rounds` | `INT64` | Yes | Redline rounds from client |\n| `cp_rounds` | `INT64` | Yes | Redline rounds from counterparty |\n| `turns` | `INT64` | Yes | Total negotiation turns |\n| `on_hold_rounds` | `INT64` | Yes | Times placed on hold |\n| `sign_nego_rounds` | `INT64` | Yes | Rounds of sign negotiation |\n| `contract_ageing_days` | `INT64` | Yes | Days since creation (in-flight) |\n| `sign_pending_with` | `STRING` | Yes | Who signing is pending with |\n| `total_time_to_sign_counterparty_hours` | `FLOAT64` | Yes | Hours counterparty took to sign |\n| `total_time_to_sign_company_hours` | `FLOAT64` | Yes | Hours company took to sign |\n| `pending_counterparty_signatories` | `INT64` | Yes | CP signatories yet to sign |\n| `counterparties_signatory_signed` | `INT64` | Yes | CP signatories who have signed |\n| `company_signatory_signed` | `INT64` | Yes | Company signatories who have signed |\n| `pending_company_signatories` | `INT64` | Yes | Company signatories yet to sign |\n| `frozen_workflow_id` | `INT64` | Yes | Frozen workflow snapshot at creation |\n| `workflow_title_at_creation` | `STRING` | Yes | Frozen workflow title at creation |\n| `workflow_id` | `INT64` | Yes | Current workflow id |\n| `current_workflow_title` | `STRING` | Yes | Current workflow display name |\n\n### Enum values\n\n#### `contract_status`\n\n- `Executed`\n- `Redlining`\n- `Sign`\n- `Draft`\n- `Voided`\n- `On Hold`\n\n#### `contract_kind`\n\n- `Externally Executed Contracts`\n- `Upload Sign Contracts`\n- `Campaign Contracts`\n- `Uploaded for review`\n- `Template Contracts`\n- `Template Contracts (Redlined)`\n- `Clickwrap Contracts`\n- `Express Template Contracts`\n\n#### `sign_pending_with`\n\n- `Executed`\n- `Pending with Counterparty Signatory`\n- `Pending with Company Signatory`\n- `Pending with Counterparty and Company Signatories`\n\n---\n\n## `users`\n\n\n\nOne row per user — activity, teams, licensing, and account flags.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `id` | `INT64` | Yes | Primary key (org_user_id) |\n| `last_activity_date` | `TIMESTAMP` | Yes | Most recent platform activity |\n| `invite_accepted` | `BOOL` | Yes | Invite accepted |\n| `first_login_date` | `TIMESTAMP` | Yes | First login time |\n| `is_active` | `BOOL` | Yes | Account active |\n| `is_deleted` | `BOOL` | Yes | Soft-deleted |\n| `created` | `TIMESTAMP` | Yes | Account created at |\n| `designation` | `STRING` | Yes | Job title / designation |\n| `created_by_workspace_id` | `INT64` | Yes | Workspace the user belongs to |\n| `teams` | `STRING` | Yes | Comma-separated team names |\n| `seniority_level` | `STRING` | Yes | Seniority band |\n| `department` | `STRING` | Yes | Department name |\n| `app_usage_purposes` | `STRING` | Yes | Stated usage purposes |\n| `licensed_user` | `BOOL` | Yes | Consumes a paid seat |\n\n---\n\n## `workflows_setup`\n\n\n\nFrozen (versioned) workflow configuration per workspace.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `workspace_id` | `INT64` | Yes | Workspace id |\n| `frozen_workflow_id` | `INT64` | Yes | Frozen workflow snapshot id (legacy spelling in dataset) |\n| `workflow_id` | `INT64` | Yes | Parent workflow id |\n| `title` | `STRING` | Yes | Workflow display name |\n| `status` | `STRING` | Yes | PUBLISHED / UNPUBLISHED / ARCHIVED |\n| `created` | `TIMESTAMP` | Yes | Version created at |\n| `last_published` | `TIMESTAMP` | Yes | Last published at |\n| `unpublished_changes_present` | `BOOL` | Yes | Draft changes not yet published |\n| `cp_contract_download_permission` | `STRING` | Yes | Counterparty download rights |\n\n### Enum values\n\n#### `status`\n\n- `PUBLISHED`\n- `UNPUBLISHED`\n- `ARCHIVED`\n\n#### `cp_contract_download_permission`\n\n- `ENABLE_PDF_OR_WORD`\n- `ENABLE_PDF_ONLY`\n- `DISABLE_UNTIL_SIGNING`\n- `NULL`\n\n---\n\n## `approvals_setup`\n\n\n\nApproval steps configured within workflow versions.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `approval_id` | `STRING` | Yes | Approval step id |\n| `approval_ver` | `STRING` | Yes | Version string |\n| `id` | `INT64` | Yes | Internal numeric id |\n| `approval_name` | `STRING` | Yes | Step display name |\n| `approval_order` | `INT64` | Yes | Sequence order |\n| `frozen_workflow_id` | `INT64` | Yes | Frozen workflow id |\n| `workflow_id` | `INT64` | Yes | Parent workflow id |\n| `workflow_name` | `STRING` | Yes | Parent workflow name |\n| `status` | `STRING` | Yes | Publication status |\n| `type` | `STRING` | Yes | TEMPLATE_WORKFLOW or UPLOAD_WORKFLOW |\n| `conditional_approval` | `BOOL` | Yes | Conditional step |\n| `workspace_id` | `INT64` | Yes | Workspace id |\n| `role_id` | `INT64` | Yes | Approver role id |\n| `skip_approval_restriction` | `BOOL` | Yes | Skip approvers allowed |\n| `download_contract_restriction` | `BOOL` | Yes | Download blocked during step |\n| `send_to_cp_restriction` | `BOOL` | Yes | Send-to-CP blocked during step |\n\n### Enum values\n\n#### `type`\n\n- `TEMPLATE_WORKFLOW`\n- `UPLOAD_WORKFLOW`\n\n---\n\n## `contract_types_setup`\n\n\n\nContract type directory per workspace.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `workspace_id` | `INT64` | Yes | Workspace id |\n| `contract_type_id` | `INT64` | Yes | Primary key |\n| `contract_type` | `STRING` | Yes | Contract type name |\n\n---\n\n## `counterparties_setup`\n\n\n\nRegistered counterparties per workspace.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `workspace_id` | `INT64` | Yes | Workspace id |\n| `counterparty_name` | `STRING` | Yes | Registered counterparty name |\n| `status` | `STRING` | Yes | ACTIVE / other states |\n\n---\n\n## `entities_setup`\n\n\n\nLegal entities (customer signing companies) per workspace.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `workspace_id` | `INT64` | Yes | Workspace id |\n| `entity_name` | `STRING` | Yes | Display name |\n| `id` | `INT64` | Yes | Entity id |\n| `created` | `TIMESTAMP` | Yes | Created at |\n| `modified` | `TIMESTAMP` | Yes | Last modified at |\n| `is_primary` | `BOOL` | Yes | Primary entity flag |\n| `is_deleted` | `BOOL` | Yes | Soft delete |\n| `jurisdiction_id` | `INT64` | Yes | Jurisdiction id |\n| `organization_id` | `INT64` | Yes | Parent organization id |\n| `organization_type_id` | `INT64` | Yes | Organization type id |\n\n---\n\n## `signatures_setups`\n\n\n\nSignatory slots per workflow version.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `default_signature_id` | `INT64` | Yes | Signatory slot id |\n| `type` | `STRING` | Yes | COUNTER_PARTY or CREATOR_PARTY |\n| `name` | `STRING` | Yes | Signatory label |\n| `sign_order` | `INT64` | Yes | Signing order |\n| `created` | `TIMESTAMP` | Yes | Created at |\n| `workspace_id` | `INT64` | Yes | Workspace id |\n| `workflow_id` | `INT64` | Yes | Workflow id |\n| `conditional_signatory` | `BOOL` | Yes | Conditional signatory |\n| `conditional_routing` | `BOOL` | Yes | Conditional routing |\n\n### Enum values\n\n#### `type`\n\n- `COUNTER_PARTY`\n- `CREATOR_PARTY`\n\n---\n\n## `contract_lifecycle`\n\n\n\nCore contract register — one row per contract. Volume, status, type, expiry, counterparty, entity, workflow.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | Primary key — unique contract identifier |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `created_date` | `DATE` | Yes | Contract creation date |\n| `contract_kind` | `STRING` | Yes | How contract entered the system |\n| `contract_type_id` | `INT64` | Yes | FK to contract type |\n| `contract_status` | `STRING` | Yes | Current lifecycle status |\n| `contract_name` | `STRING` | Yes | Name/title of the contract |\n| `contract_type` | `STRING` | Yes | Contract category label |\n| `template_name` | `STRING` | Yes | Template used (NULL for uploaded contracts) |\n| `execution_date` | `DATE` | Yes | Date contract was fully executed |\n| `term_length` | `STRING` | Yes | Contract duration as text |\n| `expiry_date` | `DATE` | Yes | Expiry or renewal date |\n| `post_execution_status` | `STRING` | Yes | Post-execution classification |\n| `execution_status` | `STRING` | Yes | Execution classification |\n| `counterparty_name` | `STRING` | Yes | Counterparty name |\n| `entity_name` | `STRING` | Yes | Company entity signing the contract |\n| `legal_owner` | `STRING` | Yes | Legal team member responsible |\n| `business_owner` | `STRING` | Yes | Business-side owner |\n| `business_owner_teams` | `STRING` | Yes | Comma-separated teams of the business owner |\n| `created_by_user_id` | `INT64` | Yes | org_user_id of contract creator |\n| `workflow_title_at_creation` | `STRING` | Yes | Workflow snapshot name used at contract creation |\n| `current_workflow_title` | `STRING` | Yes | Current active workflow name |\n| `workflow_id` | `INT64` | Yes | FK to workflow |\n\n### Enum values\n\n#### `contract_status`\n\n- `Executed`\n- `Redlining`\n- `Sign`\n- `Draft`\n- `Voided`\n- `On Hold`\n\n#### `contract_kind`\n\n- `Template Contracts`\n- `Template Contracts (Redlined)`\n- `Uploaded for review`\n- `Upload Sign Contracts`\n- `Externally Executed Contracts`\n- `Campaign Contracts`\n- `Clickwrap Contracts`\n- `Express Template Contracts`\n\n#### `post_execution_status`\n\n- `Active Contracts`\n- `Executed Contracts, no Expiry date`\n- `Expired Contracts`\n\n#### `execution_status`\n\n- `Executed`\n- `Not Yet Executed`\n\n---\n\n## `contract_tat_details`\n\n\n\nTurnaround time per contract — one row per contract. Lifecycle stage timing, negotiation rounds, ownership. Time columns are in hours (FLOAT64).\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `contract_name` | `STRING` | Yes | Contract name |\n| `contract_kind` | `STRING` | Yes | How contract entered the system |\n| `contract_type` | `STRING` | Yes | Contract category |\n| `template_name` | `STRING` | Yes | Template used |\n| `contract_status` | `STRING` | Yes | Current status |\n| `created_at` | `TIMESTAMP` | Yes | When contract was created |\n| `redlining_started_at` | `TIMESTAMP` | Yes | When redlining stage began |\n| `signing_started_at` | `TIMESTAMP` | Yes | When signing stage began |\n| `executed_at` | `TIMESTAMP` | Yes | When contract was executed |\n| `draft_time_hours` | `FLOAT64` | Yes | Hours spent in Draft stage |\n| `redlining_time_hours` | `FLOAT64` | Yes | Total hours in Redlining |\n| `client_redlining_time_hours` | `FLOAT64` | Yes | Hours of redlining attributed to client side |\n| `counterparty_redlining_time_hours` | `FLOAT64` | Yes | Hours of redlining attributed to counterparty |\n| `on_hold_time_hours` | `FLOAT64` | Yes | Hours spent On Hold |\n| `sign_negotiation_time_hours` | `FLOAT64` | Yes | Hours in sign negotiation phase |\n| `sign_time_hours` | `FLOAT64` | Yes | Total hours in Sign stage |\n| `sign_approval_time_hours` | `FLOAT64` | Yes | Hours spent on sign-stage approvals |\n| `signature_collection_time_hours` | `FLOAT64` | Yes | Hours to collect all signatures |\n| `total_execution_time_hours` | `FLOAT64` | Yes | Total hours from creation to execution |\n| `review_time_hours` | `FLOAT64` | Yes | Hours in internal reviews |\n| `reviews_requested_count` | `INT64` | Yes | Number of review requests made |\n| `pending_reviews_count` | `INT64` | Yes | Reviews still outstanding |\n| `client_redline_rounds` | `INT64` | Yes | Redline turns initiated by client |\n| `counterparty_redline_rounds` | `INT64` | Yes | Redline turns initiated by counterparty |\n| `total_negotiation_turns` | `INT64` | Yes | Total negotiation turns |\n| `on_hold_rounds` | `INT64` | Yes | Times placed On Hold |\n| `sign_negotiation_rounds` | `INT64` | Yes | Rounds of sign negotiation |\n| `is_tat_pending` | `INT64` | Yes | 1 = in-progress, 0 = complete |\n| `counterparty_name` | `STRING` | Yes | Counterparty name |\n| `entity_name` | `STRING` | Yes | Company entity |\n| `legal_owner` | `STRING` | Yes | Legal team owner |\n| `business_owner` | `STRING` | Yes | Business-side owner |\n| `business_owner_teams` | `STRING` | Yes | Teams of the business owner |\n| `workflow_title_at_creation` | `STRING` | Yes | Workflow used at contract creation |\n| `current_workflow_title` | `STRING` | Yes | Current workflow name |\n| `workflow_id` | `INT64` | Yes | FK to workflow |\n\n### Enum values\n\n#### `contract_status`\n\n- `Executed`\n- `Redlining`\n- `Sign`\n- `Draft`\n- `Voided`\n- `On Hold`\n\n#### `contract_kind`\n\n- `Template Contracts`\n- `Template Contracts (Redlined)`\n- `Uploaded for review`\n- `Upload Sign Contracts`\n- `Externally Executed Contracts`\n- `Campaign Contracts`\n- `Clickwrap Contracts`\n- `Express Template Contracts`\n\n---\n\n## `contract_sign`\n\n\n\nSigning-stage summary per contract — one row per contract. Signature SLA and pending-signature analysis. Time columns in hours where applicable.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `contract_type` | `STRING` | Yes | Contract category |\n| `template_name` | `STRING` | Yes | Template used |\n| `counterparty_name` | `STRING` | Yes | Counterparty name |\n| `contract_name` | `STRING` | Yes | Contract name |\n| `created_date` | `DATE` | Yes | Contract creation date |\n| `execution_date` | `DATE` | Yes | Execution date |\n| `legal_owner` | `STRING` | Yes | Legal team owner |\n| `business_owner` | `STRING` | Yes | Business-side owner |\n| `workflow_status` | `STRING` | Yes | Workflow state |\n| `signing_started_at` | `TIMESTAMP` | Yes | When signing stage began |\n| `first_sign_request_sent_at` | `TIMESTAMP` | Yes | When first signature request was sent |\n| `pending_counterparty_signatories_count` | `INT64` | Yes | CP signatories yet to sign |\n| `counterparty_signatories_signed_count` | `INT64` | Yes | CP signatories who have signed |\n| `counterparty_total_signing_time_hours` | `FLOAT64` | Yes | Total hours for CP signatories to sign |\n| `counterparty_avg_signing_time_hours` | `FLOAT64` | Yes | Avg hours per CP signatory |\n| `pending_company_signatories_count` | `INT64` | Yes | Internal signatories yet to sign |\n| `company_signatories_signed_count` | `INT64` | Yes | Internal signatories who have signed |\n| `company_total_signing_time_hours` | `FLOAT64` | Yes | Total hours for internal signatories to sign |\n| `company_avg_signing_time_hours` | `FLOAT64` | Yes | Avg hours per internal signatory |\n| `signing_pending_with` | `STRING` | Yes | Who signing is currently pending with |\n\n### Enum values\n\n#### `signing_pending_with`\n\n- `Executed`\n- `Pending with Counterparty Signatory`\n- `Pending with Company Signatory`\n- `Pending with Counterparty and Company Signatories`\n\n---\n\n## `contract_approvals`\n\n\n\nApproval-step detail — one row per approval step per contract. Approval SLA and bottleneck analysis. Time columns in hours.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `approval_instance_id` | `STRING` | Yes | Unique ID for this approval step instance |\n| `approval_step_name` | `STRING` | Yes | Name of the approval step |\n| `approval_step_category` | `STRING` | Yes | Sub-category of the approval step |\n| `contract_type` | `STRING` | Yes | Contract category |\n| `contract_kind` | `STRING` | Yes | How contract entered the system |\n| `contract_name` | `STRING` | Yes | Contract name |\n| `contract_status` | `STRING` | Yes | Current contract status |\n| `contract_created_date` | `DATE` | Yes | Contract creation date |\n| `contract_created_month` | `DATE` | Yes | First day of month contract was created |\n| `contract_created_by` | `STRING` | Yes | Who created the contract |\n| `approval_status` | `STRING` | Yes | Status of this approval step |\n| `last_requested_by` | `STRING` | Yes | Who most recently requested approval |\n| `last_approved_by` | `STRING` | Yes | Who most recently approved |\n| `first_requested_date` | `DATE` | Yes | When approval was first requested |\n| `last_requested_date` | `DATE` | Yes | Most recent approval request date |\n| `completed_date` | `DATE` | Yes | When approval was completed |\n| `first_response_time_hours` | `FLOAT64` | Yes | Hours for first approval response |\n| `total_approval_time_hours` | `FLOAT64` | Yes | Total approval time (including skips) |\n| `total_approval_time_hours_excl_skips` | `FLOAT64` | Yes | Total approval time (excluding skips) |\n| `approval_instances_count` | `INT64` | Yes | Total approval instances |\n| `approval_instances_count_excl_skips` | `INT64` | Yes | Approval instances excluding skips |\n| `active_approvals_count` | `INT64` | Yes | Currently active approval count |\n| `pending_with` | `STRING` | Yes | Who currently holds the approval |\n| `pending_since_days` | `INT64` | Yes | Days this approval has been pending |\n| `counterparty_name` | `STRING` | Yes | Counterparty name |\n| `entity_name` | `STRING` | Yes | Company entity |\n| `legal_owner` | `STRING` | Yes | Legal team owner |\n| `business_owner` | `STRING` | Yes | Business-side owner |\n| `business_owner_teams` | `STRING` | Yes | Teams of the business owner |\n| `workflow_title_at_creation` | `STRING` | Yes | Workflow used at contract creation |\n| `current_workflow_title` | `STRING` | Yes | Current workflow name |\n| `workflow_id` | `INT64` | Yes | FK to workflow |\n\n### Enum values\n\n#### `approval_status`\n\n- `Approved`\n- `Pending`\n- `Skipped`\n- `Rejected`\n\n---\n\n## `contracts_review`\n\n\n\nReview-request detail — one row per review instance per contract. Legal workload and review SLA. Time columns in hours (FLOAT64).\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `review_id` | `STRING` | Yes | Unique review instance ID |\n| `review_step_name` | `STRING` | Yes | Name of the review step |\n| `review_instance_number` | `INT64` | Yes | Instance number (1 = first review on this contract) |\n| `contract_created_date` | `DATE` | Yes | Contract creation date |\n| `contract_type` | `STRING` | Yes | Contract category |\n| `contract_kind` | `STRING` | Yes | How contract entered the system |\n| `review_assignment_type` | `STRING` | Yes | Role or User assignment |\n| `review_status` | `STRING` | Yes | Current review status |\n| `workflow_status` | `STRING` | Yes | Workflow state of the contract |\n| `requested_by` | `STRING` | Yes | Who requested the review |\n| `requested_at` | `TIMESTAMP` | Yes | When review was requested |\n| `assigned_at` | `TIMESTAMP` | Yes | When review was assigned |\n| `started_at` | `TIMESTAMP` | Yes | When reviewer began working |\n| `completed_at` | `TIMESTAMP` | Yes | When review was marked complete |\n| `first_response_time_hours` | `FLOAT64` | Yes | Hours from request to first response |\n| `time_since_first_response_hours` | `FLOAT64` | Yes | Hours from first response to completion |\n| `total_review_time_hours` | `FLOAT64` | Yes | Total review time in hours |\n| `on_hold_time_hours` | `FLOAT64` | Yes | Hours review was on hold |\n| `assigned_by` | `STRING` | Yes | Who assigned the reviewer |\n| `reviewer_name` | `STRING` | Yes | Legal team member who reviewed |\n| `reviewer_user_id` | `INT64` | Yes | org_user_id of reviewer |\n| `created_by_user_id` | `INT64` | Yes | org_user_id of contract creator |\n| `reviewer_team` | `STRING` | Yes | Legal team that handled the review |\n| `requested_month` | `DATE` | Yes | First day of month review was requested |\n| `completed_month` | `DATE` | Yes | First day of month review was completed |\n| `legal_owner` | `STRING` | Yes | Legal team owner |\n| `business_owner` | `STRING` | Yes | Business-side owner |\n| `entity_name` | `STRING` | Yes | Company entity |\n| `counterparty_name` | `STRING` | Yes | Counterparty name |\n| `pending_since_days` | `INT64` | Yes | Days review has been pending |\n| `workflow_title_at_creation` | `STRING` | Yes | Workflow used at contract creation |\n| `current_workflow_title` | `STRING` | Yes | Current workflow name |\n| `workflow_id` | `INT64` | Yes | FK to workflow |\n\n### Enum values\n\n#### `review_status`\n\n- `Review Completed`\n- `Review not yet assigned`\n- `Review in Progress`\n- `Pending`\n\n#### `review_assignment_type`\n\n- `Role`\n- `User`\n\n---\n\n## `signatories`\n\n\n\nIndividual signatory records — one row per signatory per contract. Per-signatory analytics. time_to_sign_hours is in hours (FLOAT64).\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `signatory_id` | `INT64` | Yes | Unique signatory record |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `user_id` | `INT64` | Yes | FK to internal user (NULL for external signatories) |\n| `signatory_name` | `STRING` | Yes | Name of the signatory |\n| `signatory_party` | `STRING` | Yes | COUNTER_PARTY or CREATOR_PARTY |\n| `signing_order` | `INT64` | Yes | Position in signing sequence |\n| `sign_status` | `STRING` | Yes | Current signing status |\n| `created_at` | `TIMESTAMP` | Yes | When signatory was added |\n| `signing_started_at` | `TIMESTAMP` | Yes | When this signatory's turn began |\n| `sign_request_sent_at` | `TIMESTAMP` | Yes | When sign request was sent |\n| `signed_at` | `TIMESTAMP` | Yes | When they signed |\n| `time_to_sign_hours` | `FLOAT64` | Yes | Hours from request sent to signature |\n| `contract_kind` | `STRING` | Yes | How contract entered the system |\n| `contract_type` | `STRING` | Yes | Contract category |\n| `template_name` | `STRING` | Yes | Template used |\n| `contract_name` | `STRING` | Yes | Contract name |\n| `contract_created_date` | `DATE` | Yes | Contract creation date |\n| `execution_date` | `DATE` | Yes | Contract execution date |\n| `counterparty_name` | `STRING` | Yes | Counterparty name |\n| `legal_owner` | `STRING` | Yes | Legal team owner |\n| `business_owner` | `STRING` | Yes | Business-side owner |\n| `workflow_status` | `STRING` | Yes | Workflow state |\n| `signature_service` | `STRING` | Yes | Connected integration name |\n| `workflow_title_at_creation` | `STRING` | Yes | Workflow used at contract creation |\n| `current_workflow_title` | `STRING` | Yes | Current workflow name |\n| `workflow_id` | `INT64` | Yes | FK to workflow |\n\n### Enum values\n\n#### `signatory_party`\n\n- `COUNTER_PARTY`\n- `CREATOR_PARTY`\n\n#### `sign_status`\n\n- `Signed`\n- `Pending`\n- `Declined`\n- `Bounced`\n\n#### `signature_service`\n\n- `SpotSign`\n- `DocuSign`\n- `AdobeSign`\n- `ZohoSign`\n\n---\n\n## `contract_level_metrics`\n\n\n\nEvent-level lifecycle tracking — multiple rows per contract. time_spent_seconds is in seconds (INT64); divide by 3600 for hours. \n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter (maps from created_by_workspace_id) |\n| `event_id` | `STRING` | Yes | Unique event instance ID |\n| `event_sequence` | `STRING` | Yes | Sequence ordering of events |\n| `event_category` | `STRING` | Yes | High-level event type |\n| `event_subcategory_1` | `STRING` | Yes | Event sub-category level 1 |\n| `event_subcategory_2` | `STRING` | Yes | Event sub-category level 2 |\n| `status` | `STRING` | Yes | Status during this interval |\n| `started_at` | `TIMESTAMP` | Yes | Start of this time interval |\n| `ended_at` | `TIMESTAMP` | Yes | End of this interval (historical) |\n| `ended_at_current` | `TIMESTAMP` | Yes | End of interval (current; may be ongoing) |\n| `time_spent_seconds` | `INT64` | Yes | Time spent in this state, in seconds |\n| `party_type` | `STRING` | Yes | Internal or External party |\n| `review_filter` | `STRING` | Yes | Review stage filter flag |\n| `approval_filter` | `STRING` | Yes | Approval stage filter flag |\n| `sign_filter` | `STRING` | Yes | Sign stage filter flag |\n\n---\n\n## `contract_level_metrics_lc`\n\n\n\nLifecycle-focused variant of contract_level_metrics — same structure without review_filter, approval_filter, sign_filter. time_spent_seconds in seconds.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `contract_id` | `INT64` | Yes | FK to lifecycle table |\n| `workspace_id` | `INT64` | Yes | Workspace filter (maps from created_by_workspace_id) |\n| `event_id` | `STRING` | Yes | Unique event instance ID |\n| `event_sequence` | `STRING` | Yes | Sequence ordering of events |\n| `event_category` | `STRING` | Yes | High-level event type |\n| `event_subcategory_1` | `STRING` | Yes | Event sub-category level 1 |\n| `event_subcategory_2` | `STRING` | Yes | Event sub-category level 2 |\n| `status` | `STRING` | Yes | Status during this interval |\n| `started_at` | `TIMESTAMP` | Yes | Start of interval |\n| `ended_at` | `TIMESTAMP` | Yes | End of interval (historical) |\n| `ended_at_current` | `TIMESTAMP` | Yes | End of interval (current) |\n| `time_spent_seconds` | `INT64` | Yes | Time in state, in seconds |\n| `party_type` | `STRING` | Yes | Internal or External |\n\n---\n\n## `legal_intake`\n\n\n\nLegal intake requests — one row per intake item. Legal ops workload and intake SLA.\n\n### Schema\n\n| Column | Type | Nullable | Description |\n| --- | --- | --- | --- |\n| `intake_id` | `INT64` | Yes | Unique intake item ID |\n| `workspace_id` | `INT64` | Yes | Workspace filter key |\n| `title` | `STRING` | Yes | Intake request title |\n| `created_at` | `TIMESTAMP` | Yes | When intake was created |\n| `status` | `STRING` | Yes | Current status |\n| `priority` | `STRING` | Yes | Priority level |\n| `due_date` | `DATE` | Yes | Target completion date |\n| `completed_at` | `TIMESTAMP` | Yes | When marked complete |\n| `requested_by` | `STRING` | Yes | Who submitted the intake |\n| `assignee` | `STRING` | Yes | Who is responsible |\n| `workflow_name` | `STRING` | Yes | Associated workflow, if any |\n| `linked_entity_type` | `STRING` | Yes | Type of linked entity (e.g. contract) |\n| `linked_entity_id` | `STRING` | Yes | ID of the linked entity |\n| `pending_with` | `STRING` | Yes | Who the intake is pending with |\n| `completion_time_days` | `FLOAT64` | Yes | Days taken to complete |\n| `completion_time_hours` | `FLOAT64` | Yes | Hours taken to complete |\n| `pending_since_hours` | `FLOAT64` | Yes | Hours since intake was last actioned |\n| `pending_since_days` | `FLOAT64` | Yes | Days since intake was last actioned |\n\n### Enum values\n\n#### `status`\n\n- `Completed`\n- `Pending`\n- `In Progress`\n- `Cancelled`\n\n#### `priority`\n\n- `High`\n- `Medium`\n- `Low`\n\n---\n\n## Join map\n\n```\ncontracts.workflow_id ─────────────► workflows_setup.workflow_id\ncontracts.frozen_workflow_id ───────► workflows_setup.frozen_workflow_id\ncontracts.contract_type_id ─────────► contract_types_setup.contract_type_id\ncontracts.counterparty_name ────────► counterparties_setup.counterparty_name (join on public name)\nworkflows_setup.frozen_workflow_id ─► approvals_setup.frozen_workflow_id\nworkflows_setup.workflow_id ────────► signatures_setups.workflow_id\n\ncontract_lifecycle.contract_id ─────► contract_tat_details.contract_id\ncontract_lifecycle.contract_id ─────► contract_sign.contract_id\ncontract_lifecycle.contract_id ─────► contract_approvals.contract_id\ncontract_lifecycle.contract_id ─────► contracts_review.contract_id\ncontract_lifecycle.contract_id ─────► signatories.contract_id\ncontract_lifecycle.contract_id ─────► contract_level_metrics.contract_id\ncontract_lifecycle.contract_id ─────► contract_level_metrics_lc.contract_id\n```\n\nUse **public** column names in SQL. Table references may use bare catalog names (e.g. `contracts`); matching is case-insensitive." servers: - url: https://api.eu.spotdraft.com description: Europe - url: https://api.in.spotdraft.com description: India - url: https://api.us.spotdraft.com description: United States - url: https://api.me.spotdraft.com description: Middle East tags: - name: V2.1 Clickwrap description: Clickwrap agreement preview, consent status, and contract creation endpoints. paths: /api/v2.1/public/clickwrap/{clickwrap_id}/agreements/preview/: post: operationId: v2.1_public_clickwrap_agreements_preview_create description: 'Generates an HTML preview of a clickwrap agreement for the given clickwrap. Exposed on the **public** API so custom scripts can run under the clickwrap/CSP domain instead of the main app domain.' summary: Preview Clickwrap Agreement parameters: - in: path name: clickwrap_id schema: type: integer description: Numeric id of the clickwrap. required: true tags: - V2.1 Clickwrap requestBody: content: application/json: schema: $ref: '#/components/schemas/ClickwrapAgreementPreviewRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/ClickwrapAgreementPreviewRequest' multipart/form-data: schema: $ref: '#/components/schemas/ClickwrapAgreementPreviewRequest' required: true security: - {} responses: '200': content: application/json: schema: type: string description: Rendered HTML preview (`text/html`). x-tagGroup: Clickwrap /api/v2.1/public/clickwrap/{clickwrap_public_id}/: get: operationId: v2.1_public_clickwrap_retrieve description: Returns the clickwrap corresponding to the clickwrap public id summary: Get Clickwrap parameters: - in: path name: clickwrap_public_id schema: type: string format: uuid description: Public Id of Clickwrap required: true tags: - V2.1 Clickwrap security: - ClickwrapId: [] Origin: [] - {} responses: '200': content: application/json: schema: $ref: '#/components/schemas/ClickwrapPublicGetAPIResponse' description: Success '404': content: application/json: schema: type: object properties: detail: type: string description: Clickwrap agreement not found description: Not Found x-tagGroup: Clickwrap /api/v2.1/public/clickwrap/{clickwrap_public_id}/consent_status/: post: operationId: v2.1_public_clickwrap_consent_status_create description: "\nUsed to know if a particular user has given consent to a specific clickwrap.\n\nReturns one of the following values as consent status for the user.\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Status field value\n Details\n
NOT_ACCEPTEDWhen the user hasn’t accepted this clickwrap before.
ACCEPTED_OLDER_VERSIONWhen the user has accepted the clickwrap, but a new published version exists.
ACCEPTED_LATEST_VERSIONWhen the user has accepted the latest published version of the clickwrap.
\n" summary: Get Consent Status parameters: - in: path name: clickwrap_public_id schema: type: string format: uuid description: Public Id of Clickwrap required: true tags: - V2.1 Clickwrap requestBody: content: application/json: schema: $ref: '#/components/schemas/PublicGetClickwrapConsentStatusRequestData' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PublicGetClickwrapConsentStatusRequestData' multipart/form-data: schema: $ref: '#/components/schemas/PublicGetClickwrapConsentStatusRequestData' required: true security: - ClientId: [] ClientSecret: [] - ClickwrapId: [] Origin: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PublicClickwrapConsentStatusResponse' description: Success x-tagGroup: Clickwrap /api/v2.1/public/clickwrap/{clickwrap_public_id}/execute/: post: operationId: v2.1_public_clickwrap_execute_create description: Creates the clickwrap contract summary: Create Clickwrap Contract parameters: - in: path name: clickwrap_public_id schema: type: string format: uuid description: Public Id of Clickwrap required: true tags: - V2.1 Clickwrap requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateClickwrapContractRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CreateClickwrapContractRequest' multipart/form-data: schema: $ref: '#/components/schemas/CreateClickwrapContractRequest' required: true security: - ClickwrapId: [] Origin: [] - {} responses: '201': content: application/json: schema: $ref: '#/components/schemas/ContractMinimalResponseV2' description: Created x-tagGroup: Clickwrap components: schemas: ClickwrapConsentStatus: enum: - NOT_ACCEPTED - ACCEPTED_OLDER_VERSION - ACCEPTED_LATEST_VERSION title: ClickwrapConsentStatus type: string ContractMinimalResponseV2ContractKindEnum: enum: - TEMPLATE - TEMPLATE_EDITABLE - UPLOAD_EDITABLE - UPLOAD_SIGN - UPLOAD_EXECUTED - EXPRESS_TEMPLATE - CLICKWRAP - HISTORICAL_CLICKWRAP type: string PublicGetClickwrapConsentStatusRequestData: examples: - user_identifier: 10f9a299-9e9a-4bc9-9299-5b89bc06d370 properties: user_identifier: description: An identifier for the user whose consent status is being queried. minLength: 1 title: User Identifier type: string required: - user_identifier title: PublicGetClickwrapConsentStatusRequestData type: object ClickwrapPublicGetAPIResponse: properties: id: title: Id type: integer name: minLength: 1 title: Name type: string description: minLength: 1 title: Description type: string created_by_org_user: $ref: '#/components/schemas/OrgUserMinimalDomainModel' updated_by_org_user_at: title: Updated By Org User At type: string agreements: items: $ref: '#/components/schemas/AgreementClickwrapGetAPIResponse' title: Agreements type: array public_id: format: uuid4 title: Public Id type: string contract_type_id: title: Contract Type Id type: integer settings: $ref: '#/components/schemas/ClickwrapSettingsPublicResponse' required: - id - name - description - created_by_org_user - updated_by_org_user_at - agreements - public_id - contract_type_id - settings title: ClickwrapPublicGetAPIResponse type: object WorkflowStatusEnum: enum: - DRAFT - INVITE_CLIENT - INFO_COLLECTION - CONTRACT_APPROVAL - CONTRACT_DRAFT_APPROVAL - CONTRACT_APPROVAL_REJECTED - REVIEW - SIGN - COMPLETING - COMPLETED - TEMPLATE_PRE_SIGN_APPROVAL type: string ContractDisplayStatusEnum: enum: - DRAFT - REDLINING - SIGN - EXECUTED - ON_HOLD - VOIDED type: string ClickwrapAgreementPreviewRequest: title: ClickwrapAgreementPreviewRequest type: object properties: auth_user_id: title: Auth User Id description: Authenticated user id under whose context the agreement preview should be rendered. type: integer workspace_id: title: Workspace Id description: Workspace id that owns the clickwrap agreement. type: integer org_user_id: title: Org User Id description: Workspace membership id for the authenticated user. type: integer agreement_id: title: Agreement Id description: Agreement id to preview. type: integer name: title: Name description: Agreement name shown in the preview. type: string html_content: title: Html Content description: Rendered agreement HTML that should be previewed. type: string required: - auth_user_id - workspace_id - org_user_id - agreement_id - name - html_content PublicClickwrapConsentStatusResponse: example: status: NOT_ACCEPTED properties: status: $ref: '#/components/schemas/ClickwrapConsentStatus' trigger_acceptance: title: Trigger Acceptance type: boolean required: - status - trigger_acceptance title: PublicClickwrapConsentStatusResponse type: object ClickwrapWithVersionGetAPIResponse: properties: id: title: Id type: integer name: minLength: 1 title: Name type: string status: anyOf: - $ref: '#/components/schemas/ClickwrapAgreementVersionStatusType' - type: 'null' default: null modified_by_org_user_at: title: Modified By Org User At type: string version_number: title: Version Number type: integer sub_version_number: title: Sub Version Number type: integer public_url: anyOf: - format: uri minLength: 1 type: string - type: 'null' default: null title: Public Url full_version_number: minLength: 1 readOnly: true title: Full Version Number type: string required: - id - name - modified_by_org_user_at - version_number - sub_version_number - full_version_number title: ClickwrapWithVersionGetAPIResponse type: object OrgUserMinimalDomainModel: properties: id: title: Id type: integer name: title: Name type: string email: title: Email type: string designation: anyOf: - type: string - type: 'null' default: null title: Designation auth_user_id: anyOf: - type: integer - type: 'null' default: null title: Auth User Id required: - id - name - email title: OrgUserMinimalDomainModel type: object ClickwrapAgreementVersionStatusType: enum: - PUBLISHED - DRAFT - PAST_PUBLISHED title: ClickwrapAgreementVersionStatusType type: string ClickwrapType: enum: - SINGLE_CHECKBOX - MULTIPLE_CHECKBOX - INLINE title: ClickwrapType type: string CreateClickwrapContractRequest: title: CreateClickwrapContractRequest type: object properties: clickwrap_public_id: title: Clickwrap Public Id description: Public clickwrap id that identifies the clickwrap experience. type: string format: uuid user_identifier: title: User Identifier description: Your stable identifier for the end user accepting the clickwrap, such as an email address or application user id. type: string clickwrap_id: title: Clickwrap Id description: Internal clickwrap id resolved by SpotDraft for the requested public clickwrap. type: integer first_name: title: First Name description: Optional first name for the accepting user. type: string last_name: title: Last Name description: Optional last name for the accepting user. type: string user_email: title: User Email description: Optional email address for the accepting user. type: string ip_address: title: Ip Address description: IP address captured for the acceptance event. type: string additional_custom_information: title: Additional Custom Information description: Optional custom key-value metadata to store alongside the acceptance record. type: object key_pointer_information: title: Key Pointer Information description: Optional structured values to populate contract metadata fields during clickwrap contract creation. type: object agreements: title: Agreements description: Agreement versions the user is accepting as part of this clickwrap execution. minItems: 1 type: array items: title: CreateClickwrapContractAgreementVersionRequest type: object properties: id: title: Id description: Agreement id included in the clickwrap execution request. type: integer version_id: title: Version Id description: Published agreement version id the user is accepting. type: integer has_clicked: title: Has Clicked description: Whether the user opened or interacted with this agreement before acceptance. default: false type: boolean required: - id - version_id external_metadata: title: External Metadata description: Optional external-system metadata to associate with the created clickwrap contract. type: object required: - clickwrap_public_id - user_identifier - clickwrap_id - agreements EditorClientEnum: enum: - ONLY_OFFICE_NATIVE - WOPI - UNSET type: string ClickwrapSettingsPublicResponse: properties: type: $ref: '#/components/schemas/ClickwrapType' whitelisted_domains: default: [] items: type: string title: Whitelisted Domains type: array allow_all_domains: default: false title: Allow All Domains type: boolean clickwrap_texts: items: minLength: 1 type: string title: Clickwrap Texts type: array clickwrap_texts_raw: items: type: object title: Clickwrap Texts Raw type: array required: - type - clickwrap_texts - clickwrap_texts_raw title: ClickwrapSettingsPublicResponse type: object AgreementClickwrapGetAPIResponse: properties: id: title: Id type: integer current_version: $ref: '#/components/schemas/ClickwrapWithVersionGetAPIResponse' required: - id - current_version title: AgreementClickwrapGetAPIResponse type: object ContractMinimalResponseV2: title: ContractMinimalResponseV2 description: "Minimal response model for a contract.\nAttributes:\n id (ContractId): The ID of the contract.\n public_id (str): Public ID of the contract.\n contract_name (str): Name of the contract.\n contract_type_id (ContractTypeId): ID of the contract type.\n contract_template_id (Optional[int], optional): ID of the associated contract template.\n status (str): Status of the contract.\n display_status (ContractDisplayStatus): Display status of the contract.\n display_status_without_on_hold_check (ContractDisplayStatus):\n Display status of the contract without on-hold check.\n workflow_status (Optional[ContractWorkflowStatus], optional): Workflow status of the contract.\n contract_kind (ContractKind): Kind of the contract.\n campaign_id (Optional[int], optional): ID of the associated campaign.\n campaign_v3_id (Optional[CampaignId], optional): ID of the associated campaign (v3).\n express_template_id (Optional[int], optional): ID of the express template.\n contract_data_id (Optional[int], optional): ID of the contract data.\n contract_editable_document_id (Optional[int], optional): ID of the editable document related to the contract.\n created (datetime): Date and time when the contract was created.\n created_by_workspace_id (WorkspaceId): ID of the workspace where the contract was created.\n editor_client (ContractEditorClient): Client editor of the contract.\n execution_date (Optional[datetime], optional): Date and time of contract execution.\n frozen_template_id (Optional[int], optional): ID of the frozen contract template.\n workflow_id (str): ID of the workflow associated with the contract.\n\nMethods:\n is_executed() -> bool:\n Checks if the contract is executed.\n\n is_voided() -> bool:\n Checks if the contract is voided.\n\n is_historic_upload() -> bool:\n Checks if the contract is a historic upload.\n\n contract_response_v2() -> ContractResponseV2:\n Retrieves the full response object for the contract.\n\n get_fields_to_select() -> List[str]:\n Retrieves the list of fields to select for the contract." type: object properties: id: title: Id type: integer public_id: title: Public Id type: string contract_name: title: Contract Name type: string contract_type_id: title: Contract Type Id type: integer contract_template_id: title: Contract Template Id type: integer status: title: Status type: string display_status: allOf: - $ref: '#/components/schemas/ContractDisplayStatusEnum' title: ContractDisplayStatus description: An enumeration. display_status_without_on_hold_check: allOf: - $ref: '#/components/schemas/ContractDisplayStatusEnum' title: ContractDisplayStatus description: An enumeration. workflow_status: allOf: - $ref: '#/components/schemas/WorkflowStatusEnum' title: ContractWorkflowStatus description: An enumeration. contract_kind: allOf: - $ref: '#/components/schemas/ContractMinimalResponseV2ContractKindEnum' title: ContractKind description: An enumeration. campaign_id: title: Campaign Id type: integer campaign_v3_id: title: Campaign V3 Id type: integer express_template_id: title: Express Template Id type: integer contract_data_id: title: Contract Data Id type: integer contract_editable_document_id: title: Contract Editable Document Id type: integer created: title: Created type: string format: date-time created_by_workspace_id: title: Created By Workspace Id type: integer editor_client: allOf: - $ref: '#/components/schemas/EditorClientEnum' title: ContractEditorClient description: An enumeration. execution_date: title: Execution Date type: string format: date-time frozen_template_id: title: Frozen Template Id type: integer workflow_id: title: Workflow Id type: string workflow_name: title: Workflow Name type: string required: - id - public_id - contract_name - contract_type_id - status - display_status - display_status_without_on_hold_check - contract_kind - created - created_by_workspace_id - editor_client - workflow_id securitySchemes: ClickwrapId: type: apiKey in: header name: clickwrap-id description: Public clickwrap identifier header. ClientId: type: apiKey name: client-id in: header ClientSecret: type: apiKey name: client-secret in: header NativeIntegrationBasic: type: http scheme: basic description: HTTP Basic auth for supported native integrations. Send base64(client_id:client_secret) in the Authorization header. OAuthBearer: type: http scheme: bearer bearerFormat: JWT description: OAuth 2.0 bearer token for workspace user access. Origin: type: apiKey in: header name: Origin description: Browser origin header used for clickwrap domain validation. x-logo: url: https://cdn.spotdraft.com/assets/logo-black-new.png backgroundColor: transparent altText: SpotDraft Logo href: https://spotdraft.com x-tagGroups: - name: Contracts tags: - V2.1 Contract APIs - V2 Contract APIs - V1 Contract APIs - V2.1 Contract Approvals - V2 Contract Approvals - V2.1 Contract Activity - V2 Contract Activity - V2.1 Contract Invitations - V2 Contract Invitations - V2.1 Contract Metadata Values - V2 Contract Metadata Values - V2.1 Contract External Metadata - V2.1 Contract Notes - V2 Contract Notes - V2.1 Contract Obligations - V2.1 Contract Facets - V2.1 Contract Versions - V2 Contract Versions - V2.1 Recipients - V2 Recipients - name: Clickwrap tags: - V2.1 Clickwrap - name: Legal Intake tags: - V1 Legal Intake - name: Workflow tags: - V2.1 Contract Metadata Definitions - V2 Contract Metadata Definitions - V2.1 Contract Types - V2 Contract Types - V2.1 Templates - V2 Templates - V1 Templates - name: Platform tags: - V2.1 Users - V2 Users - V1 Users - V2.1 Counterparties - V2 Counterparties - V2.1 Organizations - V2 Organizations - V1 Obligation Types - V1 Native Integrations - V2.1 Workspace Files - V2.1 Tasks and Reminders - V2 Tasks and Reminders - V2.1 Webhooks - V1 Webhooks - V1 Emails - V2.1 Analytics Query - V2.1 Workspaces - V2.1 Workspace Tags - name: Sidebar tags: - V2.1 Sidebar