POST
/
{workspaceId}
/
files
/
extract
/
structuredData
import { IntunedClient } from "@intuned/client";

const intunedClient = new IntunedClient({
  apiKey: "<YOUR_API_KEY_HERE>",
  workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
});

async function run() {
  const result = await intunedClient.files.extractStructuredData.sync({
    file: {
      type: "pdf",
      source: {
        type: "url",
        data: "https://intuned.io/example.pdf",
      },
    },
    dataSchema: {
      "type": "object",
      "description": "Employee Information",
      "properties": {
        "name": {
          "type": "string",
        },
        "age": {
          "type": "number",
        },
        "jobTitle": {
          "type": "string",
        },
      },
    },
  });

  // Handle the result
  console.log(result);
}

run();
{
"operationId": "aaaabbbCCCCdddd",
"status": "completed",
"result": {
"firstName": "John",
"lastName": "Doe",
"jobTitle": "Manager"
}
}

Authorizations

x-api-key
string
header
required

API Key used to authenticate your requests. How to create one.

Path Parameters

workspaceId
string
required

Your workspace ID. How to find it?

Body

application/json

The request to extract structured data from file

Response

200
application/json

The extracted data

Structured data extraction result Successful file extraction result