Contract

Maximize the efficiency of contract management with Extracta.ai’s cutting-edge document parsing technology. Our API is designed to automate the extraction of key information from contracts, aiding legal teams, contract managers, and businesses in streamlining contract analysis and compliance checks. This page provides you with a request body template for creating contract extractions, making it easy to integrate our service into your workflow.

Why Use Extracta.ai for Contract Parsing?

  • Streamlined Contract Review: Automate the extraction of key clauses, dates, and obligations.

  • Enhanced Compliance: Easily identify and manage compliance requirements across contracts.

  • Customizable Data Extraction: Focus on the specific details that matter most to your contract management process.

Getting Started

To initiate contract parsing with Extracta.ai, you'll need to perform a POST request to our /createExtraction endpoint using a template tailored for contract documents. This template includes predefined keys that match typical contract elements, facilitating precise data extraction.

Body Example for Contract

JSON Body
{
    "extractionDetails": {
        "name": "Contract - Extraction",
        "language": "English",
        "fields": [
            {
                "key": "contract_details",
                "description": "contract details",
                "type": "object",
                "properties": [
                    {
                        "key": "contract_number",
                        "example": "56-2024",
                        "type": "string"
                    },
                    {
                        "key": "contract_date",
                        "example": "April 20, 2024",
                        "type": "string"
                    }
                ]
            },
            {
                "key": "involved_parties",
                "description": "information about the two parties involved in the contract",
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": [
                        {
                            "key": "name",
                            "type": "string"
                        },
                        {
                            "key": "address",
                            "type": "string"
                        },
                        {
                            "key": "legal_representative",
                            "type": "string"
                        },
                        {
                            "key": "position",
                            "type": "string"
                        }
                    ]
                }
            },
            {
                "key": "contract_object",
                "description": "description of the contract object",
                "type": "string",
                "example": "Design and development of a web application as per the specifications in the attached Project Brief (Document A)"
            },
            {
                "key": "obligations",
                "description": "obligations of the involved parties",
                "type": "object",
                "properties": [
                    {
                        "key": "developer_obligations",
                        "example": "Design and develop a web application, deliver by September 1, 2024, make necessary adjustments within 30 days of delivery",
                        "type": "string"
                    },
                    {
                        "key": "client_obligations",
                        "example": "Pay the total fee in stages, test the application and provide feedback within 30 days of delivery",
                        "type": "string"
                    }
                ]
            },
            {
                "key": "contract_duration",
                "type": "string",
                "example": "12 months"
            },
            {
                "key": "contract_price",
                "type": "string",
                "example": "$200,000"
            }
        ]
    }
}

How to Use This Template

  1. Generate an API Key: If you haven’t already, sign up at https://app.extracta.ai and navigate to the /api page to create your API key.

  2. Execute the API Call: Incorporate the JSON template in your POST request to /createExtraction. Remember to authenticate your request by including your API key as a Bearer token in the request header.

  3. Process the Extracted Data: Upon submitting your request, the API will return structured data extracted from the contract, ready to be utilized in your systems or processes.

Code Example

const axios = require('axios');

/**
 * Initiates a new document extraction process with the provided details.
 * 
 * @param {string} token - The authorization token for API access.
 * @param {Object} extractionDetails - The details of the extraction to be created.
 * @returns {Promise<Object>} The promise that resolves to the API response with the new extraction ID.
 */
async function createExtraction(token, extractionDetails) {
    const url = "https://api.extracta.ai/api/v1/createExtraction";

    try {
        const response = await axios.post(url, {
            extractionDetails
        }, {
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${token}`
            }
        });

        // Handling response
        return response.data; // Directly return the parsed JSON response
    } catch (error) {
        // Handling errors
        throw error.response ? error.response.data : new Error('An unknown error occurred');
    }
}

async function main() {
    const token = 'apiKey';
    const extractionDetails = {}; // the json body from the example

    try {
        const response = await createExtraction(token, extractionDetails);
        console.log("New Extraction Created:", response);
    } catch (error) {
        console.error("Failed to create new extraction:", error);
    }
}

main();

Conclusion

With Extracta.ai, navigating through the complexities of contract analysis becomes a streamlined, automated process. Our API empowers you to focus on strategic aspects of contract management by handling the tedious task of data extraction.

For further details on integrating our API and making the most out of its capabilities, please refer to our API Endpoints and 1. Create extraction pages.

Last updated