tutorialDifficulty: intermediateTime: 45mVersion: v1Services: contracts-api, retrieval-apiSDK: @lawie/sdkReviewed: 2025-01-18Reviewer: Docs PlatformTags: integration, contracts, retrieval
Build Your First Integration
Build a small integration that uploads a contract, queries it, and posts alerts.
Overview
You will ingest a contract, run a retrieval query, and post a summary to Slack.
Prerequisites
- Sandbox API key
- Node.js 18+
- Slack webhook URL
Architecture Diagram
Ingestion → retrieval → notification workflow for contract insights.
Steps
- Upload a contract using
POST /contracts/v1. - Poll the contract status until
ready. - Query key clauses via
POST /retrieval/v1/search. - Post highlights to Slack with citations.
API Calls Referenced
POST /contracts/v1GET /contracts/v1/{id}POST /retrieval/v1/search
Troubleshooting
429→ Back off before retrying.404→ Contract not ready; verify ingestion completed.