Ometria Exporter
Version 0.0.0
The Ometria Data API documentation can be accessed here. The reports in this connector use the Push and List Push Errors endpoints.
Important Note on Data Management
- This exporter creates and updates contacts in your Ometria account. We recommend testing it with an Ometria sandbox account and dummy data first, to make sure data flows as intended.
- Passing
nullfor a field clears that field in Ometria. See Limitations.
Set up
To get set up with the Ometria Exporter connector you have to provide the below details on the Source page of the connector:
- API Key - Your Ometria API key, available from your Ometria account settings.
Features
| Feature | Support | Notes |
|---|---|---|
| API reliability | 🟢 | Reliable |
| Rate limiting | 🟢 | Push Contacts is throttled to 5 requests per second |
Reports detail
| ⬇️ Report | 🔑 Incremental key | 🔑 Primary key | 📄 Link to API endpoint |
|---|---|---|---|
| Push Contacts | N/A | N/A | Push |
| Push Errors | N/A | N/A | List Push Errors |
The Push Contacts report sends one request per row in the source table. Each row's DATA value is sent as-is as the request body to:
POST https://api.ometria.com/v2/push
The Push Errors report sends one request per row in its source table to:
GET https://api.ometria.com/v2/push/_errors
and returns the 100 most recent push errors on your Ometria account.
Source Table Creation
-
For the
Push Contactsreport, the source table needs a singleDATAcolumn. Each row holds a JSON array of up to 100 contact objects. Ometria requires@typeandidon every record, plus at least one identifier (email,customer_idorphone_number). Additional fields are listed in the docs.CREATE OR REPLACE TABLE PUSH_CONTACTS_DATA ( DATA VARCHAR NOT NULL ); INSERT INTO PUSH_CONTACTS_DATA (DATA) VALUES ( '[ { "@type": "contact", "@collection": "default", "id": "uuid_4567", "customer_id": "uuid_4567", "email": "[email protected]", "firstname": "Bob", "lastname": "Smith", "marketing_optin": "EXPLICITLY_OPTEDIN", "timestamp_acquired": "2026-04-19T09:00:00+00:00" }, { "@type": "contact", "@collection": "default", "id": "uuid_4568", "customer_id": "uuid_4568", "email": "[email protected]", "marketing_optin": "NOT_SPECIFIED" } ]' );If your contacts are in a table with one row per contact, you can batch them into rows of 100 with the following SQL:
CREATE OR REPLACE TABLE PUSH_CONTACTS_DATA AS WITH contacts AS ( SELECT ROW_NUMBER() OVER (ORDER BY CUSTOMER_ID) AS n, OBJECT_CONSTRUCT( '@type', 'contact', '@collection', 'default', 'id', CUSTOMER_ID, 'customer_id', CUSTOMER_ID, 'email', LOWER(EMAIL), 'firstname', FIRST_NAME, 'lastname', LAST_NAME, 'marketing_optin', MARKETING_OPTIN ) AS contact FROM MY_SCHEMA.CUSTOMERS ) SELECT TO_JSON(ARRAY_AGG(contact) WITHIN GROUP (ORDER BY n)) AS DATA FROM contacts GROUP BY CEIL(n / 100);OBJECT_CONSTRUCTleaves out keys whose value isNULL, so empty columns won't clear existing values in Ometria. -
For the
Push Errorsreport, the source table is a trigger table with exactly one row. Each row sends one request, so one row gives one fetch of the latest errors. The column value isn't used by the API; it's copied into the responses table as a label.CREATE OR REPLACE TABLE PUSH_ERRORS_TRIGGER AS SELECT 'daily' AS RUN_LABEL;Don't name trigger columns
url,method,content_type,query_params,responseorerror, as these would overwrite the matching columns in the responses table.
Where to find the push error detailsThe
Push Errorsreport does not load errors into the trigger table itself. The error details are written to the_responsestable created from the single-row, single-column trigger table above, so forPUSH_ERRORS_TRIGGERyou'll find them inPUSH_ERRORS_TRIGGER_RESPONSES.Each run adds one row to that table, and its
responsecolumn holds the full list of errors returned by Ometria as JSON. See Reading the responses to flatten it into one row per error.
Behaviour of exporter (and additional table for logging)Whenever you run these reports the connector will store the requests in a table in the same schema with the same name as the source table + _responses
so if you export
my_schema.push_contacts_data, it'll bemy_schema.push_contacts_data_responsesThe rows will contain the first level of the request map flattened (like url and method) as columns, and then a response and error column with the response or error that came from that request.
In subsequent runs, the new rows will be appended to that same table.
Reading the responses
-
Push Contacts - each row's
responseholds a JSON object like{"status": "OK", "request_id": "…", "accepted": 100, "rejected": 0, "skipped": 0}. A successful response means the batch was queued, not yet applied. -
Push Errors -the error details are in the
_responsestable of the single-row, single-column trigger table (e.g.PUSH_ERRORS_TRIGGER_RESPONSES). Each row'sresponseholds a JSON array of errors. Each error hasrequest_id,record_type,record_id,timestamp,message(error_message,error_path) andrecord(a copy of the record that failed). You can flatten it with the following SQL:SELECT e.value:request_id::STRING AS request_id, e.value:record_type::STRING AS record_type, e.value:record_id::STRING AS record_id, e.value:timestamp::STRING AS error_timestamp, e.value:message:error_message::STRING AS error_message, e.value:message:error_path::STRING AS error_path, e.value:record AS record FROM MY_SCHEMA.PUSH_ERRORS_TRIGGER_RESPONSES r, LATERAL FLATTEN(input => PARSE_JSON(r.RESPONSE)) e QUALIFY ROW_NUMBER() OVER ( PARTITION BY request_id, record_id, error_timestamp ORDER BY r._KLEENE_EXTRACT_DATE DESC ) = 1;The
request_idmatches therequest_idin thePush Contactsresponses table, so you can join the two to see which batch each error came from.
Limitations
Specifying null for a field's value clears the fieldOmetria interprets a field passed with a
nullvalue as an instruction to delete the existing value. Only include the fields you want to set, or add"@merge": trueto the record. See here for more details.
Batch and record size
- Each
DATArow can hold at most 100 records, all of the same@type. The connector does not split rows; a row with more than 100 records will be rejected.- Each record must be under 60KB.
Records are processed asynchronouslyA successful
Push Contactsresponse only means Ometria queued the batch. Records that fail validation (for example an invalidgenderormarketing_optinvalue) are only reported later by thePush Errorsreport. Allow a few minutes after a push before running it.
Push Errors only returns the 100 most recent errorsThe Ometria API keeps a rolling list of the 100 latest errors for the whole account. Consecutive runs will return overlapping errors (deduplicate as shown above), and if more than 100 errors occur between runs, the oldest are not returned.
Updated about 1 hour ago
