CRM and warehouse sinks
Write community records to HubSpot, Salesforce, Snowflake, Postgres, S3, or Google Sheets.
Six places to write
Each sink uses a reviewed mapping for its destination and subject. This page covers the six mappings that write people. Organization sinks describes the corresponding company mappings.
| Write to | What it writes | Keyed on |
|---|---|---|
| HubSpot | One contact per person, using a custom property | ocmgr_member_id |
| Salesforce | One Contact per person, using an external ID field | OCMGR_Member_Id__c |
| Snowflake | One row per person, using the member ID | member_id |
| Postgres | One row per person, with insert or update on conflict | member_id |
| S3 | One object per delivery, containing gzipped JSON lines and partitioned by day | member_id |
| Google Sheets | One row per person, using the ID in column A | member_id |
Connect a sink
All destinations use the same setup sequence. The vendor sections provide specific requirements. Only workspace owners can complete these steps. See Who can add a sink.
Add a connection
Open Settings → Destinations. Open Add destination. Choose CRM sync or Warehouse sync. Select the vendor in Write to. Choose the Connect link in Through. Enter the credentials. Press Verify. Choose Add a destination through it.
The reviewed connection holds the vendor credential. Salesforce, Snowflake, Postgres, S3, BigQuery, and Google Sheets connections support writes only. They are destinations, so they are not on the Sources page. Open a connection from Through on its sink’s page.
HubSpot connections can support both sources and sinks. A HubSpot connection made as a source can only read, so authorise it for sinks before you verify. See HubSpot.
The sink form lists only connections for the vendor you choose in Write to. When there are none, Through says “No HubSpot connection yet.” (or the vendor you chose) with a Connect link to that vendor’s connect form.
Create the sink
Open Settings → Destinations. Open Add destination. Choose CRM sync for HubSpot or Salesforce, or Warehouse sync for other vendors. Enter a name in Call it. Select a mapping in Write to. Select a connection in Through.
Choose a segment or everybody in the community in About. Select the required changes under Write when there is. Choose Create it.
Datum creates the sink with delivery disabled. Its row displays Not verified.
Verify
Choose Verify on the sink’s page or ··· menu. Confirm the action.
Datum checks the destination for its ID property. It creates the property when the vendor permits it. Verification sends no people. If permissions prevent creation, Datum provides manual steps.
Send one person
Open the sink or choose Edit. Enter a person’s ID. Choose Send one person.
See Testing a sink.
Backfill
Choose Backfill to write existing members.
Backfill processes 500 members per page. It resumes from its last position. Repeating it creates no additional records. The sink’s row displays its last successful write time.
A sink without a segment includes the whole community. Its backfill writes every person in that audience. Check About before starting a backfill.
Backfill requires a running worker. Without one, Datum displays “Nothing is walking it” and preserves your position.
How a sink differs from a webhook
A webhook sends a message about each change. The receiver decides how to process it. A sink maintains a record in the destination system.
Sinks use Datum’s ID to update existing records or create missing records. Repeated deliveries update the same record. Merges update its references, and erasure clears the properties Datum wrote.
Sinks never use email addresses as keys. Email matching could combine two CRM records without review.
Testing a sink
Enter a person’s ID on the sink’s page. Choose Send one person.
For an organization sink, enter the organization ID. Choose Send one organization.
The test immediately writes a real record, even when the sink remains disabled. Datum requests confirmation and reports how many properties it sent. You can send one test per minute.
Switching a sink on
Datum creates sinks with delivery disabled.
- Run Verify.
- Send one person as a test.
- Choose Switch on.
Successful verification makes Switch on available. The sink subsequently writes changes for its audience. Its row displays Active.
Choose Switch off to stop new writes.
Existing records remain in the destination.
Skipped versus failed deliveries
A skipped delivery received a rejection that retries cannot resolve. Examples include missing properties and unacceptable payloads. Datum does not retry these deliveries. The sink’s row shows the skipped count and vendor explanation after Refused:.
A failed delivery encountered a potentially temporary problem, such as a timeout or vendor outage. Datum allows up to six attempts. Persistent failure changes the row to Failing, with the latest error beside it.
Fix the cause before returning the delivery to the queue. See Troubleshooting for recovery steps.
Vendor setup
HubSpot
Sinks need write scopes. A HubSpot connection that you made as a source does not have them. Reconnect it with write access:
- Choose Authorise for sinks.
- Approve the request in HubSpot.
- Press Verify on the sink again.
Authorise for sinks appears in the sink form when you select a HubSpot connection under Through. It also appears under Writing to HubSpot on the Settings tab of the connection in Sources. Your HubSpot app must offer the write scopes as optional scopes. After the approval, HubSpot sends you back to Sources.
ocmgr connection connect <connectionId> --for sinks --json{ "name": "connect_connection", "arguments": { "id": "<connectionId>", "scopes": "sinks" } }curl -X POST "$OCMGR_URL/v1/connections/<connectionId>/connect" -H "Authorization: Bearer $OCMGR_API_KEY" \
-H 'content-type: application/json' -d '{"scopes":"sinks"}'The CLI, MCP and REST all return the same authorization link. Open the link in a browser where you are signed in as a workspace owner.
Verify checks all mapped properties. If the permissions allow it, Verify creates missing properties. Otherwise, create the custom properties manually:
- Open Settings → Properties → Create property in HubSpot.
- Create
ocmgr_member_idon the Contact object as a single-line text property. - Enable Require unique values for
ocmgr_member_id. - Create the other custom properties below as single-line text properties.
The other properties are ocmgr_name, ocmgr_tags, ocmgr_segments, ocmgr_sources, ocmgr_first_seen, ocmgr_last_seen, ocmgr_activity_90d and ocmgr_merged_into.
The mapping also needs the standard properties email, company, jobtitle, city, country and website.
HubSpot contact conflicts
A 409 [CONFLICT] can show a conflict on a unique contact property. Email is a usual cause, although Datum finds contacts by ocmgr_member_id. A merge and then a split can cause this conflict. The old contact keeps its email and its ocmgr_merged_into marker, and the split member gets a new Datum ID.
Datum keeps the delivery skipped. It does not merge, change the key of, or clear contacts by email.Membership history can prove that a current account belonged to a retired member. If this sink also wrote the contact of that member before, the error names up to three historical contact IDs to review. These IDs are only candidates. They do not prove that a contact caused the conflict, or that Datum owns its current email. Legacy history without recorded account moves cannot give this hint.
- Open the destination in Settings → Destinations. Its Skipped deliveries list shows each delivery ID and member ID, and the historical contact IDs from the error.
- In HubSpot, compare the
ocmgr_member_id,ocmgr_merged_into, email and property history of those contacts. Keep customer edits and unrelated records. - If you prove that a contact is a retired copy, open Resolve a retired HubSpot contact conflict on that destination.
- Enter the original skipped delivery ID, the retired member ID and the contact ID.
- Press Preview recovery.
- Review the contact and its property history.
- Confirm Clear retired email.
- Use Send current member.
- Confirm the separate delivery.
- Verify the new delivery and the HubSpot record before you turn on a wider sync.
Preview recovery checks the receipt from the same sink, the account-move history, the current key, the merge marker and the permitted mapped email. It does not search for contacts by email. It does not decide ownership from an address.
Clear retired email checks the provider version and the graph again. Then it clears only email. All other properties and the original receipt stay. Recovery stops if Datum finds changes after the preview, pending deliveries, missing lineage, or an email that privacy settings block. This check does not lock the contact in HubSpot. Do not edit that contact during the operation.
Send current member writes the new Datum member ID. Other records or more email addresses can still cause a conflict. Datum does not clear more fields automatically.
You can do the same steps without the browser:
- Run the first command below.
- Review the preview and the contact.
- Run the second command with the
providerUpdatedAtthat the first command returned.
ocmgr sink resolve-hubspot-conflict <skippedDeliveryId> \
--retired-member <retiredMemberId> --retired-contact <contactId> --json
ocmgr sink resolve-hubspot-conflict <skippedDeliveryId> \
--retired-member <retiredMemberId> --retired-contact <contactId> \
--expected-updated-at <providerUpdatedAt> --confirm --json
ocmgr sink test <sinkId> <currentMemberId> --json
REST and MCP have resolve_hubspot_conflict. By default, it is a dry_run that changes nothing. A confirmed request gives the same result each time for that delivery, contact and provider version. A temporary failure returns retryAt. Requests before that time make no provider calls. Legacy history without account-move evidence still needs a manual review in the CRM.
The original skipped delivery stays in history. Retry is for temporary failures, not for this permanent refusal. If you send the same data again, you get the same conflict. A source import, or a contact or company upsert, does not prove that the split problem is corrected.
Salesforce
- Open Setup → External Client App Manager in Salesforce.
- Create a Local app.
- Turn on OAuth.
- Copy the exact callback URL from Datum.
- Select only Manage user data via APIs (api) and Perform requests at any time (refresh_token, offline_access).
- Keep PKCE and the client-secret requirements on.
- Save the consumer key and the secret of the app in Datum.
- Authorize the connection.
These scopes get the object and record permissions of the user who authorizes. They do not limit access to the filters of the Datum sink. Use a dedicated Salesforce user with only the Contact or Account permissions that your sync needs. Datum uses the production login endpoint, also for Developer Edition organizations. Datum does not support sandbox login at test.salesforce.com.
Datum cannot create Salesforce fields.
- Open Setup → Object Manager → Contact → Fields & Relationships in Salesforce.
- Create a Text(80) field named
OCMGR_Member_Id__c. - Select External ID.
- Select Unique.
- Create the other mapped
OCMGR_fields below. - Run Verify again.
The mapping requires these additional custom fields:
OCMGR_Handle__cOCMGR_Company__cOCMGR_Profile_Url__cOCMGR_Tags__cOCMGR_Segments__cOCMGR_Sources__cOCMGR_First_Seen__cOCMGR_Last_Seen__cOCMGR_Activity_90d__cOCMGR_Organisation__cOCMGR_Organisation_Domain__cOCMGR_Merged_Into__c
The mapping also writes Email, Title, MailingCity, MailingCountry, and the required LastName.
Snowflake
Use an account identifier, a database, a warehouse, a role and a programmatic access token (PAT). The PAT must belong to a service user and be limited to the role. This connection does not accept passwords or key pairs. Snowflake is only a destination. It does not import warehouse records.
Snowflake tables and permission checks
To change the tables after you connect:
- Open Settings → Destination tables on the Snowflake connection.
- Change Schema, Members table or Organisations table.
- Press Save table settings.
- Verify each destination again before you send records.
Datum saves only the table settings that you changed. It keeps the stored service token, account, database, warehouse and role. A legacy connection can share an implicit setting for the organization table. In that case, a change to the members table keeps the organization destination that the form shows. A save does not create a table or prove write permissions.
Changing a table does not move or erase what is already there. Erasures and all other writes go only to the table that the connection names now. Thus, personal rows in the old table stay until you clear them manually. Datum cannot get to that table again, and it cannot tell you when you finish.
Before you enter a token for the Snowflake connection, ask your Snowflake administrator for a database, a warehouse and a dedicated role. Use the SQL below to start new tables. Replace OCMGR_TEST, COMPUTE_WH and OCMGR_WRITER with your approved names. Create the tables as the table owner, not as the connector role. CREATE TABLE IF NOT EXISTS keeps an existing table. It does not add missing columns or correct incompatible types. Inspect an existing table before you use it again.
CREATE TABLE IF NOT EXISTS OCMGR_TEST.PUBLIC.OCMGR_MEMBERS (
MEMBER_ID VARCHAR NOT NULL,
NAME VARCHAR,
HANDLE VARCHAR,
COMPANY VARCHAR,
TITLE VARCHAR,
LOCATION VARCHAR,
LOCATION_CITY VARCHAR,
LOCATION_COUNTRY VARCHAR,
EMAIL VARCHAR,
PROFILE_URL VARCHAR,
TAGS VARCHAR,
SEGMENTS VARCHAR,
SOURCES VARCHAR,
FIRST_SEEN VARCHAR,
LAST_SEEN VARCHAR,
ORGANISATION_NAME VARCHAR,
ORGANISATION_DOMAIN VARCHAR,
ORGANISATION_GITHUB VARCHAR,
ACTIVITY_90D NUMBER,
VERSION VARCHAR,
REDACTED BOOLEAN
);
CREATE TABLE IF NOT EXISTS OCMGR_TEST.PUBLIC.OCMGR_ORGANISATIONS (
ORGANISATION_ID VARCHAR NOT NULL,
ORGANISATION_KEY VARCHAR,
KIND VARCHAR,
NAME VARCHAR,
DOMAIN VARCHAR,
GITHUB_LOGIN VARCHAR,
EMPLOYEES NUMBER,
MEMBERS NUMBER,
FIRST_SEEN VARCHAR,
LAST_SEEN VARCHAR,
TAGS VARCHAR,
ACTIVITY_90D NUMBER,
VERSION VARCHAR,
DISSOLVED BOOLEAN
);
Dates remain ISO 8601 strings as supplied by the mapping; cast them in downstream
queries if needed. All non-key columns are nullable: a member erasure writes SQL
NULLs, while an organisation dissolution preserves its key and sets MEMBERS = 0
and DISSOLVED = TRUE. The role must not own the tables or receive broad future-table
grants. An administrator grants the existing dedicated role only:
GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE OCMGR_WRITER;
GRANT USAGE ON DATABASE OCMGR_TEST TO ROLE OCMGR_WRITER;
GRANT USAGE ON SCHEMA OCMGR_TEST.PUBLIC TO ROLE OCMGR_WRITER;
GRANT SELECT, INSERT, UPDATE ON TABLE OCMGR_TEST.PUBLIC.OCMGR_MEMBERS TO ROLE OCMGR_WRITER;
GRANT SELECT, INSERT, UPDATE ON TABLE OCMGR_TEST.PUBLIC.OCMGR_ORGANISATIONS TO ROLE OCMGR_WRITER;
- Create a PAT for a service user, limited to that role.
- Keep the network policy of the PAT on.
- Allow only the approved static outbound IPs of the instance.
- Copy the PAT directly into the token field in Datum. Do not put it in the worksheet, the SQL history or a support message. See Snowflake’s table creation, grants and PAT setup references.
In Datum, enter the account identifier, token, database, warehouse and role. Advanced settings hold the schema and table names. The defaults match this SQL. Keep the member table and the organization table separate. Then do these checks in this order:
| Check | What passing proves | If it fails |
|---|---|---|
| Connection Verify | The PAT can authenticate and select the database, warehouse and role. | Check token expiry, role restriction, account identifier and network policy. |
| Destination Verify | The role can read every required column of that destination’s table. | Compare the table columns with the SQL above and check SELECT/USAGE grants. Verify each table separately. |
Scratch destination sink live-check |
A synthetic write completed, including nullable fields. | Check the INSERT and UPDATE grants and the column types. Then inspect the result in Snowflake. |
You can verify the connection and the destination from the CLI, MCP and REST:
ocmgr connection verify <connectionId> --json
ocmgr sink verify <sinkId> --json{ "name": "verify_connection", "arguments": { "id": "<connectionId>" } }
{ "name": "verify_sink", "arguments": { "sink": "<sinkId>" } }curl -X POST "$OCMGR_URL/v1/connections/<connectionId>/verify" -H "Authorization: Bearer $OCMGR_API_KEY" \
-H 'content-type: application/json' -d '{}'
curl -X POST "$OCMGR_URL/v1/sinks/<sinkId>/verify" -H "Authorization: Bearer $OCMGR_API_KEY" \
-H 'content-type: application/json' -d '{}'The synthetic live check needs the operator terminal. It has no REST route, MCP tool or app control:
ocmgr sink live-check <scratchSinkId> --dry-run --json
ocmgr sink live-check <scratchSinkId> --json
The last command writes a synthetic tombstone. Use a dedicated scratch destination. Before you turn on a production destination, inspect the reported key in Snowflake. Verification alone does not prove that keys are unique, because standard Snowflake tables do not enforce UNIQUE keys. Datum upserts on its member ID or organization ID. Do not add rows with the same IDs through a different route.
If Snowflake cancels a write, Datum retries the confirmed cancellation. It does not change the identity of a retry that already succeeded. Older deliveries keep their original retry behavior. A failure that contains legacy_request_identity means that Datum cannot safely recover that older delivery automatically. Check the destination row and the Snowflake query history before you send the record again. If you retry only the failed delivery, it keeps its original identity.
Postgres
The connection needs a host, port, database, user and password. It always uses SSL. Rows go to public.ocmgr_members, unless the connection sets schema and table.
- Create the table.
- Add
member_idas a text column with a primary key or unique constraint. - Add nullable columns for the other mapped fields.
- Add
versionas a text column. - Add
redactedas a boolean column.
The upsert operation needs the unique constraint. Without it, the upsert does not run.
S3
The connection needs an access key ID, a secret, a region and a bucket. Objects use the ocmgr prefix, unless you set a different prefix.
Each delivery writes a private object at <prefix>/sink=<sink id>/dt=YYYY-MM-DD/<delivery id>.jsonl.gz. Each object contains one JSON line. The destination needs no setup other than credentials that can write to the prefix.
To read the current state, keep the line with the largest delivery_sequence for each member. Remove members whose latest line contains redacted: true.
Datum never writes old objects again. Apply erasures each time that you build data from them.
Google Sheets
- Enable the Google Sheets API in your Google Cloud project.
- Configure only the
drive.filescope on the consent screen. - Create an OAuth client with type Web application.
- Copy its client ID into the connection.
- Copy its secret into the connection.
- Leave the spreadsheet ID empty.
- Complete Google’s consent process.
The first Verify creates “Datum community” in the Drive of the connecting account. It creates the ocmgr_members and ocmgr_organisations tabs with header rows.
If necessary, share the spreadsheet with your team, or move it to a shared drive.
The drive.file scope covers only the files that this app created. It does not cover all spreadsheets that you can open.
Do not sort the tab. Do not insert rows into the tab. For other layouts, use a filter view or a separate tab.
A delivery finds a row first. Then it writes to the number of that row. If a person sorts the tab between these two operations, the values of one person can go on the row of a different person. You can safely add rows below the last row and edit cells.
Datum refuses tabs with more than 20,000 rows, including empty rows and the header. Google allows 60 requests each minute, so a backfill writes approximately 13 rows each minute. Datum keeps capacity in reserve for erasures and merges, so that backfills do not delay them.
What comes in
Sinks write data only. They do not import data.
| Sent data | Fields |
|---|---|
| Always | Member ID, name, handle, company, title, tags, segments, sources, first and last seen, and 90-day activity. Organization name, domain, and GitHub login. |
| With personal data on | Email address, location, profile link, and avatar. |
| Never | Message text, review state, or scores. |
Sinks send the best email address of the person, also when it is unverified. When the mapping supports it, they also send the verification status. If your CRM must contain only verified addresses, leave personal data off.
Datum omits fields without values. It does not replace existing CRM values with blanks. Tags and segments always appear, so removing the final tag clears that field.
A merge updates the surviving person’s record. It also adds the survivor’s ID to the other record’s merged-into property. Erasure clears every property the sink wrote but preserves the record itself.
Troubleshooting
“Not verified” on the sink’s row
The sink needs successful verification before you can enable it. Run Verify.
Changing a connection’s credentials or settings requires verification for every sink that uses it. Queued deliveries wait without consuming retry attempts.
A count of skipped deliveries on the row
A skipped delivery received a vendor rejection that another attempt cannot resolve. Missing properties and unacceptable payloads are common causes. The row displays the explanation after Refused:.
Fix the cause in the destination system. List skipped deliveries when your CRM records appear outdated:
ocmgr sink deliveries --sink <sinkId> --status skipped --json
A delivery failed after its retries
Each delivery allows six attempts. Fix the failure’s cause. Return the failed delivery to the queue:
ocmgr sink retry <deliveryId> --json
The app does not yet provide this action.
An erasure stays held after a refusal
If a destination refuses an erasure on its credentials or permissions, Datum keeps the erasure pending and retries it hourly without using an attempt. Fix the credential or its permissions and the next attempt goes through.
If a repair is impossible, an owner can select Close erasure… under Held erasures on the sink. Closing erases nothing. The person’s record may remain in the destination and you must remove it there by hand. Nothing retries it afterwards, and the audit log records who closed it and why.
ocmgr sink deliveries --sink <sinkId> --held-erasures --json
ocmgr sink close-erasure <deliveryId> --json
ocmgr sink close-erasure <deliveryId> --confirm --reason "TICKET-123" --json
“The sink connection needs reconnecting”
The connection needs authentication or someone disconnected it. Datum holds every delivery, including erasures, without consuming attempts. The sink’s row says “Reconnect” with the connection name. Open the sink. Choose the connection name beside Through. Reconnect the connection.
Deliveries resume within one minute.
From your terminal or agent
The CLI, MCP tools, and REST API support these operations. All writes require admin scope.
ocmgr sink create "Champions → HubSpot" --mapping hubspot \
--connection <connectionId> --segment <segmentId> --json
ocmgr sink verify <sinkId> --json
ocmgr sink test <sinkId> <memberId> --json
ocmgr sink update <sinkId> --enable --json
ocmgr sink backfill <sinkId> --json{ "name": "create_sink", "arguments": { "name": "Champions → HubSpot", "mapping": "hubspot", "connection_id": "<connectionId>", "filter": { "segment_id": "<segmentId>" } } }
{ "name": "verify_sink", "arguments": { "sink": "<sinkId>" } }curl -X POST "$OCMGR_URL/v1/sinks" -H "Authorization: Bearer $OCMGR_API_KEY" \
-H 'content-type: application/json' \
-d '{"name":"Champions → HubSpot","mapping":"hubspot","connection_id":"<connectionId>","filter":{"segment_id":"<segmentId>"}}'The commands sink verify, sink test, and sink backfill contact the destination. With --dry-run, they only print their planned actions.
See create_sink, send_sink_test, and retry_sink_delivery for every parameter.
FAQ
Does switching a sink off delete what it wrote?
No. Disabling or archiving a sink preserves its destination records. Remove unwanted records in the CRM or warehouse itself.
Does pausing the connection stop the sink?
No. Pausing a connection stops source reads. Choose Switch off to disable the sink.
Can I see who ran a backfill?
Yes. Verify, test, and backfill operations create History entries with the requester’s identity. Hosted MCP operations identify the person who connected the agent.
Can I change a sink's mapping or connection?
No. Destination records depend on the original mapping and connection. Create a new sink to use different values.