Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Extracta AI

Scalekit connector
Open markdown

The Extracta AI connector lets your AI agent act in each user's Extracta AI account. Each user connects their own Extracta AI access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 13 tools.

Tools
13
What they doRead · write · destructive
5 · 4 · 45 read4 write4 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Extracta AI connection

    In AgentKit > Connections, create an Extracta AI connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'extracta'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Extracta AI:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'extracta_credits_get',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Extracta AI credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • extracta_classification_batch_results_getGet the predicted document types for a batch of files in an Extracta document classification, or for one file.Read-only

    Get Classification Batch Results

    Get the predicted document types for a batch of files in an Extracta document classification, or for one file. Returns each file's ID, name, status, predicted document type and, when an extraction is linked, its extracted data. Use this to read results; wait at least 2 seconds between calls.

    Inputs

    batch_idstringrequired
    Batch ID. Each upload of files (in the Extracta dashboard or API) creates a batch. Example: -OQc1Ab2Cd3Ef4Gh5Ij.
    classification_idstringrequired
    Classification ID returned by extracta_classification_create. Example: -OQb7Lk2Hn3XyZ9aB1cD.
    file_idstring
    File ID to return the result for only that file. Example: -OQc1Zz9Yy8Xx7Ww6Vv.
  • extracta_classification_getGet an Extracta document classification's settings.Read-only

    Get Classification

    Get an Extracta document classification's settings. Returns its name, description, document types with keywords and linked extraction IDs, and its batches. Use this to check a classification or find batch IDs.

    Inputs

    classification_idstringrequired
    Classification ID returned by extracta_classification_create. Example: -OQb7Lk2Hn3XyZ9aB1cD.
  • extracta_credits_getGet the number of processing credits left on your Extracta account (1 credit = 1 page).Read-only

    Get Credits

    Get the number of processing credits left on your Extracta account (1 credit = 1 page). Returns status and credits. Use this before processing many documents.

    Inputs

    This tool takes no inputs.

  • extracta_extraction_batch_results_getGet the extracted data for a batch of documents in an Extracta extraction, or for one file in it.Read-only

    Get Extraction Batch Results

    Get the extracted data for a batch of documents in an Extracta extraction, or for one file in it. Returns the batch status and, for each file, its fileId, fileName, status, extracted result and file URL. Use this to read results; wait at least 2 seconds between calls. Use extracta_extraction_get to find batch IDs.

    Inputs

    batch_idstringrequired
    Batch ID. Each upload of files (in the Extracta dashboard or API) creates a batch. Example: -OQc1Ab2Cd3Ef4Gh5Ij.
    extraction_idstringrequired
    Extraction ID returned by extracta_extraction_create. Example: -OPXR1F82I0cRYJPcHNo.
    file_idstring
    File ID to return results for only that file. Example: -OQc1Zz9Yy8Xx7Ww6Vv.
  • extracta_extraction_getGet an Extracta extraction template's settings.Read-only

    Get Extraction

    Get an Extracta extraction template's settings. Returns the extraction's name, description, language, options, fields and its batches. Use this to check a template or find batch IDs. Use extracta_extraction_update to change it.

    Inputs

    extraction_idstringrequired
    Extraction ID returned by extracta_extraction_create. Example: -OPXR1F82I0cRYJPcHNo.
  • extracta_classification_createCreate an Extracta document classification that sorts uploaded files into the document types you define, optionally running an extraction on each type.Write

    Create Classification

    Create an Extracta document classification that sorts uploaded files into the document types you define, optionally running an extraction on each type. Returns status and the new classificationId. Files are uploaded in the Extracta dashboard or with the multipart upload API, then read with extracta_classification_batch_results_get.

    Inputs

    document_typesarrayrequired
    The document types to sort files into. Each type has a name, a description, uniqueWords (keywords that identify it) and, optionally, the extractionId of an extraction template to run on files of that type. Example: [{"name": "Invoice", "description": "Commercial invoice from a vendor", "uniqueWords": ["invoice number", "bill to", "total amount"]}, {"name": "Receipt", "d...
    namestringrequired
    A name for the classification. Example: Financial Document Classifier.
    descriptionstring
    What the classification is for. Example: Sorts uploaded files into financial document types.
  • extracta_classification_updateUpdate an Extracta document classification's name, description and document types.Write

    Update Classification

    Update an Extracta document classification's name, description and document types. Returns status and the updated classification. Send the full list of document types; it replaces the current list. Use extracta_classification_get first.

    • Idempotent

    Inputs

    classification_idstringrequired
    Classification ID returned by extracta_classification_create. Example: -OQb7Lk2Hn3XyZ9aB1cD.
    descriptionstringrequired
    What the classification is for. Example: Sorts uploaded files into financial document types.
    document_typesarrayrequired
    The document types to sort files into. Each type has a name, a description, uniqueWords (keywords that identify it) and, optionally, the extractionId of an extraction template to run on files of that type. Example: [{"name": "Invoice", "description": "Commercial invoice from a vendor", "uniqueWords": ["invoice number", "bill to", "total amount"]}, {"name": "Receipt", "d...
    namestringrequired
    A name for the classification. Example: Financial Document Classifier.
  • extracta_extraction_createCreate an Extracta extraction template that defines which fields to pull out of documents and how to process them.Write

    Create Extraction

    Create an Extracta extraction template that defines which fields to pull out of documents and how to process them. Returns status and the new extractionId. Files are then uploaded to the extraction (in the Extracta dashboard, by email or with the multipart upload API) and read with extracta_extraction_batch_results_get.

    Inputs

    fieldsarrayrequired
    The data to extract. Each field has a key, a description, an example and a type: string for one value, object with a properties list of sub-fields, or array with items describing each list element (a string, or an object with properties). Example: [{"key": "name", "description": "Full name of the person", "example": "Alex Smith", "type": "string"}, {"key": "languages", "description": "Languages spoken"...
    languagestringrequired
    Language of the documents. Use Multi-Lingual for mixed or other languages. Example: English.one of Multi-LingualArabicBanglaBulgarianCroatianCzechEnglishFilipinoFrenchGermanHindiHungarianItalianNepaliPolishPortugueseRomanianRussianSerbianSpanishTurkishUkrainianUrduVietnamese
    namestringrequired
    A descriptive name for the extraction template. Example: CVs Extraction.
    checkbox_recognitionboolean
    Set true to read checkbox states (checked or unchecked). Defaults to false. Example: false.
    descriptionstring
    What the extraction is for. Example: Extract candidate details from CVs.
    handwritten_text_recognitionboolean
    Set true when documents contain handwriting. Defaults to false. Example: false.
    has_tableboolean
    Set true when documents contain tables, to add a table analysis step. Defaults to false. Example: false.
    has_visualsboolean
    Set true when documents contain charts, graphs or diagrams to read. Defaults to false. Example: false.
    long_documentboolean
    Set true for very long or complex documents, to avoid timeouts. Defaults to false. Example: false.
    split_pdf_pagesboolean
    Set true to treat each PDF page as a separate document, for example a PDF of one-page invoices. Defaults to false. Example: false.