Skip to main content

GraphQL API Documentation

Overview

The GraphQL API provides a structured interface to interact with the backend. It enables querying, and mutating data. Below is the documentation for the available operations.


Authentication

Most mutations and queries require authentication. The auth object must be provided as part of the request. It includes:

Auth Object

FieldTypeDescription
appIdStringThe application ID. Request this from [email protected].
appSecretStringThe application secret. Request this from [email protected].

Operations

Mutation: pageview

Tracks a pageview event for analytics.

Endpoint

mutation Pageview(
$auth: AuthRequestInput!
$event: PagviewEventInput!
) {
pageview(auth: $auth, event: $event) {
message
code
data
}
}

Parameters

ParameterTypeRequiredDescription
authAuthInputYesThe authentication credentials.
eventPagviewEventInputYesDetails of the pageview event.

PagviewEventInput Fields

FieldTypeRequiredDescription
pixel_idIntYesThe unique ID for the pixel.
md5StringNoMD5 hash for identification.
domainStringNoThe domain where the event occurred.
pusher_channelStringNoPusher channel identifier.
hemStringNoHEM identifier.
request_idStringNoUnique request identifier.
asStringNoAS identifier.
canonicalStringNoCanonical URL.
cityStringNoCity of the user.
countryStringNoCountry of the user.
descriptionStringNoDescription of the event.
emailStringNoEmail address of the user.
phoneStringNoPhone number of the user.
tcpaIntNoTCPA compliance flag.
ipStringNoIP address of the user.
ispStringNoInternet Service Provider.
languageStringNoLanguage preference of the user.
latFloatNoLatitude coordinate.
lonFloatNoLongitude coordinate.
orgStringNoOrganization.
referrerStringNoReferring URL.
timestampIntNoTimestamp of the event.
timezoneStringNoTimezone of the user.
titleStringNoPage title.
urlStringNoCurrent URL.
sessionidStringNoSession identifier.
zipStringNoZIP/Postal code.
ageStringNoAge of the user.
genderStringNoGender of the user.
sha1StringNoSHA-1 hash.
sha2StringNoSHA-2 hash.
nonIdStringNoNon-ID identifier.
utm_sourceStringNoUTM source parameter.
utm_mediumStringNoUTM medium parameter.
utm_campaignStringNoUTM campaign parameter.
utm_termStringNoUTM term parameter.
utm_contentStringNoUTM content parameter.
osStringNoOperating system.
fingerprintStringNoBrowser fingerprint.
user_agentStringNoUser agent string.
browserStringNoBrowser name and version.
device_typeStringNoType of device.
resolutionStringNoScreen resolution.
eventStringNoEvent type.
region_nameStringNoRegion/state name.
country_codeStringNoCountry code.
unique_idStringNoUnique identifier.
is_new_sessionBooleanNoWhether this is a new session.
is_euBooleanNoWhether the user is in the EU.
referring_domainStringNoReferring domain.
inner_resolutionStringNoInner window resolution.
custom_oneStringNoCustom field one.
custom_twoStringNoCustom field two.
custom_threeStringNoCustom field three.
custom_fourStringNoCustom field four.
custom_fiveStringNoCustom field five.

Example Request

{
"query": "mutation Pageview($auth: AuthRequestInput!, $event: PagviewEventInput!) { pageview(auth: $auth, event: $event) { code data message } }",
"variables": {
"auth": {
"appId": "yourAppIdHere",
"appSecret": "yourAppSecretHere"
},
"event": {
"md5": "",
"pixel_id": 1,
"domain": "example.com"
}
}
}

Example CURL Request

curl -X POST https://sweet-colt-9750.ddn.hasura.app/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "mutation Pageview($auth: AuthRequestInput!, $event: PagviewEventInput!) { pageview(auth: $auth, event: $event) { code data message } }",
"variables": {
"auth": {
"appId": "yourAppIdHere",
"appSecret": "yourAppSecretHere"
},
"event": {
"md5": "",
"pixel_id": 1,
"domain": "example.com"
}
}
}'

Example Response

{
"data": {
"pageview": {
"code": 200,
"data": {
"consumer_data": {
"pusher_channel": null,
"event": "pageview",
"team_id": 1,
"first_name": "John",
"last_name": "Smith",
"website_id": 123,
"pixel_id": 123,
"domain": "example.com",
"canonical": "undefined",
"consumer_id": "10000001",
"isUniqueLead": false,
"created_at": 1716979200,
"timestamp": "2024-05-29 12:00:00.000",
"tcpa": 0,
"hem": "",
"sha2": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6",
"email": "[email protected]",
"country_code": "US",
"is_eu": false,
"lat": 38.9,
"lon": -77.0,
"timezone": "America/New_York",
"language": "en-US",
"request_id": null,
"description": null,
"ip": "192.168.1.1",
"url": "undefined",
"nonId": null,
"is_new_session": null,
"as": null,
"title": null,
"sessionid": null,
"fingerprint": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"unique_id": "a1b2c3d4e5f6g7h8i9j0",
"org": "Example Organization",
"isp": "Example ISP",
"referrer": "https://www.google.com",
"referring_domain": "google.com",
"utm_source": "search",
"utm_medium": "organic",
"utm_campaign": "brand",
"utm_term": "example term",
"utm_content": "example content",
"os": "Windows 10",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
"_unmapped_data": "",
"browser": "Chrome 91.0.4472.124",
"device_type": "desktop",
"resolution": "1920x1080",
"inner_resolution": "1920x950",
"custom_one": "",
"custom_two": "",
"custom_three": "",
"custom_four": "",
"custom_five": "",
"phone": "2025551234",
"phone_formatted": "(202) 555-1234",
"phone_voip": "0",
"phone_carrier": "Example Carrier",
"phone_type": "Wireless",
"phone_dialing_code": 1,
"phone_do_not_call": false,
"phone_activity": "N/A",
"phone_is_callable": true,
"phone_can_receive_texts": true,
"md5": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"sha1": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"address": "123 Main St",
"city": "Washington",
"region_name": "DC",
"zip": "20001",
"country": "United States",
"age": 45,
"gender": "Male",
"multilingual": false,
"marital_status": "Married",
"ethnic_group": "White",
"generation": "Generation X",
"political_party": "Independent",
"religion": "Christian",
"education": "College Graduate",
"occupation_detail": "Professional",
"income_hh": "$100,000 - $150,000",
"net_worth_hh": "$500,000 - $999,999",
"income_levels": "0",
"credit_range": "750-799",
"new_credit_offered_hh": false,
"amex_card": true,
"bank_card": true,
"owns_investments": true,
"premium_amex_card": false,
"premium_card": false,
"owns_stocks_and_bonds": true,
"political_contributor": false,
"premium_income_hh": "",
"income_midpts_hh": 125000,
"home_owner": "Home Owner",
"dwelling_type": "Single Family",
"home_heat_type": "Gas",
"home_price": 350000,
"home_purchased_years_ago": 5,
"home_value": 400000,
"mortgage_age": 5,
"mortgage_amount": 280000,
"mortgage_loan_type": "Conventional",
"mortgage_refi_age": 2,
"mortgage_refi_amount": "250000",
"mortgage_refi_type": "Fixed",
"urbanicity": "Urban",
"child_aged_0_3_hh": 0,
"child_aged_4_6_hh": 1,
"child_aged_7_9_hh": 1,
"child_aged_10_12_hh": 0,
"child_aged_13_18_hh": 0,
"veteran_hh": 0,
"num_persons_hh": 4,
"num_adults_hh": 2,
"num_children_hh": 2,
"number_of_vehicles_in_hh": 2,
"aerobics": 1,
"antiques": 0,
"arts_and_crafts": 0,
"auto_racing_affinity": 0,
"baseball": 1,
"basketball": 1,
"bird_watching": 0,
"boating_sailing": 1,
"camping_hiking": 1,
"cars_interest": 0,
"cat_owner": 1,
"charity_interest": 1,
"cigars": 0,
"coins": 0,
"cooking": 1,
"dieting": 0,
"diy": 1,
"do_it_yourself_affinity": 1,
"dog_affinity": 1,
"dog_owner": 1,
"fine_arts_collector": 0,
"fishing": 1,
"fitness": 1,
"football": 1,
"gambling": 0,
"gambling_affinity": 0,
"gardening": 1,
"golf": 0,
"golf_affinity": 0,
"gourmet_affinity": 1,
"healthy_living": 1,
"healthy_living_interest": 1,
"hockey": 0,
"home_decorating_affinity": 1,
"home_improvement": 1,
"home_study": 0,
"hunting": 0,
"knitting_quilting_sewing": 0,
"likely_charitable_donor": 1,
"luxury_life": 0,
"magazine_subscriber": 0,
"motor_racing": 0,
"motorcycles": 0,
"motorcycles_affinity": 0,
"movies": 1,
"music": 1,
"nascar": 0,
"outdoors": 1,
"pet_owner": 1,
"pets_affinity": 1,
"photography": 1,
"running": 1,
"rv": 0,
"scuba": 0,
"self_improvement": 1,
"snow_skiing": 0,
"soccer": 1,
"soho_business": 0,
"sports_memoribilia_collector": 0,
"stamps": 0,
"tennis": 1,
"travel_cruise_affinity": 0,
"travel_cruises": 0,
"travel_foreign": 1,
"travel_vacation": 1,
"truck_owner": 0,
"trucks_affinity": 0,
"walking": 1,
"woodworking": 0,
"ledger": {
"credits_pixel_total": 500,
"credits_team_balance": 10000,
"credits_team_today": 1,
"credits_pixel_today": 1
}
}
},
"message": "Success"
}
}
}

Response Object

The response object for all API calls adheres to the following structure:

export interface ApiResponseType {
code: number;
message: string;
data: sdk.JSONValue;
}
  • code: Indicates the result of the operation.
    • 200: Successful operation.
    • 400: Client error, such as invalid input.
    • 500: Server error.
  • message: A descriptive message about the operation's outcome.
  • data: Contains the result of the operation. For errors, this will be an empty object.

For all error responses, the data field will be an empty object, and the message field will describe the issue encountered.


Contact

For additional support, contact our development team at [email protected].