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
- Access token
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. 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>Create the Extracta AI connection
In AgentKit > Connections, create an Extracta AI connection. The name you give it is the
connection_nameyour code passes. See Configure connections.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.actionsconst connector = 'extracta'const identifier = 'user_123'// Generate an authorization link for the userconst { 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 callconst result = await actions.executeTool({connector,identifier,toolName: 'extracta_credits_get',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "extracta"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Extracta AI:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="extracta_credits_get",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach 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 toexecute_toolextracta_classification_batch_results_getGet the predicted document types for a batch of files in an Extracta document classification, or for one file.Read-onlyGet 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-onlyGet 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-onlyGet 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-onlyGet 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-onlyGet 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.WriteCreate 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.WriteUpdate 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.WriteCreate 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.
extracta_extraction_updateUpdate an Extracta extraction template.WriteUpdate Extraction
Update an Extracta extraction template. Only the settings you send change. Returns status and the updated extraction. Send fields only to replace the whole field list. Use extracta_extraction_get first to see the current fields.
- Idempotent
Inputs
extraction_idstringrequired- Extraction ID returned by extracta_extraction_create. Example: -OPXR1F82I0cRYJPcHNo.
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.
fieldsarray- 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"...
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.
languagestring- Language of the documents. Use Multi-Lingual for mixed or other languages. Example: English.one of
Multi-LingualArabicBanglaBulgarianCroatianCzechEnglishFilipinoFrenchGermanHindiHungarianItalianNepaliPolishPortugueseRomanianRussianSerbianSpanishTurkishUkrainianUrduVietnamese long_documentboolean- Set true for very long or complex documents, to avoid timeouts. Defaults to false. Example: false.
namestring- A descriptive name for the extraction template. Example: CVs Extraction.
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.
extracta_classification_batch_deletePermanently delete one batch, with its files and results, from an Extracta document classification.DestructiveDelete Classification Batch
Permanently delete one batch, with its files and results, from an Extracta document classification. Returns status and a confirmation message. Use extracta_classification_files_delete to remove only some files.
- Idempotent
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.
extracta_classification_deletePermanently delete an Extracta document classification with all its batches, results and files.DestructiveDelete Classification
Permanently delete an Extracta document classification with all its batches, results and files. Returns status and a confirmation message. Use extracta_classification_batch_delete or extracta_classification_files_delete to remove less.
- Idempotent
Inputs
classification_idstringrequired- Classification ID returned by extracta_classification_create. Example: -OQb7Lk2Hn3XyZ9aB1cD.
extracta_classification_files_deletePermanently delete specific files, and their results, from a batch in an Extracta document classification.DestructiveDelete Classification Files
Permanently delete specific files, and their results, from a batch in an Extracta document classification. Returns status and a confirmation message. Use extracta_classification_batch_results_get to find file IDs.
- Idempotent
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_idsarrayrequired- IDs of the files to delete. Example: ["-OQc1Zz9Yy8Xx7Ww6Vv", "-OQc1Zz9Yy8Xx7Ww6Vw"]
extracta_extraction_deletePermanently delete an Extracta extraction with all its batches and files, or only one batch, or one file in a batch.DestructiveDelete Extraction, Batch or File
Permanently delete an Extracta extraction with all its batches and files, or only one batch, or one file in a batch. Returns status and a confirmation message. Send only extraction_id to delete everything; add batch_id to delete one batch; add batch_id and file_id to delete one file.
- Idempotent
Inputs
extraction_idstringrequired- Extraction ID returned by extracta_extraction_create. Example: -OPXR1F82I0cRYJPcHNo.
batch_idstring- Batch ID to delete only that batch (and its files) instead of the whole extraction. Example: -OQc1Ab2Cd3Ef4Gh5Ij.
file_idstring- File ID to delete only that file. Needs batch_id too. Example: -OQc1Zz9Yy8Xx7Ww6Vv.
No tools match.