---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Workday AI Gateway, AI Gateway]
nav: wcp_docs
parent_url: /wcp_docs/
title: Contracts REST API
layout: subsection
---

The Contracts REST API uses machine learning to simplify the handling and processing of contracts in order to automate user flows. Using vision and large language model (LLM) technologies, the Contracts REST APIs can scan PDFs or images (JPGs and PNGs), and extract key entities from customer and supplier contracts alike.

Sample use case:

-   As a contract administrator, you want to extract data from supplier contracts for automated onboarding processes. You can call the Contracts REST API to extract key fields from supplier contracts, and use the response as input to automated onboarding processes at your company.


## <a id="section_1"></a>URL Base Path

The Contracts REST API endpoint uses this base URL:

```
https://api.workday.com/ml/docint/{version}
```

For regional URL base paths, see [Reference: Workday Extend API Gateways and Authorization Base URLs](/wcp_docs/dlh1653340161856.html)

## <a id="section_6"></a>Scanning Contracts

To scan and parse an input document, call this endpoint:

```
POST {baseURL}/contracts
```

Specify the required `document_type` query parameter, which must be one of these values:

-   `supplier_contract`
-   `customer_contract`


The supported file types are:

-   PDF
-   JPG or JPEG
-   PNG


The endpoint scans the file attachment and returns:

-   `text` - The document content as newline-separated strings.
-   `fields` - A list of extracted field attributes, such as:

    -   `type` - The extracted type of entity in the document.
    -   `page_number` - The page number in the document.
    -   `mention_text` - The raw text of the entity.
    -   `start_index` - The beginning character position of the entity in the extracted text.
    -   `end_index` - The ending character position of the entity in the extracted text.
    -   `normalized_value` - The value in a standardized format. Examples: Trailing spaces are removed and date fields are returned as YYYY-MM-DD.
    -   `normalized_vertices` - The location index of the text box in the document.



## <a id="section_16"></a>Example

This sample request returns a list of fields from the uploaded image of a customer contract:

```
POST https://api.workday.com/ml/docint/v1/contracts?document_type=customer_contract
```

Sample file: data-binary @/tmp/contract.pdf

Sample response:

```
{
"text": "[ABOUT LOGO]\nEXHIBIT 10.3\nCO-BRANDING AGREEMENT\nThis Agreement (the \"Agreement\"), dated this 19th day of January, 2001 (the\n\"Effective Date\"), is by and between About.com, Inc. (\"About\"), a Delaware\ncorporation, located at 1440 Broadway, 19th Floor, New York, NY 10018 and\nebix.com, Inc. (\"ebix\"), a Delaware corporation, ....\nAgreed and Accepted:\nEBIX.COM, INC.\nName:\nTitle:\nSignature:\nDate:\nABOUT.COM, INC.\nName:\nTitle:\nSignature:\nDate:\n** Confidential treatment has been requested for portions of this document.\nThe redacted material has been filed with the commission pursuant to an\napplication for confidential treatment.\nSource: EBIX INC, 10-Q, 5/15/2001\n11\n",
"fields": [
 {
   "type": "document_name",
   "page_number": 1,
   "start_index": 26,
   "end_index": 48,
   "mention_text": "CO-BRANDING AGREEMENT\n",
   "normalized_value": "CO-BRANDING AGREEMENT",
   "normalized_vertices": [
     [
       0.08149910718202591,
       0.09541824460029602
     ],
     [
       0.21237358450889587,
       0.09541824460029602
     ],
     [
       0.21237358450889587,
       0.10004203766584396
     ],
     [
       0.08149910718202591,
       0.10004203766584396
     ]
   ]
 },
 {
   "type": "effective_date",
   "page_number": 1,
   "start_index": 93,
   "end_index": 119,
   "mention_text": "19th day of January, 2001 ",
   "normalized_value": "2001-01-19",
   "normalized_vertices": [
     [
       0.3628792464733124,
       0.11265237629413605
     ],
     [
       0.5306365489959717,
       0.11265237629413605
     ],
     [
       0.5306365489959717,
       0.11853720247745514
     ],
     [
       0.3628792464733124,
       0.11853720247745514
     ]
   ]
 },
 {
   "type": "contract_supplier",
   "page_number": 1,
   "start_index": 161,
   "end_index": 177,
   "mention_text": "About.com, Inc. ",
   "normalized_value": "About.com, Inc.",
   "normalized_vertices": [
     [
       0.31231409311294556,
       0.12147961556911469
     ],
     [
       0.41701367497444153,
       0.12147961556911469
     ],
     [
       0.41701367497444153,
       0.12736444175243378
     ],
     [
       0.31231409311294556,
       0.12736444175243378
     ]
   ]
 },
 {
   "type": "contract_customer",
   "page_number": 1,
   "start_index": 273,
   "end_index": 288,
   "mention_text": "ebix.com, Inc. ",
   "normalized_value": "ebix.com, Inc.",
   "normalized_vertices": [
     [
       0.0820939913392067,
       0.1387137472629547
     ],
     [
       0.18024985492229462,
       0.1387137472629547
     ],
     [
       0.18024985492229462,
       0.14417822659015656
     ],
     [
       0.0820939913392067,
       0.14417822659015656
     ]
   ]
 }
]
}
 
```

