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 null for 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


FeatureSupportNotes
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 ContactsN/AN/APush
Push ErrorsN/AN/AList 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 Contacts report, the source table needs a single DATA column. Each row holds a JSON array of up to 100 contact objects. Ometria requires @type and id on every record, plus at least one identifier (email, customer_id or phone_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_CONSTRUCT leaves out keys whose value is NULL, so empty columns won't clear existing values in Ometria.

  • For the Push Errors report, 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, response or error, as these would overwrite the matching columns in the responses table.

📘

Where to find the push error details

The Push Errors report does not load errors into the trigger table itself. The error details are written to the _responses table created from the single-row, single-column trigger table above, so for PUSH_ERRORS_TRIGGER you'll find them in PUSH_ERRORS_TRIGGER_RESPONSES.

Each run adds one row to that table, and its response column 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 be my_schema.push_contacts_data_responses

The 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 response holds 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 _responses table of the single-row, single-column trigger table (e.g. PUSH_ERRORS_TRIGGER_RESPONSES). Each row's response holds a JSON array of errors. Each error has request_id, record_type, record_id, timestamp, message (error_message, error_path) and record (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_id matches the request_id in the Push Contacts responses 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 field

Ometria interprets a field passed with a null value as an instruction to delete the existing value. Only include the fields you want to set, or add "@merge": true to the record. See here for more details.


🚧

Batch and record size

  • Each DATA row 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 asynchronously

A successful Push Contacts response only means Ometria queued the batch. Records that fail validation (for example an invalid gender or marketing_optin value) are only reported later by the Push Errors report. Allow a few minutes after a push before running it.


🚧

Push Errors only returns the 100 most recent errors

The 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.


🚧

Connector will change data within Ometria

Use of the Push Contacts report will result in changes to the contacts within your Ometria account. Our suggestion is to experiment with dummy data in a sandbox account before making any changes in production.


Did this page help you?