Document List
On This Page

API calls

How to Make API Calls to ProcessMind

This guide will provide you with examples and best practices for making API calls to ProcessMind’s services. Whether you’re looking to retrieve data, submit information, or automate workflows, understanding how to interact with our API is essential. For detailed API documentation, including available endpoints, authentication methods, example requests, response formats, and step-by-step integration guides, please visit our API Documentation on GitHub.

Authentication Variables

  • apiKey For all API requests, you will need to include your API key in the request headers for authentication. The API key can be obtained from your ProcessMind account settings.
  • tenantId Some API endpoints require a Tenant ID to specify the context of the request. This ID is unique to your organization and can also be found in your account settings.
  • datatableId When working with datasets, you will need to provide the Datatable ID to identify which datatable you are interacting with. This ID is available in the dataset settings menu [Get Data Table ID] within ProcessMind.

Direct File Uploads

ProcessMind supports direct file uploads to datatables using presigned URLs. This method allows you to securely upload files without exposing your API key or other sensitive information. Keep in mind that presigned URLs are time-limited and should be used promptly after retrieval. To access the direct upload URL you need to make a GET request to the endpoint. This URL can be retrieved by going to the dataset settings menu [Get upload URL] within ProcessMind. Here the time limit can be set from 1 hour, 1 week or 1 month maximum.

API Endpoint Overview

MethodEndpointDescription
GET/tenant/{tenantId}/datatable/{datatableId}/uploads/presignedurlReturns a temporary pre‑signed URL for uploading a file to a datatable.
GET/tenant/{tenantId}/datasetsReturns a list of datasets for the given tenant.
GET/tenant/{tenantId}Returns details about the specified tenant.
GET/tenant/{tenantId}/organizationReturns information about the tenant’s organization.

API Base URL

All API requests should be made to the following base URL: https://api.processmind.com

How to Get a Pre‑signed Upload URL

Endpoint: GET /tenant/{tenantId}/datatable/{datatableId}/uploads/presignedurl
Parameters:

  • tenantId – ID of the tenant (string).
  • datatableId – ID of the datatable you want to upload to (string).
  • apiKey – Your API key (string).

Returns:
A response object containing PreSignedUploadUrl, which is a temporary URL you can use to upload a file directly (usually via HTTP PUT).

Example (using the helper):

const presignedUrl = await getPresignedUploadUrl({
	apiKey,
	tenantId: "tenant-123",
	datatableId: "table-456"
});
console.log(presignedUrl); // e.g. https://s3.amazonaws.com/…?X-Amz-Signature=…

How to List Datasets

Endpoint: GET /tenant/{tenantId}/datasets
Parameters:

  • tenantId – ID of the tenant.
  • apiKey – Your API key.

Returns:
An array of dataset objects belonging to the tenant.

Example:

const datasets = await getDatasets({
	apiKey,
	tenantId: "tenant-123"
});
console.log(datasets);

How to Retrieve Tenant Details

Endpoint: GET /tenant/{tenantId}
Parameters:

  • tenantId – ID of the tenant.
  • apiKey – Your API key.

Returns:
An object with metadata about the tenant such as name, created date and plan.

Example:

const tenantInfo = await getTenant({
	apiKey,
	tenantId: "tenant-123"
});
console.log(tenantInfo);

How to Retrieve Organization Details

Endpoint: GET /tenant/{tenantId}/organization
Parameters:

  • tenantId – ID of the tenant.
  • apiKey – Your API key.

Returns:
Information about the organization associated with the tenant (e.g. company name, address, contact details).

Example:

const org = await getOrganization({
	apiKey,
	tenantId: "tenant-123"
});
console.log(org);

How to Upload a File

The uploadFile function demonstrates how to upload a file using the pre‑signed URL. The general flow is:

  1. Get the pre‑signed URL using the getPresignedUploadUrl call.
  2. Perform a PUT request to that URL with the file contents. The pre‑signed URL authorizes the upload directly to the storage provider, so no further credentials are needed.
  3. (Optionally) Notify your API that the upload is complete, if required by your backend.

Here is a simplified example using fetch to upload a file:

async function uploadFile({ apiKey, tenantId, datatableId, file }) {
	// Step 1: Obtain a pre-signed URL
	const uploadUrl = await getPresignedUploadUrl({ apiKey, tenantId, datatableId });
	
	// Step 2: Upload the file via PUT
	await fetch(uploadUrl, {
		method: "PUT",
		headers: {
			"Content-Type": file.type
		},
		body: file
	});
	
	// Step 3: Optionally notify your API of completion
	// (depends on your backend implementation)
}

info

  • Pre‑signed URLs expire after a set time (often minutes). Use the URL promptly after fetching it.
  • If an upload fails (e.g. network interruption), request a new pre‑signed URL before retrying.
  • Always keep your apiKey secure and do not expose it on the client side (e.g. in a public front‑end).

Bash Example: Uploading a File

Minimal Bash script to upload a file to ProcessMind using two curl calls, with placeholders for all values

Download BASH Example

Node.js Example: Uploading a Local CSV File

Uploads a local CSV file to ProcessMind using a presigned URL.

Steps:

  1. Fetch a presigned upload URL from the API.
  2. Read the local file from disk.
  3. Upload the file to the presigned URL using HTTP PUT.

Configuration:

  • Provide your API key, tenantId, datatableId, and filePath when calling uploadFileToProcessMind().
  • The API base URL is set to https://api.processmind.com
Download NodeJS Example

Python Example: Uploading a Local CSV File

Uploads a local CSV file to a remote API using a presigned URL.

Steps:

  1. Fetch a presigned upload URL from the API.
  2. Read the local file from disk.
  3. Upload the file to the presigned URL using HTTP PUT.

Configuration:

  • Update api_key, tenant_id, datatable_id, file_path as needed.
Download Python Example

info

For detailed API documentation, including available endpoints, authentication methods, example requests, response formats, and step-by-step integration guides, please visit our API Documentation on GitHub. If you have any questions or need assistance with using the API, feel free to reach out to our support team or join our developer community forums.