How it works
A connector runs three stages on every sync cycle:- Discover - the connector lists all available resources from the provider: Slack channels, GitHub repos, Linear teams and projects, Notion databases and pages, Gmail labels. Call
GET /connectors/:id/discoverto see what’s available before committing. - Configure - you choose which resources to activate and set sync options. Call
POST /connectors/:id/configurewith the list of resource IDs to enable. - Sync - HydraDB fetches objects from each active resource since the last cursor and ingests them as app sources. Sync runs on a schedule (default: hourly) or on demand via
POST /connectors/:id/sync.
Authentication
All connector endpoints use the same API key as the rest of HydraDB:Creating a connector
provider_account_scope
provider_account_scope tells HydraDB which external account this connector belongs to. It becomes part of the deduplication key for every object the connector syncs, so two objects with the same content but from different accounts don’t overwrite each other.
What value to use and where to find it:
Why it matters: if you create two Slack connectors for different workspaces but give them the same
provider_account_scope (or omit it on both), their synced messages share a deduplication namespace and will overwrite each other. Set a distinct value per connector whenever you connect more than one account of the same provider.
Configuring resources
After creation, activate specific resources to sync:lookback_days controls how far back in time the first sync fetches historical data (default: 30). After the initial sync, only new content since the last cursor is fetched.
Each resource accepts the following optional fields:
See Metadata on synced objects for how these merge with system-generated fields.
Metadata on synced objects
Every object synced by a connector lands in HydraDB with two metadata layers:Tenant metadata (metadata)
Tenant metadata is the schema-declared layer. Fields here are defined once per tenant via database_metadata_schema and are indexed for fast, exact-match filtering. This is what you use for stable high-cardinality fields you filter on often - department, region, status, priority.
HydraDB always writes provider into tenant metadata for every synced object. You can extend this with your own fields by passing metadata on each resource in POST /connectors/:id/configure. User-supplied fields are merged first; provider always takes precedence.
Document metadata (additional_metadata)
Document metadata is the free-form layer. No schema required. Each connector automatically populates this with provider-specific fields on every synced object: connector ID, resource ID, provider account scope, and provider-native identifiers (Slack TS, GitHub issue number, Linear identifier, etc.).
You can extend this with your own fields by passing additional_metadata on each resource in POST /connectors/:id/configure. User-supplied fields are merged first; provider-generated fields always take precedence.
This is what you filter on when you want to scope a query to a specific connector, channel, repo, or inbox.
Querying with document metadata filter
Inspect what a connector stores
Connector contracts are provider-owned and available through the API for every supported connector.List available providers
GET /connectors/providers without a query parameter returns the catalog of connectable providers:
Inspect a single provider
Pass a provider identifier (aprovider value from the list above) as the id query parameter:
You cannot pinpoint or search over a single searchable field. All
searchable_fields are combined into one indexed document text, and search queries run over that combined text as a whole. To narrow results, use filterable_fields with metadata_filters — that is the only per-field targeting mechanism.searchable_fields and filterable_fields includes:
To scope a query with a filterable field, place its
filter_key inside metadata_filters. A dotted key like additional_metadata.container_id nests under additional_metadata; tenant-scoped keys like provider and connector_id are passed top-level:
Filtering by a provider's filterable field
Filtering by tenant-scoped keys
credential_schema is HydraDB’s own contract — slack and linear each take a single access_token. For MOVEIT-synced providers it is the tap’s schema — dropbox takes app_key, app_secret, and refresh_token.
Connector contracts come from the same normalizers that prepare synced data. Query this endpoint instead of relying on a static field list: it covers the complete connector catalog and stays current as connector normalization changes.
account_email (filter key additional_metadata.account_email) rather than provider_account_scope when scoping to a connected account. The Gmail provider response calls out this exception in its field description.
Multiple connectors per provider
You can create more than one connector for the same provider - two Slack workspaces, two GitHub accounts, a personal and a work Gmail. Each connector is independent: its own credentials, its own resources, its ownprovider_account_scope.
Set distinct provider_account_scope values per connector. This value is part of every object’s deduplication key - without it, objects from two accounts of the same provider collide.
You can also route different resources from the same connector into different sub-tenants via POST /connectors/:id/configure:
Related
- App Sources - ingestion model connector objects use
- Metadata - tenant metadata vs document metadata in depth
- Multi-Tenant - routing resources to tenants and sub-tenants
- Query - querying connector-synced data with
query_apps: true