Skip to main content

Get or list parsers

Read the introduction to parsers to understand Parsers.

Below is a guide to getting and deleting parsers.

Get all parsers in your account#

API Endpoint#

GET https://api.documentpro.ai/v1/templates

Example implementation using Python#

import requests
# Your API keyapi_key = 'YOUR_API_KEY'
url = f"https://api.documentpro.ai/v1/templates"
payload = {}headers = {  'x-api-key': api_key}
response = requests.request("GET", url, headers=headers, data=payload)print(response)

Successful response body#

Example response with status code 200

{  "success": true,  "items": [    {      "template_id": "710a20fc-e280-43eb-9a9f-5436e600c710",      "template_title": "Custom Invoice Parser",      "template_type": "Invoice",      "template_category": "other",      "template_schema": {        "fields": [          {            "name": "buyer_name",            "type": "text",            "description": "name of the buyer"          },          {            "name": "total_amount",            "type": "number"          },          {            "name": "line_items",            "type": "table",            "description": "invoice line items",            "subFields": [              {                "name": "description",                "type": "text",                "description": "description of item"              },              {                "name": "subtotal",                "type": "number"              }            ]          }        ]      }      "email_id": "test_parser_22_fbb499@inbox.documentpro-ai.com",      "webhook_url": null,      "parser_config": {        "date_format": null,        "outbound_integration": null,        "ocr_config": {          "engine": "aws_textract",          "precision": "low",          "auto_select_precision": true,          "formatting_level": "low",          "show_page_number": false,          "split_by_page": false,          "trim_spaces": true,          "show_type_label": true        },        "query_config": {          "query_model": "gpt-3.5-turbo-1106",          "set_max_output_tokens": false,          "include_example": false,          "minimize_tokens": false,          "selected_language": "english"        }      },      "created_at": "2023-11-15T12:13:12.056281"    },    ...  ],  "pagination_key": {    "template_id": "420a20fc-e280-43eb-9a9f-5436e600c853",  }}

Get a parser in your account#

API Endpoint#

GET https://api.documentpro.ai/v1/templates/{template_id}

Example implementation using Python#

import requests
# Your API keyapi_key = 'YOUR_API_KEY'
template_id = 'template_id'url = f"https://api.documentpro.ai/v1/templates/{template_id}"
payload = {}headers = {  'x-api-key': api_key}
response = requests.request("GET", url, headers=headers, data=payload)print(response)

Successful response body#

Example response with status code 200

{    "template_id": "710a20fc-e280-43eb-9a9f-5436e600c710",    "template_title": "Custom Invoice Parser",    "template_type": "Invoice",    "template_category": "other",    "template_schema": {    "fields": [        {        "name": "buyer_name",        "type": "text",        "description": "name of the buyer"        },        {        "name": "total_amount",        "type": "number"        },        {        "name": "line_items",        "type": "table",        "description": "invoice line items",        "subFields": [            {            "name": "description",            "type": "text",            "description": "description of item"            },            {            "name": "subtotal",            "type": "number"            }        ]      }    },    "email_id": "test_parser_22_fbb499@inbox.documentpro-ai.com",    "webhook_url": null,    "parser_config": {      "date_format": null,      "outbound_integration": null,      "ocr_config": {          "engine": "aws_textract",          "precision": "low",          "auto_select_precision": true,          "formatting_level": "high",          "show_page_number": false,          "split_by_page": false,          "trim_spaces": true,          "show_type_label": false,          "detect_layout": true,          "detect_tables": false,          "remove_headers": true,          "remove_footers": true,          "remove_tables": false,          "remove_extra_whitespace": false,          "remove_extra_newlines": false,          "table_format": "markdown",          "tabulation_format": "github",          "minimize_table_cell_borders": false      },      "query_config": {          "query_model": "gpt-3.5-turbo-0125",          "set_max_output_tokens": false,          "include_example": false,          "minimize_tokens": true,          "selected_language": null      }    },    "created_at": "2023-11-15T12:13:12.056281"}