/extract-document

Create a new Job for extraction.

Create an Extraction Job

POST https://waveline.ai/api/v1/extract-document

Creates a new job that extracts information from a file using the specified shape.

Headers

Request Body

{
    "id": string,
    "createdAt": string,
    "status": "CREATED",
    "type": "extract",
    "pages": number, // Number of billed pages in this job
    "fileName": string,
    "result": null, // Is null after creation
    "urls": {
        "get": string; // Query this URL to get the status/result of your job
    }
}

Example Usage

Here's an example of a JSON payload for the /extract-document endpoint. In this example, we extract the name and the total amount to pay from an invoice PDF file.

{
  "fileName": "invoice.pdf",
  "contentType": "application/pdf",
  "base64Content": "JVBERi0xLjMKMSAwIG9iago8PC9UeXBlL0NhdGF...",
  "shape": [
    {
      "name": "name",
      "type": "string",
      "description": "The name of the person who needs to pay the invoice",
      "isArray": false
    },
      "name": "total",
      "type": "number",
      "description": "Total amount to pay",
      "isArray": false
    }
  ]
}

To send this payload to the /extract-document endpoint, use the following curl command:

curl -X POST "https://waveline.ai/api/v1/extract-document" \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -d '{ ... JSON payload ... }'

You can get an API key here if you already have an account.

Additional Notes

  • If our system can't find the answer or is unsure of how to fill a field, we put null.

  • Use accurate and descriptive names and descriptions for your shape elements. This helps us and will improve our performance.

Last updated