How it works
Setting up a connector takes three calls, made once:- Create:
POST /connectorsstores the credentials for one provider account. - Discover:
GET /connectors/{id}/discoverlists what those credentials can reach: Slack channels, GitHub repositories, Linear teams and projects, Notion databases and pages, Supabase tables, and so on. - Configure:
POST /connectors/{id}/configureactivates the resources you choose and starts the first sync.
POST /connectors/{id}/sync when you need data sooner, and GET /connectors/{id}/status to check that everything is working.
Authentication
All connector endpoints use the same API key as the rest of HydraDB:Creating a connector
provider: a provider id from List Connector Providers.databaseandcollection: where the synced data goes. Individual resources can route to a different collection.credentials: the provider’s credentials. Their shape is the provider’scredential_schemafrom List Connector Providers, called with?id={provider}.provider_account_scope: identifies the external account. See below.- Optional:
name,custom_instructionsandsync_interval_seconds.custom_instructionsandsync_interval_secondscan be changed later;namecannot.
provider_account_scope
provider_account_scope tells HydraDB which external account a connector belongs to. It is part of the deduplication key of every object the connector syncs, so objects from two different accounts do not overwrite each other.
What to use for each provider:
- Slack: the workspace id, which starts with
T. Open Slack in a browser: it is theT...segment ofapp.slack.com/client/T.../. - GitHub: the organization or user login from your GitHub URL, as in
github.com/my-github-org. - Linear: the workspace name shown in Settings, under Workspace.
- Notion: the workspace name shown at the top of Settings, under Workspace.
- Gmail: leave it empty. To scope queries to one mailbox, filter on
account_emailinadditional_metadatainstead.
provider_account_scope. Otherwise objects from the two accounts that happen to share an external id can overwrite each other.
Configuring resources
After creating the connector, activate the resources you want to sync:lookback_days sets how much history the first sync fetches (default 30). After that, each sync fetches only what is new.
Besides resource_id, resource_type and name, each resource can carry:
collection(ordatabase): routes this resource’s objects somewhere other than the connector’s own collection or database.metadata: fields merged into the attributes of every object from this resource. Declare the ones you filter on in your database’s metadata schema.additional_metadata: free-form fields merged into the custom attributes of every object from this resource.custom_instructions: guidance for how this resource’s documents are interpreted. See Custom Ingestion Instructions.acl: who can read this resource’s objects. Omitted means unrestricted. See Access Control.
Linear Workspace Documents
Linear documents (the docs you write inside Linear) do not belong to a single team or project, so they sync as one always-present resource instead of per team or project. Discovery returns it alongside the teams and projects:knowledge_base app source. Its markdown body is searchable. Files uploaded into the document (Linear-hosted uploads.linear.app files) are downloaded, parsed and indexed too. Plain links to external URLs are kept as metadata, not fetched.
From the dashboard: tick “Workspace Documents” in the resource list, the same way you tick a team or project.
From the API: include the linear_workspace resource in your configure call. To put the documents in their own collection, set collection on it, the same as any other resource:
collection empty, the documents go to the connector’s collection.
Changing a connector after setup
Use the endpoint that matches what you want to change. The update endpoints change only the fields you send.- One resource’s instructions or access rule: Update Connector Resource,
PATCH /connectors/{id}/resources/{resource_id}. - The connector’s instructions, sync interval or credentials: Update Connector,
PATCH /connectors/{id}. - Which resources sync, and their collection or metadata: call Configure Connector again. Resources you leave out are not touched. For each resource you list, send
nameandresource_typeagain, because omitted values are cleared. Its sync position, instructions and access rule are kept. - Stop syncing a resource: Delete Connector Resource.
- Stop syncing for a while: Pause Connector, then Resume Connector.
Custom ingestion instructions
Usecustom_instructions to guide how synced documents are interpreted, for example after a product rename. Set a connector-wide default on create or with Update Connector, and override it per resource. All connectors support instructions; changes apply from the next sync.
See Custom Ingestion Instructions for how the two levels combine, with examples.
Metadata on synced objects
Every object a connector syncs lands in HydraDB with two metadata layers.Attributes (metadata)
Attributes are the schema-declared layer. Fields are declared once in your database’s metadata schema and filtered with top-level metadata_filters keys. Use them for stable fields you filter on often, such as department, region, status or priority.
HydraDB always writes connector_id and provider here for every synced object. Add your own fields with metadata on each resource in configure. Your fields are merged first, so connector_id and provider always win on conflict.
Custom attributes (additional_metadata)
Custom attributes are the free-form layer and need no schema. HydraDB always writes connector_id and resource_id here, plus provider-native fields such as a Slack message timestamp, a GitHub issue number or a Linear identifier. List Connector Providers shows them for each provider under filterable_fields.
Add your own fields with additional_metadata on each resource in configure. Your fields are merged first, so provider-generated fields always win on conflict.
This is the layer to filter on to scope a query to one connector, channel, repository or table:
Querying with a custom attribute filter
resource_id the same way to scope to one channel, repository or table.
Inspect what a connector stores
Every provider publishes a contract describing what it syncs:- List Connector Providers without
idreturns every provider you can connect. - List Connector Providers, called with
?id={provider}, describes one: the record types that become searchable, the fields search reaches, the fields you can filter on (each with thefilter_keyto use inmetadata_filters), and the JSON Schema for its credentials.
You cannot search one searchable field on its own. All of a document’s searchable fields are combined into its indexed text, and search runs over that text as a whole. To narrow results by a field, use one of the provider’s
filterable_fields in metadata_filters.Permissions on synced content
For supported providers, HydraDB reads the source app’s permissions on every sync and applies them as document access rules. That way a query made on behalf of one user cannot surface a private channel, a restricted Drive file, or a repository they cannot see. Slack, Google Drive, GitHub, Confluence and Jira are among the supported providers. You can also set your own rule per resource, either at configure time withacl or afterwards, on its own:
acl_warning on it until the next successful read. Meanwhile your own rule on the resource still applies; a resource with no rule is readable by everyone.
Multiple connectors per provider
You can create more than one connector for the same provider: two Slack workspaces, two GitHub accounts, or a personal and a work Gmail. Each connector is independent, with its own credentials, resources and a distinctprovider_account_scope (see above). To split one connector’s resources across collections, set collection per resource in configure.
Related
- Connectors API reference: every endpoint, and which one changes what
- Custom Ingestion Instructions: steering how synced content is interpreted
- App Sources: the ingestion model connector objects use
- Metadata: attributes and custom attributes in depth
- Multi-Tenant: routing resources to databases and collections
- Query: querying connector-synced data
- Access Control: restricting who can retrieve synced content
