{"openapi":"3.1.0","info":{"title":"General Legal API","description":"# General Legal API\n\nProgrammatic access to your General Legal workspace: open matters, submit documents for\nattorney review, follow the lawyer conversation, and download released versions.\n\n**Base URL:** `https://api.general.legal`\n\n## Testing your integration\n\nMatters created through the API reach a real attorney — do not create test matters.\n\n## Authentication\n\nEvery request needs a client-scoped API key in the `Authorization` header:\n\n```\nAuthorization: Bearer glk_...\n```\n\nCreate and revoke keys in the [client portal](https://portal.general.legal/api-keys)\n(account menu → **API keys**). A key grants access to your organization's data only, and\nits full value is shown once at creation — store it in a secret manager. Revoke a key\nimmediately if it leaks; revocation takes effect within seconds.\n\n## Agent signup (when available)\n\nAn agent without an account can use `POST /api/v1/signup` with its company, verified\ncontact email, and US billing address. Retrieve the current engagement letter URL from\n`GET /api/v1/terms/agent-signup` or the signup response's `engagement_letter_url`, open and\nread the PDF immediately before accepting, then send the emailed six-digit code and\n`engagement_letter_accepted: true` to `POST /api/v1/signup/complete`.\n\nCompletion returns one client-scoped API key exactly once. Store it in a secret manager.\nMatter messages sent with that key reach General Legal lawyers programmatically; no portal\nor Slack account is required for the agent.\n\n## Rate limits\n\nLimits apply per organization (all of your keys combined):\n\n| Budget | Limit | On excess |\n| --- | --- | --- |\n| Reads (GET) | 120 / minute | `429` with `Retry-After` |\n| Writes (POST/PUT) | 20 / minute | `429` with `Retry-After` |\n| New matters (`POST /api/v1/deals`) | 25 / day | `429` with `Retry-After` |\n| Document uploads (`POST /api/v1/documents`) | 50 / day | `429` with `Retry-After` |\n| Thread replies (`POST .../thread`) | 100 / day | `429` with `Retry-After` |\n\nNew organizations (first 14 days) have lower daily budgets.\n\nHonor `Retry-After` (seconds until the window resets). An additional per-IP limit\nexists at the network edge for abuse protection; its `429`s carry no `Retry-After` —\nback off exponentially if you see one. Batch reads with pagination instead of polling\ntight loops. Need higher daily budgets? Contact support.\n\n## Uploading a document\n\nOne multipart request. Attach the file plus optional fields: `deal_id` to add the\ndocument to an existing matter, `contract_id` to upload a new version of an existing\ndocument, or neither to open a fresh matter. Most non-executable file types are\naccepted, up to 20 MiB each. Empty, malformed, virus-infected, macro-bearing, or executable files are rejected.\n\n```bash\ncurl -X POST https://api.general.legal/api/v1/documents   -H \"Authorization: Bearer $GL_API_KEY\"   -F \"file=@nda.docx\"   -F \"context_for_legal=Standard mutual NDA, we are the disclosing party.\"\n```\n\nValidation (file type, size, malware scan) happens synchronously — a `400` means the\nfile was rejected and nothing was stored. On success the document enters AI + attorney\nreview immediately.\n\n## Downloads\n\n`POST /api/v1/contracts/versions/{version_id}/download-link` returns a short-lived\n(~15 min) unauthenticated link for released versions, or stream bytes directly from\n`GET /api/v1/contracts/versions/{version_id}/download` with your API key.\n\nNote: `POST .../download-link` takes no body — send `Content-Length: 0`\n(`curl -X POST -d ''`) or the edge rejects it with `411`.\n\n## Errors\n\nError responses are `{\"detail\": \"<message>\"}` with conventional status codes: `400`\ninvalid request, `401` missing/invalid key, `403` no access to the resource, `404` not\nfound (including resources outside your organization), `409` conflict, `422` malformed\nparameters, `429` rate limited, `500` server error (safe to retry idempotent calls).\n\n## Pagination\n\n`GET /api/v1/deals` takes `page` (1-based) and `page_size` (max 100) and returns\n`{\"items\": [...], \"total\": n, \"page\": p, \"page_size\": s}`.\n","version":"1.0.0"},"servers":[{"url":"https://api.general.legal"}],"paths":{"/api/v1/downloads/{token}":{"get":{"tags":["public-api"],"summary":"Download file bytes","description":"Stream a released document's bytes. `token` comes from\n`POST /api/v1/contracts/versions/{version_id}/download-link` and expires\nafter ~15 minutes; expired or unknown tokens return 404.","operationId":"download_via_link_api_v1_downloads__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/terms/agent-signup":{"get":{"tags":["public-api"],"summary":"Get Agent Signup Terms","operationId":"get_agent_signup_terms_api_v1_terms_agent_signup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Get Agent Signup Terms Api V1 Terms Agent Signup Get"}}}}}}},"/api/v1/signup":{"post":{"tags":["public-api"],"summary":"Start Agent Signup","operationId":"start_agent_signup_api_v1_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSignupBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupStartResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/signup/complete":{"post":{"tags":["public-api"],"summary":"Complete Agent Signup","operationId":"complete_agent_signup_api_v1_signup_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteSignupBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupCompleteResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/signup/resend":{"post":{"tags":["public-api"],"summary":"Resend Agent Signup Code","operationId":"resend_agent_signup_code_api_v1_signup_resend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendSignupBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Resend Agent Signup Code Api V1 Signup Resend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-key-recovery":{"post":{"tags":["public-api"],"summary":"Start Agent Api Key Recovery","operationId":"start_agent_api_key_recovery_api_v1_api_key_recovery_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartApiKeyRecoveryBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRecoveryStartResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/api-key-recovery/complete":{"post":{"tags":["public-api"],"summary":"Complete Agent Api Key Recovery","operationId":"complete_agent_api_key_recovery_api_v1_api_key_recovery_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteApiKeyRecoveryBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRecoveryCompleteResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deals":{"get":{"tags":["public-api"],"summary":"V1 List Deals","description":"List the caller's matters (paginated, optional status filter).","operationId":"v1_list_deals_api_v1_deals_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["new","in_progress","ready_for_review","awaiting_client","closed"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_DealSummary_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api"],"summary":"V1 Create Deal","description":"Open a matter from a written request.","operationId":"v1_create_deal_api_v1_deals_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRequestDealBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealCreated"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deals/{deal_id}":{"get":{"tags":["public-api"],"summary":"V1 Get Deal","description":"Single matter with its documents and released versions.","operationId":"v1_get_deal_api_v1_deals__deal_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DealSummary"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deals/{deal_id}/thread":{"get":{"tags":["public-api"],"summary":"V1 Get Deal Thread","description":"Read the lawyer-client thread for a matter.","operationId":"v1_get_deal_thread_api_v1_deals__deal_id__thread_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadView"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api"],"summary":"V1 Post Deal Thread","description":"Reply to the attorney on a matter's thread.","operationId":"v1_post_deal_thread_api_v1_deals__deal_id__thread_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Deal Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadMessageBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPosted"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contracts":{"get":{"tags":["public-api"],"summary":"V1 List Contracts","description":"List the caller's documents.","operationId":"v1_list_contracts_api_v1_contracts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"exclude_contract_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Exclude Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContractSummary"},"title":"Response V1 List Contracts Api V1 Contracts Get"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents":{"post":{"tags":["public-api"],"summary":"V1 Upload Document","description":"Upload a document in one multipart request (20 MiB max). Most\nnon-executable file types are accepted; encrypted, malformed, or unsafe files\nare rejected. Pass deal_id to attach to a matter, contract_id for a new version\nof an existing document, or neither to open a fresh matter.","operationId":"v1_upload_document_api_v1_documents_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_upload_document_api_v1_documents_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUploaded"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contracts/versions/{version_id}/download":{"get":{"tags":["public-api"],"summary":"V1 Download Version","description":"Stream a released version's bytes directly (authenticated download).","operationId":"v1_download_version_api_v1_contracts_versions__version_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contracts/versions/{version_id}/download-link":{"post":{"tags":["public-api"],"summary":"V1 Create Download Link","description":"Issue a short-lived download link for a released version.","operationId":"v1_create_download_link_api_v1_contracts_versions__version_id__download_link_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadLink"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contracts/{contract_id}":{"get":{"tags":["public-api"],"summary":"V1 Get Contract","description":"Single document with its released versions (version ids feed downloads).","operationId":"v1_get_contract_api_v1_contracts__contract_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractSummary"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Not Found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Conflict"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDetail"}}},"description":"Internal Server Error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiKeyRecoveryCompleteResult":{"properties":{"client_id":{"type":"string","title":"Client Id"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["client_id","api_key"],"title":"ApiKeyRecoveryCompleteResult"},"ApiKeyRecoveryStartResult":{"properties":{"recovery_id":{"type":"string","title":"Recovery Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["recovery_id","status"],"title":"ApiKeyRecoveryStartResult"},"Body_v1_upload_document_api_v1_documents_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"deal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Deal Id"},"contract_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contract Id"},"context_for_legal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context For Legal"},"last_edit_by":{"type":"string","title":"Last Edit By","default":"client"}},"type":"object","required":["file"],"title":"Body_v1_upload_document_api_v1_documents_post"},"ClientRequestDealBody":{"properties":{"initial_request":{"type":"string","title":"Initial Request"},"deal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Name"},"slack_channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel Id"}},"type":"object","required":["initial_request"],"title":"ClientRequestDealBody"},"CompleteApiKeyRecoveryBody":{"properties":{"recovery_id":{"type":"string","title":"Recovery Id"},"code":{"type":"string","title":"Code"},"api_key_replacement_confirmed":{"type":"boolean","title":"Api Key Replacement Confirmed"}},"type":"object","required":["recovery_id","code","api_key_replacement_confirmed"],"title":"CompleteApiKeyRecoveryBody"},"CompleteSignupBody":{"properties":{"signup_id":{"type":"string","title":"Signup Id"},"code":{"type":"string","title":"Code"},"engagement_letter_accepted":{"type":"boolean","title":"Engagement Letter Accepted"}},"type":"object","required":["signup_id","code","engagement_letter_accepted"],"title":"CompleteSignupBody"},"ContractSummary":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"}],"title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"contract_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Type"},"versions":{"anyOf":[{"items":{"$ref":"#/components/schemas/VersionSummary"},"type":"array"},{"type":"null"}],"title":"Versions"}},"additionalProperties":true,"type":"object","required":["id"],"title":"ContractSummary"},"DealCreated":{"properties":{"deal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"}],"title":"Deal Id"},"deal_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"initial_request":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Request"}},"additionalProperties":true,"type":"object","required":["deal_id"],"title":"DealCreated"},"DealSummary":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"}],"title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Created At"},"contracts":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContractSummary"},"type":"array"},{"type":"null"}],"title":"Contracts"},"initial_request":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Request"}},"additionalProperties":true,"type":"object","required":["id"],"title":"DealSummary"},"DocumentUploaded":{"properties":{"deal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"},{"type":"null"}],"title":"Deal Id"},"contract_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"},{"type":"null"}],"title":"Contract Id"},"version_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"},{"type":"null"}],"title":"Version Id"},"contracts":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Contracts"}},"additionalProperties":true,"type":"object","title":"DocumentUploaded"},"DownloadLink":{"properties":{"file_name":{"type":"string","title":"File Name"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version Number"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"download_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Token"},"download_token_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Token Expires At"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"}},"additionalProperties":true,"type":"object","required":["file_name"],"title":"DownloadLink"},"ErrorDetail":{"properties":{"detail":{"type":"string","title":"Detail"}},"type":"object","required":["detail"],"title":"ErrorDetail"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PaginatedResponse_DealSummary_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DealSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","minimum":1.0,"title":"Page"},"page_size":{"type":"integer","minimum":1.0,"title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"PaginatedResponse[DealSummary]"},"ResendSignupBody":{"properties":{"signup_id":{"type":"string","title":"Signup Id"}},"type":"object","required":["signup_id"],"title":"ResendSignupBody"},"SignupCompleteResult":{"properties":{"client_id":{"type":"string","title":"Client Id"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["client_id","api_key"],"title":"SignupCompleteResult"},"SignupStartResult":{"properties":{"signup_id":{"type":"string","title":"Signup Id"},"status":{"type":"string","title":"Status"},"engagement_letter_url":{"type":"string","title":"Engagement Letter Url"}},"type":"object","required":["signup_id","status","engagement_letter_url"],"title":"SignupStartResult"},"StartApiKeyRecoveryBody":{"properties":{"contact_email":{"type":"string","title":"Contact Email"}},"type":"object","required":["contact_email"],"title":"StartApiKeyRecoveryBody"},"StartSignupBody":{"properties":{"company_name":{"type":"string","title":"Company Name"},"contact_email":{"type":"string","title":"Contact Email"},"billing_city":{"type":"string","title":"Billing City"},"billing_state":{"type":"string","title":"Billing State"},"billing_zip":{"type":"string","title":"Billing Zip"}},"type":"object","required":["company_name","contact_email","billing_city","billing_state","billing_zip"],"title":"StartSignupBody"},"ThreadMessageBody":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"ThreadMessageBody"},"ThreadPosted":{"properties":{"message":{"additionalProperties":true,"type":"object","title":"Message"},"hub":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hub"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"}},"additionalProperties":true,"type":"object","required":["message"],"title":"ThreadPosted"},"ThreadView":{"properties":{"has_thread":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Thread"},"messages":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Messages"}},"additionalProperties":true,"type":"object","title":"ThreadView"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionSummary":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"},{"type":"null"}],"title":"Id"},"version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version Number"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"}},"additionalProperties":true,"type":"object","title":"VersionSummary"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}