Create a datasource --- declare object types (e.g. wiki_page, account) plus their property definitions (custom attributes such as department, priority), and optionally a tree of sub-datasources (used as the first/second-level filters in the search UI). Everything goes in a single POST /datasources call.
Index documents --- send the standard built-in fields plus a custom_properties array whose name values match the property definitions, and (optionally) reference a sub-datasource by its key.
Every document carries a set of standard (built-in) fields that amberSearch already knows how to index, display, and filter. On top of those you can define custom attributes (property definitions) for metadata specific to your datasource.
Define properties and subs before you index documents that reference them. Adding or changing definitions later can delay or skew search behavior until affected documents are re-indexed (for example by re-sending them with POST .../documents).
Several identifiers in the Indexing API must be slugs in word_word form:
Datasource name --- e.g. internal_wiki
Sub key --- e.g. engineering, runbooks
The slug regex is ^[a-z][a-z0-9]*(_[a-z][a-z0-9]*)*$:
lowercase letters and digits only,
words separated by single underscores (no hyphens, no spaces, no leading digit).
For subs, the key is auto-generated from name if you omit it (e.g. "HR Documents" → hr_documents). The datasource name must always be supplied explicitly.
file_type is required on every document and tells amberSearch how to render and treat the content. It must be one of:message, merge_request, issue, wiki, markdown, blog, content, timeline, email, file, directory, email_parent, issue_parent, wiki_parent, page, merge_request_parent, webpage, asset.Pick the value that best matches the source object (e.g. wiki for a wiki page, file for an arbitrary uploaded file, webpage for a scraped page, email for a mail message). The list is also exposed at runtime:
curl -X GET "https://customerDomain.ambersearch.de/api/indexing/file-types" \ -H "Authorization: Bearer YOUR_API_KEY"
amberSearch uses a three-level filter hierarchy for every datasource. These levels let users progressively narrow results:
Level
Field on the document
Source
Example UI label
Level 0
datasource
The datasource name.
”Internal Wiki” (= display_name)
Level 1
data_source_sub
A top-level sub key.
”Engineering” (= sub name)
Level 2
data_source_sub_sub
A child sub key.
”Runbooks” (= sub name)
Subs are declared on the datasource (during creation, or later via the sub endpoints). On documents you reference subs by their key (the slug); amberSearch derives the human-readable label from the sub’s name and the compound storage values automatically.
If a data_source_sub_sub key is unique across the datasource, you can send it on a document withoutdata_source_sub --- amberSearch will infer the parent. If the same child key appears under multiple parents the request fails with AMBIGUOUS_DATA_SOURCE_SUB_SUB; set data_source_sub explicitly in that case.
For metadata that goes beyond the built-in fields, you declare property definitions inside an object definition on the datasource and send matching custom_properties on each document.Each property definition requires:
name --- the attribute key you reference later in custom_properties when indexing documents.
display_label --- the attribute display name shown in the search UI.
You also choose whether values should be searchable (is_searchable): when true, the property values are included in the full-text index so users can find documents by typing those values in a free-text query --- not only via structured filters.
Create the datasource (with subs and property schemas)
POST /api/indexing/datasources --- include subs for the sub-datasource tree and object_definitions (with nested property_definitions) so amberSearch knows which metadata fields exist for each object type.
Unique slug (word_word, max 128 chars). Lowercase letters and digits separated by single underscores.
display_name
Yes
Label shown in the search UI (max 255 chars).
icon_base64
No
Base64-encoded icon image for the datasource (e.g. PNG, SVG).
subs
No
Initial sub-datasource tree. Each entry is a SubDefinition. Children may be nested via children (max 2 levels: a top-level sub and one level of children).
object_definitions
No
List of object types. Each has a name, optional display_label, and a list of property_definitions.
Attribute key --- the identifier you use later in custom_properties on documents.
display_label
Yes
Attribute display name --- human-readable label shown in the search UI.
property_type
No
TEXT (default), INTEGER, DATE, BOOLEAN.
is_searchable
No
false (default). When true, property values are included in the full-text index so documents are findable by free-text queries on those values --- not only via structured filters.
When to set is_searchable: true --- Use it for values users might type in a search box, such as ticket IDs, project codes, or category names. Leave it false for purely structural metadata (e.g. internal database IDs or numeric scores) that should only be available as structured filters.
Response codes for DELETE /datasources/{name}/subs/{sub_key}
Code
When
204 No Content
Sub deleted (children cascade).
404 Not Found
Datasource not found, or no sub with that key exists for the datasource.
Deleting a sub does not delete documents that reference it; those documents will remain in the index but lose the sub-level filter binding until you re-index them with a valid data_source_sub / data_source_sub_sub.
curl -X GET "https://customerDomain.ambersearch.de/api/indexing/datasources" \ -H "Authorization: Bearer YOUR_API_KEY"
Get one (returns the datasource and its full sub tree)
curl -X GET "https://customerDomain.ambersearch.de/api/indexing/datasources/internal_wiki" \ -H "Authorization: Bearer YOUR_API_KEY"
Update --- PUT /api/indexing/datasources/{name}. Only display_name, icon_base64, and object_definitions can be changed here. Subs must be added or removed via the sub endpoints.