メインコンテンツへスキップ

開発者

REST API ドキュメント

Attorly の法務 AI を利用するための、HTTPS 上の JSON API です。MCP サーバーと同じ操作を、同じキー、スコープ、上限、課金で実行できます。

クイックスタート

4 つの手順で契約書をアップロードして分析します。

  1. 1. キーを作成

    設定 › 開発者 でキーを作成し、REST API を選びます。同じキーで MCP サーバーも使えます。キーを環境変数に保存します:

    bash
    export ATTORLY_API_KEY=lbmcp_your_api_key
  2. 2. ドキュメントをアップロード

    ファイルを multipart/form-data で送信します。レスポンスの data.id がドキュメントの ID です。次の手順で分析を実行するため、analyze=false でバックグラウンド分析を始めずに保存します。

    bash
    curl -X POST https://attorly.ai/api/v1/documents \
      -H "Authorization: Bearer $ATTORLY_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -F "[email protected]" \
      -F "type=NDA" \
      -F "analyze=false"
  3. 3. 分析

    Prefer: wait=30 を付けると、最大 30 秒結果を待ちます。分析が終わると 200 が返り、結果は data に入っています。それより長くかかる場合は、操作を指す Location ヘッダー付きの 202 Accepted が返ります。

    bash
    curl -i -X POST https://attorly.ai/api/v1/documents/$DOCUMENT_ID/analyses \
      -H "Authorization: Bearer $ATTORLY_API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Prefer: wait=30" \
      -H "Content-Type: application/json" \
      -d '{ "mode": "full", "options": { "partyRole": "BUYER" } }'
  4. 4. 結果を取得

    ステータスが succeeded か failed になるまで操作をポーリングします。分析結果は result にあります。ポーリングの間隔は Retry-After の秒数に従ってください。

    bash
    curl https://attorly.ai/api/v1/operations/$OPERATION_ID \
      -H "Authorization: Bearer $ATTORLY_API_KEY"

認証

認証情報を Authorization ヘッダーで Bearer トークンとして送信します。設定 › 開発者 のキーは lbmcp_ で始まり、Pro と Enterprise で REST API と MCP サーバーの両方に使えます。Enterprise の組織キーは atly_ で始まります(制限付きキーは atly_rk_、テストモードは atly_test_)。従来の lb_ キーも引き続き使えます。個人に代わって動作するアプリは OAuth を使います。

http
Authorization: Bearer atly_live_…   # or lbmcp_…, atly_test_…, an OAuth access token

スコープ

各エンドポイントには横に記載されたスコープが必要です。スコープが不足しているキーには 403 insufficient_scope が返り、エラーの requiredScopes に呼び出しに必要なすべてのスコープが示されます。組織の API キーと OAuth は次の名前を使います:

スコープ組織 API キーのスコープ
DOCUMENTS_READdocuments:read
DOCUMENTS_WRITEdocuments:write
DOCUMENTS_DELETEdocuments:delete
DOCUMENTS_ANALYZEanalysis:create
CLAUSES_READclauses:read
RESEARCH_READresearch:read
REDLINES_GENERATEredlines:write
NEGOTIATIONS_READnegotiations:read
WORKFLOWS_EXECUTEworkflows:execute
DUE_DILIGENCE_FULLdue-diligence:write
TEMPLATES_READtemplates:read
TEMPLATES_DRAFTdrafts:write
CASES_READcases:read
CASES_WRITEcases:write

エラー

すべてのエラーは同じ形です。プログラムで分岐に使う固定のコード、人が読むメッセージ、サポートに伝える requestId。

http
HTTP/1.1 403 Forbidden
Content-Type: application/json
Request-Id: req_7Hq2LmN4pX9sT1vB3cD5eF6g
Attorly-Version: 2026-12-01

{
  "error": {
    "type": "permission_error",
    "code": "insufficient_scope",
    "message": "Insufficient permissions. Missing scope: redlines:write.",
    "requiredScopes": ["redlines:write"],
    "docUrl": "https://attorly.ai/docs/api/errors#insufficient_scope",
    "requestId": "req_7Hq2LmN4pX9sT1vB3cD5eF6g"
  }
}

各コードの意味と対処法の説明: エラーコードのページ

バージョン

API は日付でバージョン管理されています。Attorly-Version を送るとリクエストごとにバージョンを選べます。送らない場合は、キー作成時のバージョンが使われます(バージョン導入前のキーは 2026-10-01)。各レスポンスには応答したバージョンが示されます。互換性のない変更は新しいバージョンでのみ導入され、変更履歴に記載されます。

http
curl https://attorly.ai/api/v1/documents \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Attorly-Version: 2026-12-01"

HTTP/1.1 200 OK
Attorly-Version: 2026-12-01
Request-Id: req_…

冪等性

POST、PATCH、DELETE リクエストには、UUID などの Idempotency-Key ヘッダーを送ってください。同じキーと同じリクエストで再試行すると、最初のレスポンスが Idempotent-Replayed: true 付きで返り、処理が再実行・再課金されることはありません。別のリクエストに再利用したキーには 422 idempotency_key_reused が、まだ実行中のキーには 409(長時間の呼び出しでは同じオペレーション)が返ります。サーバーエラーは保存されないため、再試行は改めて実行されます。キーは 24 時間保持されます。

bash
curl -X POST https://attorly.ai/api/v1/redlines \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "documentId": "doc_123", "partyRole": "BUYER" }'

# IDEMPOTENCY_KEY=$(uuidgen) once per logical request; a retry with the same key and body:
HTTP/1.1 202 Accepted
Idempotent-Replayed: true

時間のかかるリクエスト

バージョン 2026-11-01 以降、完全な分析、レッドライン、交渉プレイブック、ワークフロー、デューデリジェンスレポート、AI 下書きは、すぐに 202 Accepted とオペレーションを返します。Prefer: wait=30 を送ると最大 30 秒(上限 60 秒)結果を待ち、Prefer: respond-async を送るとあらゆる書き込みで 202 を求められます。ステータスが succeeded か failed になるまで Location をポーリングするか、operation.succeeded を購読してください。結果は 24 時間保持されます。1 つの組織で同時に実行できる長時間 AI オペレーションは最大 5 件で、超えると 429 concurrency_limit_exceeded が返ります。

http
HTTP/1.1 202 Accepted
Location: /api/v1/operations/op_abc123
Retry-After: 2

{ "data": { "id": "op_abc123", "object": "operation", "status": "running", "resultUrl": "/api/v1/operations/op_abc123", … } }

ページネーション

リストは { object: "list", data, hasMore, nextCursor } を返し、limit(1〜100、既定 20)と cursor を受け付けます。次のページを取得するには nextCursor を cursor として送ります。最後のページでは nextCursor は null です。新しい項目が追加されてもカーソルは有効です。

http
GET /api/v1/documents?limit=2

{
  "object": "list",
  "data": [ { "id": "doc_2", … }, { "id": "doc_1", … } ],
  "hasMore": true,
  "nextCursor": "eyJ0IjoiMjAyNi0xMC0xMVQxMDowMDowMC4wMDBaIiwiaWQiOiJkb2NfMSJ9"
}

GET /api/v1/documents?limit=2&cursor=eyJ0IjoiMjAy…

リクエスト制限

リクエストは複数のウィンドウで数えられます:キーの 1 時間あたりの上限、1 人あたり毎分 300、1 組織あたり毎分 600、読み取り・書き込み・AI 呼び出しごとのキー単位の毎分上限、そして各オペレーション固有の上限です。REST と MCP は同じカウンターを共有します。RateLimit-Policy と RateLimit ヘッダーはすべてのウィンドウを、X-RateLimit-* は上限に最も近いウィンドウを示します。上限を超えると Retry-After 付きの 429 が返ります。

http
RateLimit-Policy: "key-hour";q=1000;w=3600, "user-minute";q=300;w=60, "org-minute";q=600;w=60, "ai-minute";q=30;w=60, "tool";q=10;w=60
RateLimit: "key-hour";r=998;t=3412, "user-minute";r=297;t=41, "org-minute";r=590;t=41, "ai-minute";r=29;t=41, "tool";r=9;t=41
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1791720000

Webhook

POST /api/v1/webhook-endpoints でエンドポイントを作成すると、ポーリングせずに処理の完了を通知で受け取れます。Attorly は JSON イベントを POST で送り、エンドポイントの whsec_ シークレットで Standard Webhooks に従って署名します。内容を信頼する前に署名を検証し、15 秒以内に 2xx で応答し、webhook-id で重複を除外してください。失敗した配信は 72 時間再試行されます。シークレットのローテーション、テストイベントの送信、各配信の確認ができます。

typescript
import crypto from 'node:crypto';

// Standard Webhooks: verify before you parse. secret is the endpoint's whsec_… value.
export function verifyAttorlyWebhook(rawBody: string, headers: Headers, secret: string): unknown {
  const id = headers.get('webhook-id');
  const timestamp = headers.get('webhook-timestamp');
  const signatures = headers.get('webhook-signature') ?? '';
  if (!id || !timestamp) throw new Error('Missing webhook headers');
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) throw new Error('Timestamp too old');

  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
  const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.${rawBody}`).digest();
  const valid = signatures.split(' ').some((entry) => {
    const [version, value] = entry.split(',');
    const given = Buffer.from(value ?? '', 'base64');
    return version === 'v1' && given.length === expected.length && crypto.timingSafeEqual(given, expected);
  });
  if (!valid) throw new Error('Invalid signature');
  return JSON.parse(rawBody); // Deduplicate on webhook-id: a delivery can arrive more than once.
}

テストモード

テストキー(atly_test_…)はすべてのエンドポイントに届きますが、分離されたテストデータで動作し、固定のサンプル結果を返します。AI は実行されず、クレジットも消費されません。テストキーが実データを見ることはありません。任意のテキスト項目に __fail_credits__、__fail_consent__、__slow__ などのマジック値を入れると、そのエラーや遅延を再現できます。DELETE /api/v1/test-data でテストキーが作成したものをすべて削除できます。

bash
curl -X POST https://attorly.ai/api/v1/analyses \
  -H "Authorization: Bearer atly_test_…" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "quick", "content": "__fail_credits__" }'

HTTP/1.1 402 Payment Required
{ "error": { "code": "insufficient_credits", "message": "Test mode: the AI credits are used up …" } }

OAuth

Attorly ユーザーに代わって動作するアプリは OAuth 2.1 でサインインします:/.well-known/oauth-authorization-server での検出、動的クライアント登録、PKCE(S256)付きの認可コードフローです。REST API 用のトークンを得るには resource=https://attorly.ai/api/v1 を指定してください。MCP サーバー向けに発行されたトークンはここでは拒否されます。リフレッシュトークンを得るには offline_access を追加します。利用者は同意画面で組織を選び、スコープを絞り込めます。

http
GET https://attorly.ai/.well-known/oauth-protected-resource/api/v1
GET https://attorly.ai/.well-known/oauth-authorization-server

GET https://attorly.ai/api/oauth/authorize?response_type=code&client_id=…&redirect_uri=…
    &code_challenge=…&code_challenge_method=S256&scope=documents:read%20offline_access
    &resource=https://attorly.ai/api/v1&state=…

POST https://attorly.ai/api/oauth/token
grant_type=authorization_code&code=…&code_verifier=…&redirect_uri=…&client_id=…&resource=https://attorly.ai/api/v1

課金

AI を使うオペレーションは、REST と MCP のどちらから呼び出しても、Attorly アプリと同じ AI クレジットをキー所有者またはその組織のウォレットから消費します。クレジットがなくなると 402 insufficient_credits が返ります。テストモードの呼び出しは無料です。

プラン

API は Pro と Enterprise に含まれています。キー所有者のプランに API アクセスが含まれなくなった場合や、所有者が組織を離れた場合、リクエストは 403 で拒否されます。

リファレンス

API 自身が提供する OpenAPI ドキュメントから生成した全操作。パスは https://attorly.ai からの相対パスです。成功レスポンスは結果を data に包みます。フィールドの説明は英語です。

文書

GET/api/v1/documentslistDocuments

キーで読み取れる保存済みの文書を新しい順に一覧表示します。

スコープ:DOCUMENTS_READ
クエリパラメーター
フィールド型説明
type"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …Only documents of this kind
status"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"Only documents in this processing state
querystringOnly documents whose name contains this text
includeArchivedbooleanAlso list archived documents (left out by default)
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/documents?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/documentsuploadDocument

文書を multipart/form-data、または base64 の内容かプレーンテキストを含む JSON でアップロードします。analyze が false でない限り、バックグラウンドで分析されます。

スコープ:DOCUMENTS_WRITEAI クレジットを使用ファイルのアップロードに対応
リクエストボディ
フィールド型説明
filename必須stringThe file name with its extension, e.g. "nda.pdf"; the extension decides the file type when mimeType is absent
contentBase64stringThe file, base64-encoded
textstringPlain text to store as a .txt document, instead of contentBase64
mimeTypestringThe file's MIME type; checked against its content
namestringDisplay name; defaults to the file name
type"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …What the document is
urlstring (uri)An https URL Attorly downloads the file from (public hosts only, up to 10 MB), instead of contentBase64 or text
analyzebooleanAnalyse the document in the background after upload, as the app does (uses AI credits). false stores it only
レスポンスデータ(201)
フィールド型説明
id必須string
name必須string
originalName必須string
type必須"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
size必須integer
status必須"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
analysisQueued必須booleantrue when the background analysis was started
createdAt必須stringISO 8601 date-time
url必須stringWhere the document opens in Attorly
curl
curl -X POST "https://attorly.ai/api/v1/documents" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "filename": "nda.txt",
  "text": "This Mutual Non-Disclosure Agreement is entered into by…",
  "type": "NDA"
}'
GET/api/v1/documents/searchsearchDocuments

キーで読める文書の本文を、意味と完全一致の両方で検索します。

スコープ:DOCUMENTS_READ
クエリパラメーター
フィールド型説明
query必須stringWhat to look for, in plain language or exact words
type"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …Only documents of this kind
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/documents/search?query=limitation+of+liability&limit=10" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/documents/{documentId}getDocument

文書、その処理状況、最新の分析を取得します。

スコープ:DOCUMENTS_READ
パスパラメーター
フィールド型説明
documentId必須string
レスポンスデータ(200)
フィールド型説明
id必須string
name必須string
originalName必須string
type必須"EMPLOYMENT_CONTRACT" | "LEASE_AGREEMENT" | "PURCHASE_AGREEMENT" | "NDA" | "TERMS_OF_SERVICE" | "EMAIL" | …
mimeType必須string
size必須integer
status必須"PENDING" | "PROCESSING" | "ANALYZED" | "FAILED"PENDING until processing starts; ANALYZED once the analysis is stored
archived必須boolean
ownedByYou必須boolean
versionNumber必須integer | nullThe document's number among its versions you can read ("version 2" — a new version is saved as a new document, never in place); null when it has no other version. documents_list returns the newest version of each document only.
createdAt必須stringISO 8601 date-time
updatedAt必須stringISO 8601 date-time
fileAvailable必須booleanfalse when the stored file can no longer be read
governingLawRequired必須booleantrue when the analysis is held until a governing law is chosen for the document in Attorly
latestAnalysis必須object | null
url必須stringWhere the document opens in Attorly
curl
curl "https://attorly.ai/api/v1/documents/doc_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
DELETE/api/v1/documents/{documentId}deleteDocument

自分が所有する文書の削除を依頼します。文書は、Attorly で削除を承認したときにのみ削除されます。

スコープ:DOCUMENTS_DELETE
パスパラメーター
フィールド型説明
documentId必須string
レスポンスデータ(200)
フィールド型説明
id必須string
deleted必須booleantrue only when the document is gone
status必須"deleted" | "declined" | "awaiting_approval"deleted: the owner approved and it is gone; declined: the owner said no in their app, nothing was deleted; awaiting_approval: it is marked and waits for the owner to delete or keep it in Attorly
requestedAtstringWhen the deletion was first asked for (awaiting_approval)
urlstringWhere the owner approves or keeps the document in Attorly (awaiting_approval)
curl
curl -X DELETE "https://attorly.ai/api/v1/documents/doc_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/analysescreateAnalysis

文書またはインラインのテキストを分析します。mode は full(保存済み文書)または quick です。

スコープ:DOCUMENTS_ANALYZEDOCUMENTS_READAI クレジットを使用

ボディの mode フィールドで次のいずれかを選びます:mode: full, mode: quick。

リクエストボディ
フィールド型説明
mode"full" | "quick"Runs documents_analyze.
documentIdstring
contentstring
mimeTypestring
optionsobject
curl
curl -X POST "https://attorly.ai/api/v1/analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "quick",
  "content": "This Agreement is entered into by and between…"
}'
GET/api/v1/documents/{documentId}/analyseslistDocumentAnalyses

文書に保存された分析を新しい順に一覧表示します。

スコープ:DOCUMENTS_READ
パスパラメーター
フィールド型説明
documentId必須string
クエリパラメーター
フィールド型説明
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/documents/doc_abc123/analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/documents/{documentId}/analysescreateDocumentAnalysis

保存済みの文書を分析します。

スコープ:DOCUMENTS_ANALYZEDOCUMENTS_READAI クレジットを使用
パスパラメーター
フィールド型説明
documentId必須string

ボディの mode フィールドで次のいずれかを選びます:mode: full, mode: quick。

リクエストボディ
フィールド型説明
mode"full" | "quick"Runs documents_analyze.
contentstring
mimeTypestring
optionsobject
curl
curl -X POST "https://attorly.ai/api/v1/documents/doc_abc123/analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "full",
  "options": {
    "partyRole": "BUYER"
  }
}'
GET/api/v1/documents/{documentId}/textgetDocumentText

保存済みの PDF または DOCX 文書からプレーンテキストを抽出します。

スコープ:DOCUMENTS_READ
パスパラメーター
フィールド型説明
documentId必須string
クエリパラメーター
フィールド型説明
offsetintegerCharacter offset to start from; pass the nextOffset of the previous call to read on
maxCharactersintegerMost characters to return in this call
レスポンスデータ(200)
フィールド型説明
text必須stringThe document text from offset (untrusted content)
documentName必須string
documentType必須string
mimeType必須string | null
characterCount必須integerCharacters in the whole document
wordCount必須integerWords in the whole document
offset必須integer
nextOffset必須integer | nullPass as offset to read on; null when the text ends here
truncated必須booleantrue when the text continues past this slice
curl
curl "https://attorly.ai/api/v1/documents/doc_abc123/text" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/analyses/{analysisId}getAnalysis

保存された分析(要約、リスク、主要条件、条項、推奨事項)を取得します。

スコープ:DOCUMENTS_READ
パスパラメーター
フィールド型説明
analysisId必須string
レスポンスデータ(200)
フィールド型説明
id必須string
documentId必須string
documentName必須string
summary必須string | null
riskLevel必須"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskScore必須number
keyTerms必須array of any
clauses必須array of any
recommendations必須array of any
mode必須stringSINGLE or CONSENSUS
createdAt必須stringISO 8601 date-time
url必須string
curl
curl "https://attorly.ai/api/v1/analyses/your_analysisId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/comparisonscreateComparison

2 つの文書またはテキストを行単位で比較します。

スコープ:DOCUMENTS_READ
リクエストボディ
フィールド型説明
sourceDocumentIdstring
sourceContentstring
targetDocumentIdstring
targetContentstring
レスポンスデータ(200)
フィールド型説明
differences必須array of object
summary必須object
curl
curl -X POST "https://attorly.ai/api/v1/comparisons" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "sourceDocumentId": "doc_abc123",
  "targetDocumentId": "doc_def456"
}'

条項

GET/api/v1/clausessearchClauses

条項ライブラリを検索します。

スコープ:CLAUSES_READ
クエリパラメーター
フィールド型説明
query必須string
category"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
jurisdictionstring
riskLevel"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
limitinteger
レスポンスデータ(200)
フィールド型説明
clauses必須array of object
count必須integer
curl
curl "https://attorly.ai/api/v1/clauses?query=limitation+of+liability&limit=5" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/clauses/risk-assessmentscreateClauseRiskAssessment

条項のリスクを評価します。

スコープ:CLAUSES_READ
リクエストボディ
フィールド型説明
clauseText必須string
category"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …The kind of clause; its risk rules are applied
jurisdictionstringISO 3166-1 alpha-2 country code; defaults to international
contractTypestring
partyRole"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE" | …
レスポンスデータ(200)
フィールド型説明
clauseTextstring
clauseType必須string
jurisdiction必須string
overallRiskScore必須number
riskLevel必須"LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
riskFactors必須array of object
recommendations必須array of string
alternativesarray of object
complianceIssuesarray of object
negotiationTipsarray of string
curl
curl -X POST "https://attorly.ai/api/v1/clauses/risk-assessments" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "clauseText": "The Supplier’s total liability shall not exceed the fees paid in the preceding month.",
  "category": "LIABILITY",
  "partyRole": "BUYER"
}'
POST/api/v1/clauses/market-comparisonscreateClauseMarketComparison

条項を市場標準の文言と比較します。

スコープ:CLAUSES_READ
リクエストボディ
フィールド型説明
clauseText必須string
category必須"INDEMNIFICATION" | "LIABILITY" | "TERMINATION" | "CONFIDENTIALITY" | "INTELLECTUAL_PROPERTY" | "PAYMENT" | …
contractTypestring
jurisdictionstring
レスポンスデータ(200)
フィールド型説明
inputClause必須string
category必須string
marketStandards必須array of object
comparison必須object
curl
curl -X POST "https://attorly.ai/api/v1/clauses/market-comparisons" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "clauseText": "Either party may terminate this Agreement on 10 days’ written notice.",
  "category": "TERMINATION"
}'
POST/api/v1/clauses/playbook-checkscreateClausePlaybookCheck

条項をプレイブックに照らしてチェックします。

スコープ:CLAUSES_READ
リクエストボディ
フィールド型説明
clauseText必須string
playbookId必須string
レスポンスデータ(200)
フィールド型説明
playbookName必須string
compliant必須boolean
violations必須array of string
warnings必須array of string
rulesChecked必須integer
curl
curl -X POST "https://attorly.ai/api/v1/clauses/playbook-checks" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "clauseText": "This Agreement is governed by the laws of England.",
  "playbookId": "pb_abc123"
}'

リサーチ

POST/api/v1/research/searchessearchResearch

Lovdata、EUR-Lex、CourtListener などの法情報源を検索します。

スコープ:RESEARCH_READAI クレジットを使用
リクエストボディ
フィールド型説明
query必須string
jurisdictionsarray of stringISO 3166-1 alpha-2 country code to search under, or "EU"; the first entry is used. Defaults to the key owner's country.
sourcesarray of "lovdata" | "eurlex" | "legislation_uk" | "congress_gov" | "courtlistener" | "finlex"Keep only results from these publishers
dateFromstringKeep only dated results on or after this day
dateTostringKeep only dated results on or before this day
limitinteger
レスポンスデータ(200)
フィールド型説明
query必須string
jurisdiction必須string
results必須array of object
totalCount必須integerResults matching the filters, before limit
sourcesstring
curl
curl -X POST "https://attorly.ai/api/v1/research/searches" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "notice period for terminating a commercial lease",
  "jurisdictions": [
    "NO"
  ],
  "limit": 5
}'
GET/api/v1/research/statutesgetStatute

引用表記から法令を参照します。

スコープ:RESEARCH_READAI クレジットを使用
クエリパラメーター
フィールド型説明
citation必須string
jurisdiction必須stringISO 3166-1 alpha-2 country code, or "EU"
レスポンスデータ(200)
フィールド型説明
id必須string
title必須string
source必須string
jurisdictionstring
citationstring
urlstring
datestring
excerptstring
relevanceScorenumber
attributionstring
asOfstring
consolidatedAsOfstringISO date the stored text is "as amended through", as its publisher states
inForceTostringISO date the act stops/stopped being in force, when the publisher states one
repealedAtstringISO date the act was repealed, when it was
lawDatesReadbooleanTrue when the publisher's dates were read for the act; a missing consolidatedAsOf then means an unamended text
curl
curl "https://attorly.ai/api/v1/research/statutes?citation=LOV-1999-03-26-17&jurisdiction=NO" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

修正案

POST/api/v1/redlinescreateRedlines

文書またはテキストに対する修正案を生成します。

スコープ:REDLINES_GENERATEAI クレジットを使用
リクエストボディ
フィールド型説明
documentIdstring
contentstring
partyRole必須"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE"
riskTolerance"CONSERVATIVE" | "MODERATE" | "AGGRESSIVE"
focusAreasarray of string
playbookIdstringRedline against this playbook's position ladders (own, organisation, system or shared playbooks)
side"OUR_PAPER" | "THEIR_PAPER" | "EITHER"Whose paper the document is, to pick the playbook positions that apply
レスポンスデータ(200)
フィールド型説明
changes必須array of object
summaryobject
negotiationNotesarray of string
statistics必須object
curl
curl -X POST "https://attorly.ai/api/v1/redlines" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "documentId": "doc_abc123",
  "partyRole": "BUYER",
  "riskTolerance": "CONSERVATIVE"
}'
POST/api/v1/documents/{documentId}/redlines/resolutionsresolveRedlines

文書の修正を承認または却下します。

スコープ:REDLINES_GENERATE
パスパラメーター
フィールド型説明
documentId必須string
リクエストボディ
フィールド型説明
changes必須array of object
レスポンスデータ(200)
フィールド型説明
accepted必須integer
rejected必須integer
message必須string
curl
curl -X POST "https://attorly.ai/api/v1/documents/doc_abc123/redlines/resolutions" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "changes": [
    {
      "id": "chg_1",
      "action": "accept"
    },
    {
      "id": "chg_2",
      "action": "reject"
    }
  ]
}'

交渉

POST/api/v1/negotiations/position-analysescreateNegotiationPositionAnalysis

交渉ポジションを分析します。

スコープ:NEGOTIATIONS_READAI クレジットを使用
リクエストボディ
フィールド型説明
documentIdstring
contentstring
partyRole必須"BUYER" | "SELLER" | "LANDLORD" | "TENANT" | "EMPLOYER" | "EMPLOYEE"
contextobject
レスポンスデータ(200)
フィールド型説明
overallPosition必須stringFAVORABLE, BALANCED or UNFAVORABLE
positions必須array of object
prioritizedConcessionsarray of string
dealBreakersarray of string
suggestedApproachstring
estimatedOutcomeobject
curl
curl -X POST "https://attorly.ai/api/v1/negotiations/position-analyses" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "documentId": "doc_abc123",
  "partyRole": "BUYER"
}'
POST/api/v1/negotiations/playbookscreateNegotiationPlaybook

戦略から交渉プレイブックを作成します。

スコープ:NEGOTIATIONS_READAI クレジットを使用
リクエストボディ
フィールド型説明
strategy必須object
contextobject
レスポンスデータ(200)
フィールド型説明
playbook必須array of object
anticipatedObjections必須array of object
recommendations必須array of string
summary必須object
curl
curl -X POST "https://attorly.ai/api/v1/negotiations/playbooks" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "strategy": {
    "overallPosition": "collaborative",
    "priorities": [
      "Cap liability at 12 months of fees",
      "Keep Norwegian law"
    ]
  }
}'

ワークフロー

GET/api/v1/workflows/templateslistWorkflowTemplates

ワークフローテンプレートを一覧表示します。

スコープ:WORKFLOWS_EXECUTE
クエリパラメーター
フィールド型説明
category"MA_ACQUISITION" | "MA_MERGER" | "INVESTMENT" | "IPO" | "REAL_ESTATE" | "REGULATORY" | …Due diligence project type the template is built for
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/workflows/templates?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/workflows/executionslistWorkflowExecutions

ワークフローの実行を新しい順に一覧表示します。プロジェクトやステータスで絞り込めます。

スコープ:WORKFLOWS_EXECUTE
クエリパラメーター
フィールド型説明
projectIdstringOnly executions on this due diligence project
status"PENDING" | "RUNNING" | "WAITING_FOR_INPUT" | "WAITING_FOR_APPROVAL" | "PAUSED" | "COMPLETED" | …
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/workflows/executions?status=COMPLETED&limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/workflows/executionscreateWorkflowExecution

デューデリジェンス案件でワークフローを開始します。

スコープ:WORKFLOWS_EXECUTEAI クレジットを使用
リクエストボディ
フィールド型説明
templateId必須string
projectId必須string
inputs必須object
optionsobject
レスポンスデータ(202)
フィールド型説明
executionId必須string
templateId必須string
templateName必須string
status必須string
startedAt必須stringISO 8601 date-time
message必須string
curl
curl -X POST "https://attorly.ai/api/v1/workflows/executions" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "templateId": "wft_abc123",
  "projectId": "ddp_abc123",
  "inputs": {}
}'
GET/api/v1/workflows/executions/{executionId}getWorkflowExecution

ワークフロー実行のステータスを取得します。

スコープ:WORKFLOWS_EXECUTE
パスパラメーター
フィールド型説明
executionId必須string
クエリパラメーター
フィールド型説明
includeStepsboolean
レスポンスデータ(200)
フィールド型説明
executionId必須string
templateName必須string
status必須string
startedAtstringISO 8601 date-time
completedAtstringISO 8601 date-time
variablesobject
errorstring | null
stepsarray of object
curl
curl "https://attorly.ai/api/v1/workflows/executions/wfx_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

デューデリジェンス

GET/api/v1/due-diligence/projectslistDueDiligenceProjects

デューデリジェンスプロジェクトを新しい順に一覧表示します。

スコープ:DUE_DILIGENCE_FULL
クエリパラメーター
フィールド型説明
status"NOT_STARTED" | "IN_PROGRESS" | "UNDER_REVIEW" | "COMPLETED" | "ON_HOLD" | "CANCELLED"Only projects in this state
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/due-diligence/projects?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/due-diligence/projectscreateDueDiligenceProject

デューデリジェンス案件を作成します。

スコープ:DUE_DILIGENCE_FULL
リクエストボディ
フィールド型説明
name必須string
dealType必須"MA_ACQUISITION" | "MA_MERGER" | "INVESTMENT" | "IPO" | "REAL_ESTATE" | "REGULATORY" | …
targetCompanystring
descriptionstring
settingsobject
レスポンスデータ(201)
フィールド型説明
projectId必須string
name必須string
projectType必須string
status必須string
createdAt必須stringISO 8601 date-time
message必須string
curl
curl -X POST "https://attorly.ai/api/v1/due-diligence/projects" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Project Falcon",
  "dealType": "MA_ACQUISITION",
  "targetCompany": "Target AS"
}'
GET/api/v1/due-diligence/projects/{projectId}getDueDiligenceProject

文書数と指摘事項数を含むデューデリジェンスプロジェクトを取得します。

スコープ:DUE_DILIGENCE_FULL
パスパラメーター
フィールド型説明
projectId必須string
レスポンスデータ(200)
フィールド型説明
id必須string
name必須string
description必須string | null
projectType必須string
status必須string
priority必須string
targetCompany必須string | null
dueDate必須string | null
documentCount必須integer
findingCount必須integer
createdAt必須stringISO 8601 date-time
updatedAt必須stringISO 8601 date-time
completedAt必須string | null
curl
curl "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/due-diligence/projects/{projectId}/documentsaddDueDiligenceDocuments

デューデリジェンス案件に文書を追加します。

スコープ:DUE_DILIGENCE_FULL
パスパラメーター
フィールド型説明
projectId必須string
リクエストボディ
フィールド型説明
documentIds必須array of string
categorystring
レスポンスデータ(200)
フィールド型説明
projectId必須string
documentsAdded必須integer
totalDocuments必須integer
category必須string
message必須string
curl
curl -X POST "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123/documents" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "documentIds": [
    "doc_abc123",
    "doc_def456"
  ]
}'
GET/api/v1/due-diligence/projects/{projectId}/findingslistDueDiligenceFindings

デューデリジェンス案件の指摘事項を一覧表示します。

スコープ:DUE_DILIGENCE_FULL
パスパラメーター
フィールド型説明
projectId必須string
クエリパラメーター
フィールド型説明
riskLevel"INFO" | "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"
categorystring
limitinteger
レスポンスデータ(200)
フィールド型説明
projectId必須string
projectName必須string
findings必須array of object
riskSummary必須objectNumber of findings per severity
totalFindings必須integer
pendingProposals必須integerRisks the AI proposed that wait for a reviewer: not findings, not listed, not in any report
curl
curl "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123/findings?riskLevel=HIGH" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/due-diligence/projects/{projectId}/reportscreateDueDiligenceReport

デューデリジェンスレポートを生成します。

スコープ:DUE_DILIGENCE_FULL
パスパラメーター
フィールド型説明
projectId必須string
リクエストボディ
フィールド型説明
format必須"pdf" | "markdown""markdown" returns the report text; "pdf" also returns the formatted PDF (base64)
sectionsarray of "executive_summary" | "risk_overview" | "findings_detail" | "document_analysis" | "recommendations"
includeRecommendationsboolean
レスポンスデータ(201)
フィールド型説明
reportId必須string
projectId必須string
projectNamestring
format必須"pdf" | "markdown"
status必須string
sectionsarray of string
documentCountinteger
findingCountinteger
pendingProposalsintegerRisks the AI proposed that wait for a reviewer when the report was made: left out of it, and counted at its top
markdown必須string
attachmentobject
messagestring
curl
curl -X POST "https://attorly.ai/api/v1/due-diligence/projects/ddp_abc123/reports" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "format": "markdown"
}'

テンプレートと草案

GET/api/v1/templateslistTemplates

文書テンプレートを一覧表示します。

スコープ:TEMPLATES_READ
クエリパラメーター
フィールド型説明
category"NDA" | "EMPLOYMENT" | "SERVICE_AGREEMENT" | "LEASE" | "REAL_ESTATE" | "CORPORATE" | …
jurisdictionstringISO 3166-1 alpha-2 country code (e.g. "NO", "GB"); jurisdiction-neutral templates are always included
languagestringISO 639-1 language code of the template text (e.g. "en", "nb")
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/templates?limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/draftscreateDraft

テンプレートから(mode template)、または AI で(mode ai)草案を作成します。

スコープ:TEMPLATES_DRAFTAI クレジットを使用

ボディの mode フィールドで次のいずれかを選びます:mode: template, mode: ai。

リクエストボディ
フィールド型説明
mode"template" | "ai"Runs templates_draft.
templateIdstring
variablesobject
optionsobject
documentTypestring
requirementsstring
contextobject
curl
curl -X POST "https://attorly.ai/api/v1/drafts" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "template",
  "templateId": "tpl_abc123",
  "variables": {
    "partyA": "Acme AS",
    "partyB": "Beta AB"
  }
}'

ケース

GET/api/v1/caseslistCases

自分のケースを最近変更された順に一覧表示します。

スコープ:CASES_READ
クエリパラメーター
フィールド型説明
status"ACTIVE" | "CLOSED" | "ARCHIVED"Only cases in this state; all states when absent
limitinteger
cursorstringPass the nextCursor of the previous page to get the next one
curl
curl "https://attorly.ai/api/v1/cases?status=ACTIVE&limit=20" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/cases/{caseId}/timelinegetCaseTimeline

ケースのタイムラインを取得します。各出来事の日付、証拠、相手方の立場を含みます。

スコープ:CASES_READ
パスパラメーター
フィールド型説明
caseId必須string
レスポンスデータ(200)
フィールド型説明
case必須object
events必須array of objectIn date order
count必須integer
needsReviewCount必須integerEvents an AI added that no person has confirmed
deletionRequestedCount必須integerEvents waiting for the owner to approve their deletion
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/timeline" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/timeline/eventscreateTimelineEvent

ケースのタイムラインに出来事を追加します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
リクエストボディ
フィールド型説明
title必須stringWhat happened, in one line (at most 300 characters)
descriptionstring | nullMore detail, or null to clear it
when必須objectWhen it happened, as precisely as it is known. precision TIME: start "YYYY-MM-DD" and time "HH:MM" (24-hour, in the case's time zone). DAY: start "YYYY-MM-DD". MONTH: start "YYYY-MM". YEAR: start "YYYY". PERIOD: start and end "YYYY-MM-DD", end after start. approximate: true when the date is an estimate; it is then written "c. …".
category"CONTRACT" | "DEADLINE" | "INCIDENT" | "FILING" | "CORRESPONDENCE" | "COURT_DATE" | …What kind of event it is; OTHER when absent
importantbooleanMarks a key event; exports can be limited to key events
agreement"UNMARKED" | "AGREED" | "DISPUTED"Whether the other side agrees that it happened this way: AGREED, DISPUTED, or UNMARKED (not assessed)
opposingVersionstring | nullThe other side's account of a DISPUTED event. Kept only while agreement is DISPUTED
commentstring | nullThe owner's private note. Exports print it only when asked to
confidentialbooleanLeave this event out whenever the timeline is shared or exported
sourcesarray of objectThe case documents that evidence the event, with an optional page or section ("p. 3"). Each documentId must be a document of this case. On update, the list replaces the event's sources
レスポンスデータ(201)
フィールド型説明
caseId必須string
event必須object
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/timeline/events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Landlord gave written notice of termination",
  "when": {
    "precision": "DAY",
    "start": "2026-03-02"
  },
  "category": "CORRESPONDENCE",
  "important": true,
  "agreement": "DISPUTED",
  "opposingVersion": "The landlord says the notice was handed over on 27 February.",
  "sources": [
    {
      "documentId": "doc_abc123",
      "locator": "p. 1"
    }
  ]
}'
PATCH/api/v1/cases/{caseId}/timeline/events/{eventId}updateTimelineEvent

ケースのタイムラインの出来事を変更するか、AI が追加した出来事を確認します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
eventId必須string
リクエストボディ
フィールド型説明
titlestringWhat happened, in one line (at most 300 characters)
descriptionstring | nullMore detail, or null to clear it
whenobjectWhen it happened, as precisely as it is known. precision TIME: start "YYYY-MM-DD" and time "HH:MM" (24-hour, in the case's time zone). DAY: start "YYYY-MM-DD". MONTH: start "YYYY-MM". YEAR: start "YYYY". PERIOD: start and end "YYYY-MM-DD", end after start. approximate: true when the date is an estimate; it is then written "c. …".
category"CONTRACT" | "DEADLINE" | "INCIDENT" | "FILING" | "CORRESPONDENCE" | "COURT_DATE" | …What kind of event it is; OTHER when absent
importantbooleanMarks a key event; exports can be limited to key events
agreement"UNMARKED" | "AGREED" | "DISPUTED"Whether the other side agrees that it happened this way: AGREED, DISPUTED, or UNMARKED (not assessed)
opposingVersionstring | nullThe other side's account of a DISPUTED event. Kept only while agreement is DISPUTED
commentstring | nullThe owner's private note. Exports print it only when asked to
confidentialbooleanLeave this event out whenever the timeline is shared or exported
sourcesarray of objectThe case documents that evidence the event, with an optional page or section ("p. 3"). Each documentId must be a document of this case. On update, the list replaces the event's sources
レスポンスデータ(200)
フィールド型説明
caseId必須string
event必須object
curl
curl -X PATCH "https://attorly.ai/api/v1/cases/case_abc123/timeline/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
DELETE/api/v1/cases/{caseId}/timeline/events/{eventId}deleteTimelineEvent

ケースのタイムラインから出来事の削除を依頼します。所有者が Attorly で承認したときにのみ削除されます。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
eventId必須string
レスポンスデータ(200)
フィールド型説明
caseId必須string
id必須string
deleted必須booleantrue only when the event is gone
status必須"deleted" | "declined" | "awaiting_approval"deleted: the owner approved and it is gone; declined: the owner said no in their app, nothing was deleted; awaiting_approval: it is marked and waits for the owner to delete or keep it in Attorly
requestedAtstringWhen the deletion was first asked for (awaiting_approval)
urlstringWhere the owner approves or keeps the event in Attorly (awaiting_approval)
curl
curl -X DELETE "https://attorly.ai/api/v1/cases/case_abc123/timeline/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/cases/{caseId}/timeline/exportexportCaseTimeline

ケースのタイムラインを PDF、Word、ODT、Excel、PowerPoint のファイルとしてエクスポートします。

スコープ:CASES_READ
パスパラメーター
フィールド型説明
caseId必須string
リクエストボディ
フィールド型説明
layout必須"overview" | "chronology" | "numbered" | "visual"overview: date and what happened, for the other party, a complaints board or a lawyer. chronology: numbered table with sources and an exhibit list, for a court. numbered: one numbered paragraph per event with exhibit references, for the facts section of a filing. visual: the time axis on one landscape page
format必須"pdf" | "docx" | "odt" | "xlsx" | "pptx"The file type. overview and chronology: pdf, docx, odt, xlsx or pptx. numbered: pdf, docx or odt. visual: pdf or pptx
optionsobject
localestringLanguage of the file's headings, dates and file name, as a locale Attorly ships (e.g. "en", "nb", "de"); the account's language when absent or not offered
レスポンスデータ(200)
フィールド型説明
caseId必須string
layout必須"overview" | "chronology" | "numbered" | "visual"
format必須"pdf" | "docx" | "odt" | "xlsx" | "pptx"
locale必須stringThe language the file is written in
eventCount必須integerEvents in the file
exhibitCount必須integerDocuments in the exhibit list (chronology and numbered layouts)
leftOutConfidential必須integerEvents left out because they are marked confidential
attachment必須object
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/timeline/export" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "layout": "chronology",
  "format": "docx",
  "options": {
    "markAgreement": true
  },
  "locale": "en"
}'
GET/api/v1/cases/{caseId}/deadlineslistCaseDeadlines

ケースの期限を近い順に一覧表示します。各期限が誰のものか、完了したか超過したかを含みます。

スコープ:CASES_READ
パスパラメーター
フィールド型説明
caseId必須string
クエリパラメーター
フィールド型説明
status"open" | "completed"open: not yet marked done; completed: marked done; both when absent
レスポンスデータ(200)
フィールド型説明
case必須object
deadlines必須array of objectSoonest first
count必須integer
overdueCount必須integer
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/deadlines?status=open" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/deadlinescreateCaseDeadline

ケースに期限を追加します。日付を指定するか、記録済みの事実から計算します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
リクエストボディ
フィールド型説明
title必須stringWhat must be done by then, in one line (at most 200 characters)
dueAtstring (date) | string (date-time)The due date. A day "YYYY-MM-DD" is due at the end of that day where the case applies (its country, else the owner's); a moment ("2026-03-02T09:00:00+01:00", a hearing) is kept as given
derivedFromobjectCount the date from a recorded date fact instead of giving dueAt: due = the fact's date + offsetDays days, or + offsetMonths calendar months. The deadline moves with the fact when the fact is corrected. Record the fact first with facts_record
kind"HEARING" | "FILING" | "DISCOVERY" | "STATUTE_OF_LIMITATIONS" | "CUSTOM"What kind of deadline it is; CUSTOM when absent
party"SELF" | "COUNTERPARTY"SELF: the owner must act by then. COUNTERPARTY: a window the other side set; SELF when absent
notesstring | nullA short note shown with the deadline and in its reminders (at most 500 characters), or null to clear it
レスポンスデータ(201)
フィールド型説明
caseId必須string
deadline必須object
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/deadlines" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Protest the termination in writing to the landlord",
  "derivedFrom": {
    "factKey": "receivedAt",
    "offsetMonths": 1
  },
  "kind": "FILING",
  "party": "SELF",
  "notes": "Husleieloven § 9-8 (1): one month from receipt"
}'
PATCH/api/v1/cases/{caseId}/deadlines/{deadlineId}updateCaseDeadline

ケースの期限を変更するか、完了済みにするか、未完了に戻します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
deadlineId必須string
リクエストボディ
フィールド型説明
titlestringWhat must be done by then, in one line (at most 200 characters)
dueAtstring (date) | string (date-time)The due date. A day "YYYY-MM-DD" is due at the end of that day where the case applies (its country, else the owner's); a moment ("2026-03-02T09:00:00+01:00", a hearing) is kept as given
derivedFromobjectCount the date from a recorded date fact instead of giving dueAt: due = the fact's date + offsetDays days, or + offsetMonths calendar months. The deadline moves with the fact when the fact is corrected. Record the fact first with facts_record
kind"HEARING" | "FILING" | "DISCOVERY" | "STATUTE_OF_LIMITATIONS" | "CUSTOM"What kind of deadline it is; CUSTOM when absent
party"SELF" | "COUNTERPARTY"SELF: the owner must act by then. COUNTERPARTY: a window the other side set; SELF when absent
notesstring | nullA short note shown with the deadline and in its reminders (at most 500 characters), or null to clear it
completedbooleantrue marks the deadline done; false reopens it
レスポンスデータ(200)
フィールド型説明
caseId必須string
deadline必須object
curl
curl -X PATCH "https://attorly.ai/api/v1/cases/case_abc123/deadlines/dl_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
GET/api/v1/cases/{caseId}/factslistCaseFacts

ケースに記録された事実を出典とともに一覧表示し、ケースにまだ必要な事実も示します。

スコープ:CASES_READ
パスパラメーター
フィールド型説明
caseId必須string
レスポンスデータ(200)
フィールド型説明
case必須object
facts必須array of object
count必須integer
caseReads必須object | nullThe facts the case's rule reads, under exactly these keys; null when it reads none
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/facts" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/factsrecordCaseFact

ケースに事実を記録するか、訂正します。その事実から計算された期限も一緒に移動します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
リクエストボディ
フィールド型説明
key必須stringThe fact, as a camelCase key. facts_list names the facts this case reads, with their format; use one of those, or another camelCase key only for a fact none of them covers
value必須stringThe value, in the format its key takes (a date fact: YYYY-MM-DD). It is stored in canonical form, so the result can differ from what was sent ("Lissabon" becomes LIS)
レスポンスデータ(200)
フィールド型説明
caseId必須string
outcome必須"recorded" | "corrected" | "unchanged"recorded: a new fact; corrected: a new value replaced the old one; unchanged: it already held this value
fact必須object
movedDeadlines必須array of objectOpen deadlines counted from the fact that moved with the correction, due days before and after
url必須stringWhere the case opens in Attorly
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/facts" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "receivedAt",
  "value": "2026-03-04"
}'
GET/api/v1/cases/{caseId}/partieslistCaseParties

ケースの当事者と、ケースで使える役割を一覧表示します。

スコープ:CASES_READ
パスパラメーター
フィールド型説明
caseId必須string
レスポンスデータ(200)
フィールド型説明
case必須object
parties必須array of object
count必須integer
roles必須array of objectThe roles the case offers; empty when it has no case type with roles
curl
curl "https://attorly.ai/api/v1/cases/case_abc123/parties" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/cases/{caseId}/partiescreateCaseParty

ケースの役割のいずれかに当事者を追加します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
リクエストボディ
フィールド型説明
roleKey必須stringThe role the party has in the case, as one of the roles parties_list returns (e.g. "landlord")
partyType必須"PERSON" | "ENTITY"PERSON for a person, ENTITY for a company or public body
name必須stringThe party's name (at most 200 characters)
isSelfbooleantrue when this party is the person the connection acts for; false removes that link
orgNumberstringOrganisation number of an ENTITY
personalIdNumberstringNational identity number of a PERSON. Add it only when the owner gave it for this case
emailstring (email)E-mail address
phonestringPhone number
addressstringPostal address
representedBystringThe lawyer or representative acting for the party
notesstringThe owner's note about the party (at most 1000 characters)
positionintegerOrder within its role, 0 first
レスポンスデータ(201)
フィールド型説明
caseId必須string
party必須object
curl
curl -X POST "https://attorly.ai/api/v1/cases/case_abc123/parties" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "roleKey": "landlord",
  "partyType": "ENTITY",
  "name": "Fjord Eiendom AS",
  "orgNumber": "999999999",
  "email": "[email protected]"
}'
PATCH/api/v1/cases/{caseId}/parties/{partyId}updateCaseParty

ケースの当事者の情報を変更します。

スコープ:CASES_WRITE
パスパラメーター
フィールド型説明
caseId必須string
partyId必須string
リクエストボディ
フィールド型説明
partyType"PERSON" | "ENTITY"PERSON for a person, ENTITY for a company or public body
namestringThe party's name (at most 200 characters)
isSelfbooleantrue when this party is the person the connection acts for; false removes that link
orgNumberstring | null
personalIdNumberstring | null
emailstring (email) | null
phonestring | null
addressstring | null
representedBystring | null
notesstring | null
positionintegerOrder within its role, 0 first
レスポンスデータ(200)
フィールド型説明
caseId必須string
party必須object
curl
curl -X PATCH "https://attorly.ai/api/v1/cases/case_abc123/parties/party_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

オペレーション

GET/api/v1/operations/{operationId}getOperation

Prefer または Idempotency-Key を付けて送信したリクエストの状態と結果を取得します。

パスパラメーター
フィールド型説明
operationId必須string
レスポンスデータ(200)
フィールド型説明
id必須stringop_…
object必須"operation"
operationId必須stringThe REST operation that was called, e.g. createRedlines
status必須"running" | "awaiting_approval" | "succeeded" | "failed"
livemode必須boolean
idempotencyKeystring | null
resultUrl必須stringWhere to poll: /api/v1/operations/{id}
createdAt必須string (date-time)
completedAt必須string (date-time) | null
expiresAt必須string (date-time)
httpStatus必須integer | null
result必須anyThe data of the successful call
metaobject
error必須object | null
curl
curl "https://attorly.ai/api/v1/operations/op_abc123" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

Webhook

GET/api/v1/webhook-endpointslistWebhookEndpoints

キーの組織とモードの Webhook エンドポイントを一覧表示します。

curl
curl "https://attorly.ai/api/v1/webhook-endpoints" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/webhook-endpointscreateWebhookEndpoint

Webhook エンドポイントを作成します。レスポンスには一度だけ表示される署名シークレットが含まれます。

リクエストボディ
フィールド型説明
url必須string (uri)HTTPS URL that receives the events
descriptionstring
enabledEvents必須array of stringEvent types to receive, or ["*"] for all
includeSnapshotsbooleanSend object snapshots instead of thin { id, object } payloads, for operations made with organization API keys (calls made with personal keys and connected apps always send thin payloads). Organization owners and admins only.
レスポンスデータ(201)
フィールド型説明
id必須stringwe_…
object必須"webhook_endpoint"
url必須string
descriptionstring | null
enabledEvents必須array of string
status必須"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemode必須boolean
includeSnapshots必須boolean
apiVersion必須string
failingSincestring (date-time) | null
createdAt必須string (date-time)
updatedAt必須string (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl -X POST "https://attorly.ai/api/v1/webhook-endpoints" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/attorly/webhooks",
  "description": "Production receiver",
  "enabledEvents": [
    "analysis.completed",
    "operation.succeeded",
    "operation.failed"
  ]
}'
GET/api/v1/webhook-endpoints/{endpointId}getWebhookEndpoint

Webhook エンドポイントを取得します。

パスパラメーター
フィールド型説明
endpointId必須string
レスポンスデータ(200)
フィールド型説明
id必須stringwe_…
object必須"webhook_endpoint"
url必須string
descriptionstring | null
enabledEvents必須array of string
status必須"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemode必須boolean
includeSnapshots必須boolean
apiVersion必須string
failingSincestring (date-time) | null
createdAt必須string (date-time)
updatedAt必須string (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
PATCH/api/v1/webhook-endpoints/{endpointId}updateWebhookEndpoint

エンドポイントの URL、イベント、スナップショットを変更するか、無効化・有効化します。

パスパラメーター
フィールド型説明
endpointId必須string
リクエストボディ
フィールド型説明
urlstring (uri)
descriptionstring | null
enabledEventsarray of string
includeSnapshotsboolean
status"enabled" | "disabled"Disable to pause deliveries; enable to resume
レスポンスデータ(200)
フィールド型説明
id必須stringwe_…
object必須"webhook_endpoint"
url必須string
descriptionstring | null
enabledEvents必須array of string
status必須"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemode必須boolean
includeSnapshots必須boolean
apiVersion必須string
failingSincestring (date-time) | null
createdAt必須string (date-time)
updatedAt必須string (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl -X PATCH "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
DELETE/api/v1/webhook-endpoints/{endpointId}deleteWebhookEndpoint

Webhook エンドポイントとその配信履歴を削除します。

パスパラメーター
フィールド型説明
endpointId必須string
レスポンスデータ(200)
フィールド型説明
id必須string
object必須"webhook_endpoint"
deleted必須true
curl
curl -X DELETE "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/webhook-endpoints/{endpointId}/secret-rollsrollWebhookEndpointSecret

署名シークレットを置き換えます。古いシークレットも 24 時間は署名に使われます。

パスパラメーター
フィールド型説明
endpointId必須string
レスポンスデータ(200)
フィールド型説明
id必須stringwe_…
object必須"webhook_endpoint"
url必須string
descriptionstring | null
enabledEvents必須array of string
status必須"enabled" | "disabled"
disabledReasonstring | nulldisabled_by_user or failing_deliveries
livemode必須boolean
includeSnapshots必須boolean
apiVersion必須string
failingSincestring (date-time) | null
createdAt必須string (date-time)
updatedAt必須string (date-time)
secretstringwhsec_… — only when the endpoint is created or its secret rolled
curl
curl -X POST "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId/secret-rolls" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
POST/api/v1/webhook-endpoints/{endpointId}/test-eventssendWebhookTestEvent

このエンドポイントにだけ webhook_endpoint.test イベントを送信します。

パスパラメーター
フィールド型説明
endpointId必須string
レスポンスデータ(202)
フィールド型説明
eventId必須string
curl
curl -X POST "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId/test-events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
GET/api/v1/webhook-endpoints/{endpointId}/deliverieslistWebhookDeliveries

エンドポイントの配信を、試行と結果付きで新しい順に一覧表示します。

パスパラメーター
フィールド型説明
endpointId必須string
クエリパラメーター
フィールド型説明
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
status"pending" | "succeeded" | "failed"Only deliveries in this state
curl
curl "https://attorly.ai/api/v1/webhook-endpoints/your_endpointId/deliveries" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"

イベント

GET/api/v1/eventslistEvents

過去 30 日間のイベントを新しい順に一覧表示します。

クエリパラメーター
フィールド型説明
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
typestringOnly events of this type, e.g. analysis.completed
curl
curl "https://attorly.ai/api/v1/events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/events/{eventId}getEvent

Webhook エンドポイントが受け取る形式でイベントを取得します。

パスパラメーター
フィールド型説明
eventId必須string
レスポンスデータ(200)
フィールド型説明
id必須stringevt_… — also sent as the webhook-id header; deduplicate on it
object必須"event"
type必須"analysis.completed" | "analysis.failed" | "redlines.generated" | "due_diligence.report.completed" | "operation.succeeded" | "operation.failed" | …
apiVersion必須string
createdAt必須string (date-time)
livemode必須boolean
data必須object
curl
curl "https://attorly.ai/api/v1/events/your_eventId" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
POST/api/v1/events/{eventId}/redeliveriesredeliverEvent

イベントを 1 つのエンドポイント、または購読しているすべてのエンドポイントに再送信します。

パスパラメーター
フィールド型説明
eventId必須string
リクエストボディ
フィールド型説明
endpointIdstringOnly this endpoint; default every endpoint subscribed to the event
レスポンスデータ(202)
フィールド型説明
eventId必須string
deliveriesScheduled必須integer
curl
curl -X POST "https://attorly.ai/api/v1/events/your_eventId/redeliveries" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "endpointId": "we_abc123"
}'

アカウント・使用状況・ログ

GET/api/v1/organizationgetOrganization

キーの組織:プラン、AI クレジット、既定の法域、キーで許可されている操作。

レスポンスデータ(200)
フィールド型説明
organization必須object
user必須object
plan必須stringSTANDARD, PRO or ENTERPRISE
billing必須object
defaultJurisdiction必須string | nullISO 3166-1 alpha-2 country used when a document names no governing law
credential必須object
appUrl必須string
curl
curl "https://attorly.ai/api/v1/organization" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/usagegetUsage

REST と MCP の日別・キー別・オペレーション別のリクエスト数とエラー数。

クエリパラメーター
フィールド型説明
fromanyISO 8601 date; default 30 days ago (requests are kept 30 days)
toanyISO 8601 date, exclusive; default now
curl
curl "https://attorly.ai/api/v1/usage" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/request-logslistRequestLogs

組織の過去 30 日間の API リクエストを新しい順に一覧表示します。

クエリパラメーター
フィールド型説明
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
statusstring2xx, 4xx, 5xx, or an exact status
credentialIdstringOnly requests made with this key (apikey:<id>, or an MCP connection id)
operationIdstringOnly calls of this operation, e.g. createRedlines
requestIdstringOne request, by its Request-Id
sinceanyISO 8601; only requests at or after this time
untilanyISO 8601; only requests before this time
curl
curl "https://attorly.ai/api/v1/request-logs" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
GET/api/v1/audit-eventslistAuditEvents

誰が何を、いつ、どのキーで呼び出したか。組織のオーナーと管理者向けです。

クエリパラメーター
フィールド型説明
limitintegerItems per page, 1–100 (default 20)
cursorstringThe nextCursor of the previous page
statusstring2xx, 4xx, 5xx, or an exact status
credentialIdstringOnly requests made with this key (apikey:<id>, or an MCP connection id)
operationIdstringOnly calls of this operation, e.g. createRedlines
requestIdstringOne request, by its Request-Id
sinceanyISO 8601; only requests at or after this time
untilanyISO 8601; only requests before this time
curl
curl "https://attorly.ai/api/v1/audit-events" \
  -H "Authorization: Bearer $ATTORLY_API_KEY"
DELETE/api/v1/test-datadeleteTestData

組織のテストモードのオブジェクト、イベント、オペレーションをすべて削除します。テストキー専用です。

レスポンスデータ(200)
フィールド型説明
object必須"test_data_purge"
deleted必須object
curl
curl -X DELETE "https://attorly.ai/api/v1/test-data" \
  -H "Authorization: Bearer $ATTORLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"