Skip to main content
This guide walks you through searching for data objects in Pretectum using the API. You will learn how to authenticate, construct search queries, and handle the results.

Overview

Pretectum stores your master data as “data objects” organized within a hierarchical structure:
  • Business Areas: High-level organizational categories (e.g., Customer, Product, Supplier)
  • Schemas: Define the structure and fields for data objects within a business area
  • Datasets: Collections of data objects that share the same schema
The Search API allows you to find data objects across this structure using full-text search and filters.

Before You Begin

To use the Search API, you need:
1

Create an API Key

In the Pretectum app, go to Configuration → API Keys and create a key. It is shown once, at creation, so copy it then. Ask your tenant administrator if you do not have access to that screen.
2

Understand Your Data

Familiarize yourself with the business areas, schemas, and datasets in your tenant. This knowledge helps you construct effective search queries.
3

Set Up Your Environment

Ensure you have a way to make HTTP requests from your application. This guide includes examples using cURL, JavaScript, and Python.

Step 1: Create an API Key

Create a key in the Pretectum app under Configuration → API Keys. A key looks like this:
The key is shown once, at the moment it is created. Pretectum stores only a hash of it and cannot show it again. Copy it before closing the dialog.
Keep it in a secret manager or an environment variable. A key is a long-lived credential: it does not expire unless you give it an expiry date, and there is no token to refresh.

Step 2: Search for Data Objects

With your key, you can now search for data objects. Include it in the Authorization header. Search for data objects containing a specific term:

Search with Filters

Narrow your search by specifying business area, schema, or dataset.
To get the list of business area names available to your application, use the List Business Areas endpoint. See the Working with Business Areas guide for complete examples.
To get the list of schema names within a business area, use the List Schemas endpoint. See the Working with Schemas guide for complete examples.
To get the list of dataset names within a schema, use the List Datasets endpoint. See the Working with Datasets guide for complete examples.

Advanced Query Syntax

The search query supports two types of searches: full-text search across all fields, and field-specific search for filtering by attribute values.
Search for terms across all indexed fields:
Combine terms with AND, OR, NOT operators:
Filter by specific attribute values using field:value syntax:
Filter by numeric or date ranges:
Use comparison operators with bracket notation for field names with spaces:
Combine multiple search patterns:
For a complete reference of all query syntax options, see the Search API Reference.

Step 3: Handle the Response

The search response includes matching data objects and a total count:

Understanding the Response

Additional fields in each hit depend on the schema configuration for that data object.

Step 4: Implement Pagination

For large result sets, retrieve data in pages:

Complete Example

Here is a complete example that authenticates and searches for data objects:

Error Handling

Handle common error scenarios in your application:

Next Steps

API Reference

View the complete Search API reference

API Keys

Learn more about authentication

Business Areas

Learn how to work with business areas

List Business Areas API

Get available business area names for filtering

Schemas

Learn how to work with schemas

List Schemas API

Get available schema names for filtering

Datasets

Learn how to work with datasets

List Datasets API

Get available dataset names for filtering