Extract parties, dates, and clauses from contracts into structured JSON for legal review workflows.
Who this is for
Legal teams and contract management platforms use this recipe to automate contract review. Upload a contract and receive structured JSON with involved parties, key dates, and individual clauses — ready for compliance checks, risk analysis, or contract databases.
curl -X POST https://api.iterationlayer.com/document-extraction/v1/extract \
-H"Authorization: Bearer YOUR_API_KEY"\
-H"Content-Type: application/json"\
-d'{
"files": [
{
"type": "url",
"name": "contract.pdf",
"url": "https://example.com/contracts/service-agreement.pdf"
}
],
"schema": {
"fields": [
{ "name": "parties", "type": "ARRAY", "description": "Parties involved in the contract", "fields": [
{ "name": "name", "type": "TEXT", "description": "Name of the party" },
{ "name": "role", "type": "TEXT", "description": "Role of the party (e.g. client, provider)" }
]},
{ "name": "effective_date", "type": "DATE", "description": "Date the contract takes effect" },
{ "name": "termination_date", "type": "DATE", "description": "Date the contract expires or terminates" },
{ "name": "clauses", "type": "ARRAY", "description": "Individual contract clauses", "fields": [
{ "name": "title", "type": "TEXT", "description": "Clause heading or title" },
{ "name": "content", "type": "TEXTAREA", "description": "Full text of the clause" }
]}
]
}
}'
import{IterationLayer}from"iterationlayer";constclient=newIterationLayer({apiKey:"YOUR_API_KEY"});constresult=awaitclient.extract({files:[{type:"url",name:"contract.pdf",url:"https://example.com/contracts/service-agreement.pdf",},],schema:{fields:[{name:"parties",type:"ARRAY",description:"Parties involved in the contract",fields:[{name:"name",type:"TEXT",description:"Name of the party"},{name:"role",type:"TEXT",description:"Role of the party (e.g. client, provider)"},]},{name:"effective_date",type:"DATE",description:"Date the contract takes effect"},{name:"termination_date",type:"DATE",description:"Date the contract expires or terminates"},{name:"clauses",type:"ARRAY",description:"Individual contract clauses",fields:[{name:"title",type:"TEXT",description:"Clause heading or title"},{name:"content",type:"TEXTAREA",description:"Full text of the clause"},]},],},});console.log(result);
fromiterationlayerimportIterationLayerclient=IterationLayer(api_key="YOUR_API_KEY")result=client.extract(files=[{"type":"url","name":"contract.pdf","url":"https://example.com/contracts/service-agreement.pdf",}],schema={"fields":[{"name":"parties","type":"ARRAY","description":"Parties involved in the contract","fields":[{"name":"name","type":"TEXT","description":"Name of the party"},{"name":"role","type":"TEXT","description":"Role of the party (e.g. client, provider)"},]},{"name":"effective_date","type":"DATE","description":"Date the contract takes effect"},{"name":"termination_date","type":"DATE","description":"Date the contract expires or terminates"},{"name":"clauses","type":"ARRAY","description":"Individual contract clauses","fields":[{"name":"title","type":"TEXT","description":"Clause heading or title"},{"name":"content","type":"TEXTAREA","description":"Full text of the clause"},]},]},)print(result)
packagemainimport("fmt"il"github.com/iterationlayer/sdk-go")funcmain(){client:=il.NewClient("YOUR_API_KEY")result,err:=client.Extract(il.ExtractRequest{Files:[]il.FileInput{il.NewFileFromURL("contract.pdf","https://example.com/contracts/service-agreement.pdf"),},Schema:il.ExtractionSchema{"parties":il.NewArrayFieldConfig("parties","Parties involved in the contract",il.ExtractionSchema{"name":il.NewTextFieldConfig("name","Name of the party"),"role":il.NewTextFieldConfig("role","Role of the party (e.g. client, provider)"),}),"effective_date":il.NewDateFieldConfig("effective_date","Date the contract takes effect"),"termination_date":il.NewDateFieldConfig("termination_date","Date the contract expires or terminates"),"clauses":il.NewArrayFieldConfig("clauses","Individual contract clauses",il.ExtractionSchema{"title":il.NewTextFieldConfig("title","Clause heading or title"),"content":il.NewTextFieldConfig("content","Full text of the clause"),}),},})iferr!=nil{panic(err)}fmt.Println(result)}