{ "components": { "examples": {}, "headers": {}, "parameters": {}, "requestBodies": {}, "responses": {}, "schemas": { "CampaignSendResult": { "description": "Per-recipient result returned synchronously after the trigger request.\nAccepted recipients are queued for delivery; check the send status endpoint\nfor delivery confirmation.", "properties": { "handle": { "type": "string", "description": "Delivery address of the recipient, present for inline (`handle`) recipients." }, "id": { "type": "string", "description": "Primary key of the recipient as configured on the Personalization API sync,\npresent for profile (`id`) recipients." }, "status": { "type": "string", "enum": [ "accepted", "rejected" ], "description": "Whether this recipient was accepted for delivery or rejected at validation time." }, "sendId": { "type": "string", "description": "Unique identifier for this send, present when `status` is `\"accepted\"`.\nUse with `GET /campaigns/{id}/sends/{sendId}` to poll for delivery status." }, "reason": { "type": "string", "enum": [ "invalid_handle", "missing_variables", "invalid_id", "missing_handle_or_id" ], "description": "Reason for rejection, present when `status` is `\"rejected\"`.\n- `invalid_handle` — the delivery address is not a valid email or phone number\n- `missing_variables` — one or more required template variables are absent\n- `invalid_id` — the profile ID is empty or missing\n- `missing_handle_or_id` — the recipient has neither `handle` nor `id`" }, "missingVariables": { "items": { "type": "string" }, "type": "array", "description": "Names of the required template variables absent from the recipient's data,\npresent when `reason` is `\"missing_variables\"`." } }, "required": [ "status" ], "type": "object", "additionalProperties": false }, "StartCampaignResponse": { "description": "Response body for a campaign trigger request. Results are returned in the\nsame order as the input `recipients` array.", "properties": { "results": { "items": { "$ref": "#/components/schemas/CampaignSendResult" }, "type": "array", "description": "Per-recipient outcomes. Accepted recipients are queued for delivery;\nrejected recipients were not sent." } }, "required": [ "results" ], "type": "object", "additionalProperties": false }, "TriggerErrorResponse": { "description": "Body returned on a request-level failure (400/404/409/429) so the caller\nknows why the request was rejected.", "properties": { "error": { "type": "string", "description": "Human-readable description of why the request failed." } }, "required": [ "error" ], "type": "object", "additionalProperties": false }, "ValidateErrorJSON": { "properties": { "message": { "type": "string", "enum": [ "Validation failed" ], "nullable": false }, "details": { "properties": {}, "additionalProperties": {}, "type": "object" } }, "required": [ "message", "details" ], "type": "object", "additionalProperties": false }, "InternalServerError": { "type": "string", "enum": [ "Internal Server Error" ], "nullable": false }, "HandleCampaignRecipient": { "description": "A recipient identified by their delivery address (email or phone number).\nPersonalization data is provided inline in the request.", "properties": { "handle": { "type": "string", "description": "Delivery address for this recipient. Must be a valid email address for\nemail campaigns, or an E.164-formatted phone number for SMS campaigns." }, "properties": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "Per-recipient personalization properties. Keys must match the variable\nnames shown in the message editor. These are merged with the top-level\n`properties` and take precedence when a key appears in both." } }, "type": "object", "additionalProperties": false }, "ProfileCampaignRecipient": { "description": "A recipient identified by their Personalization API Cached profile ID.", "properties": { "id": { "type": "string", "description": "Primary key of the recipient as configured on the Personalization API sync.\nThe delivery address is resolved from the cache at send time." }, "properties": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "Per-recipient personalization overrides. Merged with the top-level\n`properties` and the cached profile; these values take precedence when a\nkey appears in multiple sources." } }, "type": "object", "additionalProperties": false }, "CampaignRecipient": { "anyOf": [ { "$ref": "#/components/schemas/HandleCampaignRecipient" }, { "$ref": "#/components/schemas/ProfileCampaignRecipient" } ], "description": "A single send target. Provide either `handle` (inline delivery address) or\n`id` (Personalization API profile ID), but not both." }, "StartCampaignRequest": { "description": "Request body for triggering an API campaign send.", "properties": { "properties": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "Shared personalization properties applied to all recipients. Keys must\nmatch the variable names shown in the message editor. Per-recipient\n`properties` take precedence when a key appears in both." }, "draft": { "type": "boolean", "description": "When `true`, sends the campaign even if it has not been activated.\nIntended for test sends against draft campaigns only.", "default": "false" }, "recipients": { "items": { "$ref": "#/components/schemas/CampaignRecipient" }, "type": "array", "description": "List of recipients to send to. Each entry must include either a `handle`\n(delivery address) or an `id` (Personalization API based profile ID).", "minItems": 1, "maxItems": 100 } }, "required": [ "recipients" ], "type": "object", "additionalProperties": false }, "SendStatusResponse": { "description": "Delivery status for a single send, returned by the send status endpoint.", "properties": { "status": { "type": "string", "description": "Current delivery status.\n- `sent` — accepted by the provider; no delivery receipt yet\n- `delivered` — confirmed delivered by the provider\n- `bounced` — delivery failed with a bounce\n- `failed` — delivery failed\n- `dropped` — dropped before delivery (e.g. unsubscribed, suppressed, or enrichment failure); see `reason`" }, "reason": { "type": "string", "description": "Additional explanation for why this send was dropped.\nOnly present when `status` is `\"dropped\"`." } }, "required": [ "status" ], "type": "object", "additionalProperties": false }, "DecisionEngineFlow": { "description": "Decision Engine Flow (Public API)", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "workspaceId": { "type": "number", "format": "double" }, "decisionEngineId": { "type": "string" }, "audienceId": { "type": "number", "format": "double" }, "status": { "type": "string" }, "config": { "properties": {}, "additionalProperties": {}, "type": "object" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "workspaceId", "decisionEngineId", "audienceId", "status" ], "type": "object", "additionalProperties": false }, "DecisionEngineMessageGuardrails": { "description": "Guardrail fields on a message (max sends, eligibility dates, etc.)", "properties": { "maxSendsPerUser": { "type": "number", "format": "double" }, "maxSendsPerUserWindowDays": { "type": "number", "format": "double" }, "minOtherMessagesInBetween": { "type": "number", "format": "double" }, "firstEligibleSendDate": { "type": "string" }, "lastEligibleSendDate": { "type": "string" } }, "type": "object", "additionalProperties": false }, "DecisionEngineVariableVariant": { "description": "Variant within a message variable (Public API)", "properties": { "value": { "type": "string", "description": "The default (non-localized) value for this variant" }, "tags": { "properties": {}, "additionalProperties": { "type": "string" }, "type": "object", "description": "Key-value tags for categorizing this variant" }, "firstEligibleSendDate": { "type": "string", "description": "Earliest date this variant is eligible to be sent (ISO 8601)" }, "lastEligibleSendDate": { "type": "string", "description": "Latest date this variant is eligible to be sent (ISO 8601)" }, "userAudienceFilter": {}, "localeValues": { "properties": {}, "additionalProperties": { "type": "string" }, "type": "object", "description": "Localized values for this variant, keyed by locale code (e.g. \"en-US\", \"de-DE\").\nThese are only used at runtime when `localizationEnabled` is true on the parent variable.\nYou can stage translations by providing localeValues while leaving localizationEnabled unset or false." } }, "required": [ "value" ], "type": "object", "additionalProperties": false }, "DecisionEngineVariable": { "description": "Message variable (Public API)", "properties": { "name": { "type": "string", "description": "The variable name (must be unique within a message)" }, "config": { "properties": { "localizationEnabled": { "type": "boolean", "description": "When true, the Decision Engine uses each variant's localeValues to select\nlocale-appropriate content at runtime. When false or omitted, only the\ndefault variant value is used, even if localeValues are present." }, "maxSendsPerUserWindowDays": { "type": "number", "format": "double", "description": "Rolling window in days for the maxSendsPerUser limit" }, "maxSendsPerUser": { "type": "number", "format": "double", "description": "Maximum number of times this variable's variants can be sent to a single user" } }, "type": "object" }, "variants": { "items": { "$ref": "#/components/schemas/DecisionEngineVariableVariant" }, "type": "array" } }, "required": [ "name", "variants" ], "type": "object", "additionalProperties": false }, "DecisionEngineMessage": { "description": "Decision Engine Message (Public API)", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "channelId": { "type": "string" }, "config": { "properties": {}, "additionalProperties": {}, "type": "object" }, "tags": { "properties": {}, "additionalProperties": {}, "type": "object" }, "guardrails": { "$ref": "#/components/schemas/DecisionEngineMessageGuardrails" }, "variables": { "items": { "$ref": "#/components/schemas/DecisionEngineVariable" }, "type": "array" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "required": [ "id", "name", "channelId", "config" ], "type": "object", "additionalProperties": false }, "DecisionEngineMessageCreate": { "description": "Request body for creating a Decision Engine message", "properties": { "name": { "type": "string" }, "channelId": { "type": "string" }, "config": { "properties": {}, "additionalProperties": {}, "type": "object" }, "tags": { "properties": {}, "additionalProperties": {}, "type": "object" }, "guardrails": { "$ref": "#/components/schemas/DecisionEngineMessageGuardrails" }, "variables": { "items": { "$ref": "#/components/schemas/DecisionEngineVariable" }, "type": "array" } }, "required": [ "name", "channelId", "config" ], "type": "object", "additionalProperties": false }, "DecisionEngineMessageUpdate": { "description": "Request body for updating a Decision Engine message", "properties": { "name": { "type": "string" }, "config": { "properties": {}, "additionalProperties": {}, "type": "object" }, "tags": { "properties": {}, "additionalProperties": {}, "type": "object" }, "guardrails": { "$ref": "#/components/schemas/DecisionEngineMessageGuardrails" }, "variables": { "items": { "$ref": "#/components/schemas/DecisionEngineVariable" }, "type": "array" } }, "type": "object", "additionalProperties": false }, "DecisionEngineRunResponse": { "properties": { "flowsEnqueued": { "type": "number", "format": "double", "description": "Number of flows that were enqueued for execution" } }, "required": [ "flowsEnqueued" ], "type": "object", "additionalProperties": false }, "Destination": { "description": "The service receiving your data (e.g. Salesforce, Hubspot, Customer.io, or a\nSFTP server)", "properties": { "id": { "type": "number", "format": "double", "description": "The destination's id" }, "name": { "type": "string", "description": "The destination's name" }, "slug": { "type": "string", "description": "The destination's slug" }, "workspaceId": { "type": "number", "format": "double", "description": "The id of the workspace that the destination belongs to" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when the destination was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the destination was last updated" }, "type": { "type": "string", "description": "The destination's type (e.g. salesforce or hubspot)." }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The destination's configuration. This specifies general metadata about destination, like hostname and username.\nHightouch will be using this configuration to connect to destination.\n\nThe schema depends on the destination type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." }, "syncs": { "items": { "type": "number", "format": "double" }, "type": "array", "description": "A list of syncs that sync to this destination." } }, "required": [ "id", "name", "slug", "workspaceId", "createdAt", "updatedAt", "type", "configuration", "syncs" ], "type": "object", "additionalProperties": false }, "DestinationCreate": { "description": "The input for creating a Destination", "properties": { "name": { "type": "string", "description": "The destination's name" }, "slug": { "type": "string", "description": "The destination's slug" }, "type": { "type": "string", "description": "The destination's type (e.g. salesforce or hubspot)." }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The destination's configuration. This specifies general metadata about destination, like hostname and username.\nHightouch will be using this configuration to connect to destination.\n\nThe schema depends on the destination type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." } }, "required": [ "name", "slug", "type", "configuration" ], "type": "object", "additionalProperties": false }, "DestinationUpdate": { "description": "The input for updating a Destination", "properties": { "name": { "type": "string", "description": "The destination's name" }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The destination's configuration. This specifies general metadata about destination, like hostname and username.\nHightouch will be using this configuration to connect to destination.\n\nThe schema depends on the destination type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." } }, "type": "object", "additionalProperties": false }, "EventContract": { "description": "A collection of schemas that are used for validating your events.", "properties": { "id": { "type": "string", "description": "The contract's id" }, "name": { "type": "string", "description": "The contract's name" }, "slug": { "type": "string", "description": "The contract's slug. If not specified, one will be generated." }, "description": { "type": "string", "description": "The contract's description" }, "onUndeclaredSchema": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that aren't defined in the contract.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT." }, "events": { "items": { "properties": { "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema that validates the event. Required." }, "onUndeclaredFields": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT", "OMIT_FIELDS" ], "description": "What happens to events that contain fields not in the schema.\nOne of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS." }, "onSchemaViolation": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that violate the schema.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT." }, "version": { "type": "string", "description": "The event version. Defaults to \"default\", optional. You probably don't need to set this." }, "slug": { "type": "string", "description": "The event's slug. If not specified, one will be generated." }, "name": { "type": "string", "description": "The event's name. Required for track events." }, "type": { "type": "string", "enum": [ "track", "identify", "page", "screen", "group" ], "description": "The event's type. One of track, identify, page, screen, or group. Required." } }, "required": [ "schema", "type" ], "type": "object" }, "type": "array", "description": "The definitions for the events in the contract." }, "workspaceId": { "type": "number", "format": "double", "description": "The id of the workspace that the contract belongs to" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when the contract was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the contract was last updated" }, "eventSources": { "items": { "properties": { "name": { "type": "string" }, "id": { "type": "string" } }, "required": [ "name", "id" ], "type": "object" }, "type": "array", "description": "The Event Sources linked to the Contract." } }, "required": [ "id", "name", "workspaceId", "createdAt", "updatedAt", "eventSources" ], "type": "object", "additionalProperties": false }, "EventContractCreate": { "description": "The input for creating a Contract", "properties": { "name": { "type": "string", "description": "The contract's name" }, "slug": { "type": "string", "description": "The contract's slug. If not specified, one will be generated." }, "description": { "type": "string", "description": "The contract's description" }, "onUndeclaredSchema": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that aren't defined in the contract.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT." }, "events": { "items": { "properties": { "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema that validates the event. Required." }, "onUndeclaredFields": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT", "OMIT_FIELDS" ], "description": "What happens to events that contain fields not in the schema.\nOne of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS." }, "onSchemaViolation": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that violate the schema.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT." }, "version": { "type": "string", "description": "The event version. Defaults to \"default\", optional. You probably don't need to set this." }, "slug": { "type": "string", "description": "The event's slug. If not specified, one will be generated." }, "name": { "type": "string", "description": "The event's name. Required for track events." }, "type": { "type": "string", "enum": [ "track", "identify", "page", "screen", "group" ], "description": "The event's type. One of track, identify, page, screen, or group. Required." } }, "required": [ "schema", "type" ], "type": "object" }, "type": "array", "description": "The definitions for the events in the contract." } }, "required": [ "name" ], "type": "object", "additionalProperties": false }, "EventContractUpdate": { "description": "The input for updating a Contract", "properties": { "name": { "type": "string", "description": "The contract's name" }, "slug": { "type": "string", "description": "The contract's slug. If not specified, one will be generated." }, "description": { "type": "string", "description": "The contract's description" }, "onUndeclaredSchema": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that aren't defined in the contract.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT." }, "events": { "items": { "properties": { "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema that validates the event. Required." }, "onUndeclaredFields": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT", "OMIT_FIELDS" ], "description": "What happens to events that contain fields not in the schema.\nOne of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS." }, "onSchemaViolation": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that violate the schema.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT." }, "version": { "type": "string", "description": "The event version. Defaults to \"default\", optional. You probably don't need to set this." }, "slug": { "type": "string", "description": "The event's slug. If not specified, one will be generated." }, "name": { "type": "string", "description": "The event's name. Required for track events." }, "type": { "type": "string", "enum": [ "track", "identify", "page", "screen", "group" ], "description": "The event's type. One of track, identify, page, screen, or group. Required." } }, "required": [ "schema", "type" ], "type": "object" }, "type": "array", "description": "The definitions for the events in the contract." } }, "type": "object", "additionalProperties": false }, "EventDomainComponent": { "description": "Reusable schema fragments that can be imported by event schemas.", "properties": { "id": { "type": "string", "description": "The component's id. Omit when creating. On update, a component matches an existing one by id when supplied, otherwise by (name, version); include the id to rename a component in place." }, "slug": { "type": "string", "description": "The component's slug. Optional when creating; generated from the name if omitted. Immutable after creation; an update that sends a different slug for an existing component is rejected." }, "name": { "type": "string", "description": "The component's name. Required." }, "version": { "type": "string", "description": "The component's version. Defaults to \"default\", optional. On update, an omitted version keeps the stored value when the component is matched by id; without an id, an omitted version only matches the stored \"default\" version, and the request is rejected if the name exists only under other versions." }, "description": { "type": "string", "description": "The component's description. On update, an omitted description keeps the stored value; send an empty string to clear it." }, "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema fragment the component contributes. Required." }, "imports": { "items": { "type": "string" }, "type": "array", "description": "Read-only: the slugs of the components this component imports (derived from its `$ref`s)." } }, "required": [ "name", "schema" ], "type": "object", "additionalProperties": false }, "EventDomain": { "description": "A collection of event and component schemas used for validating events.", "properties": { "id": { "type": "string", "description": "The domain's id" }, "name": { "type": "string", "description": "The domain's name" }, "slug": { "type": "string", "description": "The domain's slug. If not specified, one will be generated." }, "description": { "type": "string", "description": "The domain's description" }, "onUndeclaredSchema": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that aren't defined in the domain.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT." }, "events": { "items": { "properties": { "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema that validates the event. Required. May contain component `$ref`s." }, "onUndeclaredFields": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT", "OMIT_FIELDS" ], "description": "What happens to events that contain fields not in the schema.\nOne of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS." }, "onSchemaViolation": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that violate the schema.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT." }, "version": { "type": "string", "description": "The event version. Defaults to \"default\", optional. You probably don't need to set this." }, "slug": { "type": "string", "description": "The event's slug. If not specified, one will be generated." }, "name": { "type": "string", "description": "The event's name. Required for track events." }, "type": { "type": "string", "enum": [ "track", "identify", "page", "screen", "group" ], "description": "The event's type. One of track, identify, page, screen, or group. Required." } }, "required": [ "schema", "type" ], "type": "object" }, "type": "array", "description": "The definitions for the events in the domain." }, "components": { "items": { "$ref": "#/components/schemas/EventDomainComponent" }, "type": "array", "description": "The reusable components defined in the domain." }, "workspaceId": { "type": "number", "format": "double", "description": "The id of the workspace that the domain belongs to" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when the domain was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the domain was last updated" }, "eventSources": { "items": { "properties": { "name": { "type": "string" }, "id": { "type": "string" } }, "required": [ "name", "id" ], "type": "object" }, "type": "array", "description": "The Event Sources linked to the Domain." } }, "required": [ "id", "name", "workspaceId", "createdAt", "updatedAt", "eventSources" ], "type": "object", "additionalProperties": false }, "EventDomainCreate": { "description": "The input for creating a Domain", "properties": { "name": { "type": "string", "description": "The domain's name" }, "slug": { "type": "string", "description": "The domain's slug. If not specified, one will be generated." }, "description": { "type": "string", "description": "The domain's description" }, "onUndeclaredSchema": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that aren't defined in the domain.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT." }, "events": { "items": { "properties": { "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema that validates the event. Required. May contain component `$ref`s." }, "onUndeclaredFields": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT", "OMIT_FIELDS" ], "description": "What happens to events that contain fields not in the schema.\nOne of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS." }, "onSchemaViolation": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that violate the schema.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT." }, "version": { "type": "string", "description": "The event version. Defaults to \"default\", optional. You probably don't need to set this." }, "slug": { "type": "string", "description": "The event's slug. If not specified, one will be generated." }, "name": { "type": "string", "description": "The event's name. Required for track events." }, "type": { "type": "string", "enum": [ "track", "identify", "page", "screen", "group" ], "description": "The event's type. One of track, identify, page, screen, or group. Required." } }, "required": [ "schema", "type" ], "type": "object" }, "type": "array", "description": "The definitions for the events in the domain." }, "components": { "items": { "$ref": "#/components/schemas/EventDomainComponent" }, "type": "array", "description": "The reusable components defined in the domain." } }, "required": [ "name" ], "type": "object", "additionalProperties": false }, "EventDomainUpdate": { "description": "The input for updating a Domain", "properties": { "name": { "type": "string", "description": "The domain's name" }, "slug": { "type": "string", "description": "The domain's slug. If not specified, one will be generated." }, "description": { "type": "string", "description": "The domain's description" }, "onUndeclaredSchema": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that aren't defined in the domain.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT." }, "events": { "items": { "properties": { "schema": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The JSON schema that validates the event. Required. May contain component `$ref`s." }, "onUndeclaredFields": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT", "OMIT_FIELDS" ], "description": "What happens to events that contain fields not in the schema.\nOne of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS." }, "onSchemaViolation": { "type": "string", "enum": [ "ALLOW_EVENT", "BLOCK_EVENT" ], "description": "What happens to events that violate the schema.\nOne of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT." }, "version": { "type": "string", "description": "The event version. Defaults to \"default\", optional. You probably don't need to set this." }, "slug": { "type": "string", "description": "The event's slug. If not specified, one will be generated." }, "name": { "type": "string", "description": "The event's name. Required for track events." }, "type": { "type": "string", "enum": [ "track", "identify", "page", "screen", "group" ], "description": "The event's type. One of track, identify, page, screen, or group. Required." } }, "required": [ "schema", "type" ], "type": "object" }, "type": "array", "description": "The definitions for the events in the domain." }, "components": { "items": { "$ref": "#/components/schemas/EventDomainComponent" }, "type": "array", "description": "The reusable components defined in the domain." } }, "type": "object", "additionalProperties": false }, "TriggerRunIdrOutput": { "properties": { "id": { "type": "string", "description": "The id of the triggered run." } }, "required": [ "id" ], "type": "object", "additionalProperties": false }, "TriggerRunIdrInput": { "properties": { "fullRerun": { "type": "boolean", "description": "Whether to resync the entire Identity Graph or process incrementally.", "default": "false" } }, "type": "object", "description": "The input of a trigger action to run IDR." }, "IdrRunStats": { "properties": { "numSourceRows": { "type": "number", "format": "double", "description": "The exact number of rows processed from sources in this run." }, "numNewUniqueProfiles": { "type": "number", "format": "double", "description": "The exact number of unique profiles in the graph created during this run." }, "numUniqueProfiles": { "type": "number", "format": "double", "description": "The exact number of unique profiles in the graph at the end of the run." } }, "required": [ "numSourceRows", "numNewUniqueProfiles", "numUniqueProfiles" ], "type": "object" }, "IdrRunStatsByThreshold": { "properties": { "probabilistic-loose": { "$ref": "#/components/schemas/IdrRunStats" }, "probabilistic-strict": { "$ref": "#/components/schemas/IdrRunStats" }, "deterministic": { "$ref": "#/components/schemas/IdrRunStats" } }, "additionalProperties": { "$ref": "#/components/schemas/IdrRunStats" }, "type": "object" }, "IdrRun": { "properties": { "fullRerun": { "type": "boolean" }, "stats": { "$ref": "#/components/schemas/IdrRunStatsByThreshold", "description": "If available, the stats at the end of a successful run." }, "finishedAt": { "type": "string", "format": "date-time", "description": "Timestamp of the run's completion. Only set for successful or failed runs." }, "startedAt": { "type": "string", "format": "date-time", "description": "Timestamp of the run's start. Not set for queued runs." }, "createdAt": { "type": "string", "format": "date-time" }, "error": { "type": "string", "description": "If available, the error associated with a failed status." }, "status": { "type": "string", "enum": [ "QUEUED", "PROCESSING", "SUCCESS", "FAILURE", "CANCELLED" ] }, "graphId": { "type": "string" }, "id": { "type": "string" } }, "required": [ "fullRerun", "createdAt", "status", "graphId", "id" ], "type": "object" }, "ListIdrRunsOutput": { "description": "The output of a request to list runs for an IDR graph.", "properties": { "data": { "items": { "$ref": "#/components/schemas/IdrRun" }, "type": "array" }, "hasMore": { "type": "boolean" } }, "required": [ "data", "hasMore" ], "type": "object", "additionalProperties": false }, "IdrQueueForReprocessingOutput": { "properties": { "requestId": { "type": "string", "description": "ID associated with the reprocessing request. This can be used to query the status of the request." } }, "required": [ "requestId" ], "type": "object", "additionalProperties": false }, "IdrQueueForReprocessingInput": { "properties": { "identifiers": { "items": { "properties": { "value": { "type": "string" }, "identifier": { "type": "string" } }, "required": [ "value", "identifier" ], "type": "object" }, "type": "array", "description": "e.g. [{ identifier: \"email\", value: \"a@b.com\" }]\nIdentifier values will be queued for reprocessing.\nClusters containing these identifiers will be reprocessed on the next run." }, "block": { "type": "boolean", "description": "If true, identifier values will also be added to the blocklist and ignored in future runs.", "default": "true" } }, "required": [ "identifiers" ], "type": "object", "additionalProperties": false }, "IdrReprocessStatusOutput": { "properties": { "status": { "type": "string", "enum": [ "queueing", "queued", "reprocessed", "failed", "cancelled" ], "description": "\"queueing\": The identifiers are being queued for reprocessing.\n\"queued\": The identifiers have been queued and added to the blocklist. Their associated clusters will be reprocessed next time the graph runs.\n\"reprocessed\": The identifiers' clusters have been reprocessed during a run.\n\"failed\": We failed to queue the identifiers for reprocessing.\n\"cancelled\": The reprocessing request has been cancelled." }, "queuedAt": { "type": "string", "format": "date-time", "nullable": true, "description": "Set if the status is \"queued\" or \"reprocessed\". The timestamp when the identifiers were queued for reprocessing." }, "reprocessedAt": { "type": "string", "format": "date-time", "nullable": true, "description": "Set if the status is \"reprocessed\". The timestamp when the identifiers' clusters were reprocessed." }, "reprocessedRunId": { "type": "string", "nullable": true, "description": "Set if the status is \"reprocessed\". The ID of the run that reprocessed the identifiers' clusters." }, "error": { "type": "string", "nullable": true, "description": "If available, the error message from failing to queue the identifiers for reprocessing." } }, "required": [ "status", "queuedAt", "reprocessedAt", "reprocessedRunId", "error" ], "type": "object", "additionalProperties": false }, "Source": { "description": "The database or warehouse where your data is stored. The starting point for\na Hightouch data pipeline.", "properties": { "id": { "type": "number", "format": "double", "description": "The source's id" }, "name": { "type": "string", "description": "The source's name" }, "slug": { "type": "string", "description": "The source's slug" }, "workspaceId": { "type": "number", "format": "double", "description": "The id of the workspace that the source belongs to" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when the source was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the source was last updated" }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The source's configuration. This specifies general metadata about sources, like connection details\nHightouch will use this configuration to connect to underlying source.\n\nThe schema depends on the source type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." }, "type": { "type": "string", "description": "The source's type (e.g. snowflake or postgres)." } }, "required": [ "id", "name", "slug", "workspaceId", "createdAt", "updatedAt", "configuration", "type" ], "type": "object", "additionalProperties": false }, "SourceCreate": { "description": "The input for creating a Source", "properties": { "name": { "type": "string", "description": "The source's name" }, "slug": { "type": "string", "description": "The source's slug" }, "type": { "type": "string", "description": "The source's type (e.g. snowflake or postgres)." }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The source's configuration. This specifies general metadata about sources, like connection details\nHightouch will use this configuration to connect to underlying source.\n\nThe schema depends on the source type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." } }, "required": [ "name", "slug", "type", "configuration" ], "type": "object", "additionalProperties": false }, "SourceUpdate": { "description": "The input for updating a Source", "properties": { "name": { "type": "string", "description": "The source's name" }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The source's configuration. This specifies general metadata about sources, like connection details\nHightouch will use this configuration to connect to underlying source.\n\nThe schema depends on the source type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." } }, "type": "object", "additionalProperties": false }, "Model": { "description": "The SQL query that pulls data from your source to send to your destination.\nWe send your SQL query directly to your source so any SQL that is valid for your source (including functions) is valid in Hightouch.", "properties": { "id": { "type": "number", "format": "double", "description": "The id of the model" }, "name": { "type": "string", "description": "The name of the model" }, "slug": { "type": "string", "description": "The slug of the model" }, "description": { "type": "string", "description": "The description of the model" }, "workspaceId": { "type": "number", "format": "double", "description": "The id of the workspace where the model belongs to" }, "primaryKey": { "type": "string", "description": "The primary key will be null if the query doesn't get directly synced (e.g. a relationship table for visual querying)" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when model was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "The timestamp when model was lastly updated" }, "sourceId": { "type": "number", "format": "double", "description": "The id of the source that model is connected to" }, "queryType": { "type": "string", "description": "The type of the query. Available options: custom, raw_sql, tabel, dbt and visual." }, "tags": { "properties": {}, "additionalProperties": { "type": "string" }, "type": "object", "description": "The tags of the model" }, "isSchema": { "type": "boolean", "description": "If is_schema is true, the model is just used to build other models.\nEither as part of visual querying, or as the root of a visual query." }, "syncs": { "items": { "type": "number", "format": "double" }, "type": "array", "description": "The list of id of syncs that uses this model" }, "visual": { "properties": { "secondaryLabel": { "type": "string" }, "primaryLabel": { "type": "string" }, "filter": {}, "parentId": { "type": "number", "format": "double", "description": "Parent id of the schema that visual query is based on" } }, "required": [ "filter", "parentId" ], "type": "object", "description": "Visual query, used by audience" }, "custom": { "properties": { "query": {} }, "required": [ "query" ], "type": "object", "description": "Custom query for sources that doesn't support sql. For example, Airtable." }, "table": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object", "description": "Table-based query that fetches on a table instead of SQL" }, "dbt": { "properties": { "dbtUniqueId": { "type": "string", "description": "Unique ID of the model assigned by dbt (usually some combination of the schema and table name)" }, "compiledSql": { "type": "string", "description": "Compiled SQL in the dbt model" }, "rawSql": { "type": "string", "description": "Raw SQL in the dbt model" }, "database": { "type": "string", "description": "Name of the database containing the generated table" }, "schema": { "type": "string", "description": "Name of the schema containing the generated table" }, "name": { "type": "string", "description": "Name of the table generated by the dbt model" }, "modelId": { "type": "number", "format": "double", "description": "Model id that refer to a dbt model" } }, "required": [ "dbtUniqueId", "compiledSql", "rawSql", "database", "schema", "name", "modelId" ], "type": "object", "description": "Query that is based on a dbt model" }, "dbt_cloud": { "properties": { "dbtUniqueId": { "type": "string", "description": "Unique ID of the model assigned by dbt (usually some combination of the schema and table name)" }, "compiledSql": { "type": "string", "description": "Compiled SQL in the dbt model" }, "rawSql": { "type": "string" }, "name": { "type": "string", "description": "Name of the table generated by the dbt model" }, "modelId": { "type": "number", "format": "double", "description": "Model id that refer to a dbt model" } }, "required": [ "dbtUniqueId", "compiledSql", "rawSql", "name", "modelId" ], "type": "object" }, "raw": { "properties": { "sql": { "type": "string" } }, "required": [ "sql" ], "type": "object", "description": "Standard raw SQL query" }, "folderId": { "type": "string" }, "lastRunSize": { "type": "number", "format": "double", "nullable": true, "description": "The number of rows returned by the most recent successful sync run of this model.\nNull if the model has never been synced successfully." } }, "required": [ "id", "name", "slug", "description", "workspaceId", "primaryKey", "createdAt", "updatedAt", "sourceId", "queryType", "tags", "isSchema", "syncs", "lastRunSize" ], "type": "object", "additionalProperties": false }, "ModelCreate": { "description": "The input for creating a Model", "properties": { "name": { "type": "string", "description": "The name of the model" }, "slug": { "type": "string", "description": "The slug of the model" }, "queryType": { "type": "string", "description": "The type of the query. Available options: custom, raw_sql, tabel, dbt and visual." }, "sourceId": { "type": "number", "format": "double", "description": "The id of the source that model is connected to" }, "isSchema": { "type": "boolean", "description": "If is_schema is true, the model is just used to build other models.\nEither as part of visual querying, or as the root of a visual query." }, "primaryKey": { "type": "string", "description": "The primary key will be null if the query doesn't get directly synced (e.g. a relationship table for visual querying)" }, "visual": { "properties": { "secondaryLabel": { "type": "string" }, "primaryLabel": { "type": "string" }, "filter": {}, "parentId": { "type": "number", "format": "double", "description": "Parent id of the schema that visual query is based on" } }, "required": [ "filter", "parentId" ], "type": "object", "description": "Visual query, used by audience" }, "custom": { "properties": { "query": {} }, "required": [ "query" ], "type": "object", "description": "Custom query for sources that doesn't support sql. For example, Airtable." }, "table": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object", "description": "Table-based query that fetches on a table instead of SQL" }, "raw": { "properties": { "sql": { "type": "string" } }, "required": [ "sql" ], "type": "object", "description": "Standard raw SQL query" }, "folderId": { "type": "string" }, "dbt": { "properties": { "modelId": { "type": "number", "format": "double", "description": "Model id that refers to a dbt model" } }, "required": [ "modelId" ], "type": "object" }, "dbt_cloud": { "properties": { "modelId": { "type": "number", "format": "double", "description": "Model id that refers to a dbt Cloud model" } }, "required": [ "modelId" ], "type": "object" } }, "required": [ "name", "slug", "queryType", "sourceId", "isSchema", "primaryKey" ], "type": "object", "additionalProperties": false }, "ModelUpdate": { "description": "The input for updating a Model", "properties": { "name": { "type": "string", "description": "The name of the model" }, "isSchema": { "type": "boolean", "description": "If is_schema is true, the model is just used to build other models.\nEither as part of visual querying, or as the root of a visual query." }, "primaryKey": { "type": "string", "description": "The primary key will be null if the query doesn't get directly synced (e.g. a relationship table for visual querying)" }, "visual": { "properties": { "secondaryLabel": { "type": "string" }, "primaryLabel": { "type": "string" }, "filter": {}, "parentId": { "type": "number", "format": "double", "description": "Parent id of the schema that visual query is based on" } }, "required": [ "filter", "parentId" ], "type": "object", "description": "Visual query, used by audience" }, "custom": { "properties": { "query": {} }, "required": [ "query" ], "type": "object", "description": "Custom query for sources that doesn't support sql. For example, Airtable." }, "table": { "properties": { "name": { "type": "string" } }, "required": [ "name" ], "type": "object", "description": "Table-based query that fetches on a table instead of SQL" }, "raw": { "properties": { "sql": { "type": "string" } }, "required": [ "sql" ], "type": "object", "description": "Standard raw SQL query" }, "folderId": { "type": "string" }, "dbt": { "properties": { "modelId": { "type": "number", "format": "double", "description": "Model id that refers to a dbt model" } }, "required": [ "modelId" ], "type": "object" } }, "type": "object", "additionalProperties": false }, "IntervalUnit": { "enum": [ "minute", "hour", "day", "week" ], "type": "string" }, "Interval": { "properties": { "unit": { "$ref": "#/components/schemas/IntervalUnit" }, "quantity": { "type": "number", "format": "double" } }, "required": [ "unit", "quantity" ], "type": "object", "additionalProperties": false }, "IntervalSchedule": { "properties": { "interval": { "$ref": "#/components/schemas/Interval" } }, "required": [ "interval" ], "type": "object", "additionalProperties": false }, "CronSchedule": { "properties": { "expression": { "type": "string" } }, "required": [ "expression" ], "type": "object", "additionalProperties": false }, "Record_Day.boolean-or-undefined_": { "properties": { "monday": { "type": "boolean" }, "tuesday": { "type": "boolean" }, "wednesday": { "type": "boolean" }, "thursday": { "type": "boolean" }, "friday": { "type": "boolean" }, "saturday": { "type": "boolean" }, "sunday": { "type": "boolean" } }, "type": "object", "description": "Construct a type with a set of properties K of type T" }, "VisualCronSchedule": { "properties": { "expressions": { "items": { "properties": { "days": { "$ref": "#/components/schemas/Record_Day.boolean-or-undefined_" }, "time": { "type": "string" } }, "required": [ "days", "time" ], "type": "object" }, "type": "array" } }, "required": [ "expressions" ], "type": "object", "additionalProperties": false }, "DBTSchedule": { "properties": { "account": { "properties": { "id": { "type": "string" } }, "required": [ "id" ], "type": "object" }, "job": { "properties": { "id": { "type": "string" } }, "required": [ "id" ], "type": "object" } }, "required": [ "account", "job" ], "type": "object", "additionalProperties": false }, "SyncStatus": { "description": "SyncStatus", "enum": [ "disabled", "pending", "cancelled", "failed", "queued", "success", "warning", "querying", "processing", "reporting", "interrupted" ], "type": "string" }, "Sync": { "description": "Syncs define how data from models are mapped to destinations. Each time a\nsync runs, Hightouch calculates the rows that have changed since the last\nrun, and syncs them to Sync's destination.", "properties": { "id": { "type": "number", "format": "double", "description": "The sync's id" }, "slug": { "type": "string", "description": "The sync's slug" }, "workspaceId": { "type": "number", "format": "double", "description": "The id of the workspace that the sync belongs to" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when the sync was created" }, "updatedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the sync was last updated" }, "destinationId": { "type": "number", "format": "double", "description": "The id of the Destination that sync is connected to" }, "modelId": { "type": "number", "format": "double", "description": "The id of the Model that sync is connected to" }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The sync's configuration. This specifies how data is mapped, among other\nconfiguration.\n\nThe schema depends on the destination type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." }, "schedule": { "properties": { "schedule": { "anyOf": [ { "$ref": "#/components/schemas/IntervalSchedule" }, { "$ref": "#/components/schemas/CronSchedule" }, { "$ref": "#/components/schemas/VisualCronSchedule" }, { "$ref": "#/components/schemas/DBTSchedule" } ] }, "type": { "type": "string" } }, "required": [ "schedule", "type" ], "type": "object", "nullable": true, "description": "The scheduling configuration. It can be triggered based on several ways:\n\nInterval: the sync will be triggered based on certain interval(minutes/hours/days/weeks)\n\nCron: the sync will be triggered based on cron expression https://en.wikipedia.org/wiki/Cron.\n\nVisual: the sync will be triggered based a visual cron configuration on UI\n\nDBT-cloud: the sync will be triggered based on a dbt cloud job" }, "status": { "$ref": "#/components/schemas/SyncStatus", "description": "The overall status of the sync" }, "disabled": { "type": "boolean", "description": "Whether the sync has been disabled by the user." }, "lastRunAt": { "type": "string", "format": "date-time", "nullable": true, "description": "The timestamp of the last sync run" }, "referencedColumns": { "items": { "type": "string" }, "type": "array", "description": "The reference column that sync depends on to sync data from source" }, "primaryKey": { "type": "string", "description": "The primary key that sync uses to identify data from source" }, "externalSegment": { "properties": { "id": { "type": "string" } }, "type": "object", "description": "The user facing ID for any created lists or audiences in the sync destination" }, "tags": { "properties": {}, "additionalProperties": { "type": "string" }, "type": "object", "description": "The tags of the sync" } }, "required": [ "id", "slug", "workspaceId", "createdAt", "updatedAt", "destinationId", "modelId", "configuration", "schedule", "status", "disabled", "lastRunAt", "referencedColumns", "primaryKey", "externalSegment", "tags" ], "type": "object", "additionalProperties": false }, "SyncCreate": { "description": "The input for creating a Sync", "properties": { "slug": { "type": "string", "description": "The sync's slug" }, "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The sync's configuration. This specifies how data is mapped, among other\nconfiguration.\n\nThe schema depends on the destination type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." }, "destinationId": { "type": "number", "format": "double", "description": "The id of the Destination that sync is connected to" }, "modelId": { "type": "number", "format": "double", "description": "The id of the Model that sync is connected to" }, "schedule": { "properties": { "schedule": { "anyOf": [ { "$ref": "#/components/schemas/IntervalSchedule" }, { "$ref": "#/components/schemas/CronSchedule" }, { "$ref": "#/components/schemas/VisualCronSchedule" }, { "$ref": "#/components/schemas/DBTSchedule" } ] }, "type": { "type": "string" } }, "required": [ "schedule", "type" ], "type": "object", "nullable": true, "description": "The scheduling configuration. It can be triggered based on several ways:\n\nInterval: the sync will be triggered based on certain interval(minutes/hours/days/weeks)\n\nCron: the sync will be triggered based on cron expression https://en.wikipedia.org/wiki/Cron.\n\nVisual: the sync will be triggered based a visual cron configuration on UI\n\nDBT-cloud: the sync will be triggered based on a dbt cloud job" }, "disabled": { "type": "boolean", "description": "Whether the sync has been disabled by the user." } }, "required": [ "slug", "configuration", "destinationId", "modelId", "schedule", "disabled" ], "type": "object", "additionalProperties": false }, "SyncUpdate": { "description": "The input for updating a Sync", "properties": { "configuration": { "properties": {}, "additionalProperties": {}, "type": "object", "description": "The sync's configuration. This specifies how data is mapped, among other\nconfiguration.\n\nThe schema depends on the destination type.\n\nConsumers should NOT make assumptions on the contents of the\nconfiguration. It may change as Hightouch updates its internal code." }, "schedule": { "properties": { "schedule": { "anyOf": [ { "$ref": "#/components/schemas/IntervalSchedule" }, { "$ref": "#/components/schemas/CronSchedule" }, { "$ref": "#/components/schemas/VisualCronSchedule" }, { "$ref": "#/components/schemas/DBTSchedule" } ] }, "type": { "type": "string" } }, "required": [ "schedule", "type" ], "type": "object", "nullable": true, "description": "The scheduling configuration. It can be triggered based on several ways:\n\nInterval: the sync will be triggered based on certain interval(minutes/hours/days/weeks)\n\nCron: the sync will be triggered based on cron expression https://en.wikipedia.org/wiki/Cron.\n\nVisual: the sync will be triggered based a visual cron configuration on UI\n\nDBT-cloud: the sync will be triggered based on a dbt cloud job" }, "disabled": { "type": "boolean", "description": "Whether the sync has been disabled by the user." } }, "type": "object", "additionalProperties": false }, "SyncRunStatus": { "description": "The status of sync runs", "enum": [ "cancelled", "failed", "queued", "success", "warning", "querying", "processing", "reporting", "interrupted" ], "type": "string" }, "SyncRun": { "properties": { "id": { "type": "number", "format": "double", "description": "The sync run's id" }, "createdAt": { "type": "string", "format": "date-time", "description": "The timestamp when sync run was created. In most cases this will be\nequivalent to `startedAt`, but it may be earlier if the sync was triggered\nwhile a run was already in progress, and the new run didn't start for\na while." }, "startedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the sync run started" }, "finishedAt": { "type": "string", "format": "date-time", "description": "The timestamp when the sync run finished" }, "querySize": { "type": "number", "format": "double", "description": "The number of rows in the query." }, "status": { "$ref": "#/components/schemas/SyncRunStatus", "description": "The status of sync run" }, "completionRatio": { "type": "number", "format": "double", "description": "The completion ratio of sync run, showing the progress of a sync run" }, "plannedRows": { "properties": { "removedCount": { "type": "number", "format": "double", "description": "The number of removed rows." }, "changedCount": { "type": "number", "format": "double", "description": "The number of changed rows." }, "addedCount": { "type": "number", "format": "double", "description": "The number of added rows." } }, "required": [ "removedCount", "changedCount", "addedCount" ], "type": "object", "description": "The number of planned rows that this sync run was supposed to execute.\n\nNote that the counts for `successfulRows` and `failedRows` may not add up\nto `plannedRows` if the sync was cancelled." }, "successfulRows": { "properties": { "removedCount": { "type": "number", "format": "double", "description": "The number of successful removes." }, "changedCount": { "type": "number", "format": "double", "description": "The number of successful changes." }, "addedCount": { "type": "number", "format": "double", "description": "The number of successful adds." } }, "required": [ "removedCount", "changedCount", "addedCount" ], "type": "object", "description": "The number of rows that were successfully processed by the destination." }, "failedRows": { "properties": { "removedCount": { "type": "number", "format": "double", "description": "The number of failed removes." }, "changedCount": { "type": "number", "format": "double", "description": "The number of failed changes." }, "addedCount": { "type": "number", "format": "double", "description": "The number of failed adds." } }, "required": [ "removedCount", "changedCount", "addedCount" ], "type": "object", "description": "The number of rows that we attempted to sync, but were rejected by the\ndestination.\n\nThis does not include rows that weren't attempted due to the sync being\ncancelled." }, "error": { "type": "string", "description": "Error message if the sync run didn't finish successfully" } }, "required": [ "id", "createdAt", "startedAt", "finishedAt", "querySize", "status", "completionRatio", "plannedRows", "successfulRows", "failedRows" ], "type": "object", "additionalProperties": false }, "TriggerRunOutput": { "description": "The output of a trigger action to run syncs", "properties": { "id": { "type": "string", "description": "The id of the triggered sync run. This can be passed to `/sync/runs` to\nget the run's status." } }, "required": [ "id" ], "type": "object", "additionalProperties": false }, "TriggerRunInput": { "properties": { "clearAndFill": { "type": "boolean", "description": "Whether to clear the audience and then sync the full query to the destination", "default": "false" }, "resetCDC": { "type": "boolean", "description": "Whether to sync all the rows in the query without executing changes on the destination.", "default": "false" }, "fullResync": { "type": "boolean", "description": "Whether to resync all the rows in the query (i.e. ignoring previously\nsynced rows).", "default": "false" } }, "type": "object", "description": "The input of a trigger action to run syncs" }, "TriggerRunCustomInput": { "properties": { "syncSlug": { "type": "string", "description": "Trigger run based on sync slug" }, "syncId": { "type": "string", "description": "Trigger run based on sync id", "pattern": "^[0-9]+$" }, "clearAndFill": { "type": "boolean", "description": "Whether to clear the audience and then sync the full query to the destination", "default": "false" }, "resetCDC": { "type": "boolean", "description": "Whether to sync all the rows in the query without executing changes on the destination.", "default": "false" }, "fullResync": { "type": "boolean", "description": "Whether to resync all the rows in the query (i.e. ignoring previously\nsynced rows).", "default": "false" } }, "type": "object", "description": "The input of a trigger action to run syncs based on sync ID, slug or other filters" }, "TriggerSequenceRunOutput": { "description": "The output of a trigger action to run sync sequences", "properties": { "id": { "type": "string", "description": "The id of the triggered sync sequence run." } }, "required": [ "id" ], "type": "object", "additionalProperties": false }, "SyncSequenceRequestStatus": { "enum": [ "pending", "running", "done", "failed", "cancelled" ], "type": "string" }, "SyncSequenceStatusOutput": { "description": "The status of a given sync sequence run at both a high level and the individual\nsync-run level.", "properties": { "id": { "type": "string" }, "status": { "$ref": "#/components/schemas/SyncSequenceRequestStatus" }, "syncRuns": { "items": { "properties": { "finishedAt": { "type": "string" }, "syncId": { "type": "number", "format": "double" }, "status": { "$ref": "#/components/schemas/SyncRunStatus" }, "syncRunId": { "type": "number", "format": "double" } }, "required": [ "finishedAt", "syncId", "status", "syncRunId" ], "type": "object" }, "type": "array" } }, "required": [ "id", "status", "syncRuns" ], "type": "object", "additionalProperties": false } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "Bearer" } } }, "info": { "title": "Hightouch API", "version": "1.0.0", "description": "Hightouch Public Rest API to access syncs, models, sources and destinations", "contact": { "name": "Hightouch", "url": "https://hightouch.com" } }, "openapi": "3.0.0", "paths": { "/campaigns/{campaignId}/trigger": { "post": { "operationId": "TriggerCampaign", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/StartCampaignResponse" }, { "$ref": "#/components/schemas/TriggerErrorResponse" } ] } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerErrorResponse" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Campaign not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerErrorResponse" } } } }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "429": { "description": "Rate limited", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerErrorResponse" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Start an API-triggered campaign: send to the given recipients.", "summary": "Trigger an API campaign send", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "campaignId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StartCampaignRequest" } } } } } }, "/campaigns/{campaignId}/sends/{sendId}": { "get": { "operationId": "GetSendStatus", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/SendStatusResponse" }, { "$ref": "#/components/schemas/TriggerErrorResponse" } ] } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Send not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerErrorResponse" } } } }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Get the delivery status of a single send by the `sendId` returned from the\nstart endpoint.", "summary": "Get send delivery status", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "campaignId", "required": true, "schema": { "type": "string" } }, { "in": "path", "name": "sendId", "required": true, "schema": { "type": "string" } } ] } }, "/decision-engine/flow/{flowId}": { "get": { "operationId": "GetFlow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/DecisionEngineFlow" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true }, "examples": { "Example 1": { "value": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My Flow", "workspaceId": 1, "decisionEngineId": "660e8400-e29b-41d4-a716-446655440001", "audienceId": 100, "status": "active" } } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" } }, "description": "Retrieve a decision engine flow by ID", "summary": "Get Decision Engine Flow", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The UUID of the flow", "in": "path", "name": "flowId", "required": true, "schema": { "type": "string" } } ] } }, "/decision-engine/flows": { "get": { "operationId": "ListFlows", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "properties": { "hasMore": { "type": "boolean" }, "data": { "items": { "$ref": "#/components/schemas/DecisionEngineFlow" }, "type": "array" } }, "required": [ "hasMore", "data" ], "type": "object" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true }, "examples": { "Example 1": { "value": { "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My Flow", "workspaceId": 1, "decisionEngineId": "660e8400-e29b-41d4-a716-446655440001", "audienceId": 100, "status": "active" } ], "hasMore": false } } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" } }, "description": "List decision engine flows in the workspace", "summary": "List Decision Engine Flows", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "optional filter by flow name", "in": "query", "name": "name", "required": false, "schema": { "type": "string" } }, { "description": "max results (default 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "pagination offset", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "sort field", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name" ] } } ] } }, "/decision-engine/flow/{flowId}/messages": { "get": { "operationId": "ListMessages", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "properties": { "hasMore": { "type": "boolean" }, "data": { "items": { "$ref": "#/components/schemas/DecisionEngineMessage" }, "type": "array" } }, "required": [ "hasMore", "data" ], "type": "object" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" } }, "description": "List messages for a flow", "summary": "List Decision Engine Messages", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The UUID of the flow", "in": "path", "name": "flowId", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } } ] }, "post": { "operationId": "CreateMessage", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/DecisionEngineMessage" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a message in a flow", "summary": "Create Decision Engine Message", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The UUID of the flow", "in": "path", "name": "flowId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DecisionEngineMessageCreate" } } } } } }, "/decision-engine/flow/{flowId}/messages/{messageId}": { "get": { "operationId": "GetMessage", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/DecisionEngineMessage" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" } }, "description": "Get a single message by flow and message ID", "summary": "Get Decision Engine Message", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The UUID of the flow", "in": "path", "name": "flowId", "required": true, "schema": { "type": "string" } }, { "description": "The UUID of the message", "in": "path", "name": "messageId", "required": true, "schema": { "type": "string" } } ] }, "patch": { "operationId": "UpdateMessage", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/DecisionEngineMessage" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update a message", "summary": "Update Decision Engine Message", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The UUID of the flow", "in": "path", "name": "flowId", "required": true, "schema": { "type": "string" } }, { "description": "The UUID of the message", "in": "path", "name": "messageId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DecisionEngineMessageUpdate" } } } } } }, "/decision-engine/flow/{flowId}/run": { "post": { "operationId": "RunFlow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/DecisionEngineRunResponse" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ], "nullable": true }, "examples": { "Example 1": { "value": { "flowsEnqueued": 1 } } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Trigger a decision engine run for a specific flow", "summary": "Trigger Decision Engine Flow Run", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The UUID of the flow", "in": "path", "name": "flowId", "required": true, "schema": { "type": "string" } } ] } }, "/destinations/{destinationId}": { "get": { "operationId": "GetDestination", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Destination" }, "examples": { "Example 1": { "value": { "id": 1, "name": "testdestination", "slug": "testdestination", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "type": "salesforce", "syncs": [ 1, 2 ], "configuration": { "hostname": "foo", "region": "bar" } } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" } }, "description": "Retrieve a destination based on its Hightouch ID", "summary": "Get Destination", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The destination's ID", "in": "path", "name": "destinationId", "required": true, "schema": { "format": "double", "type": "number" } } ] }, "patch": { "operationId": "UpdateDestination", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Destination" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 1, "name": "Webhook Website code 201", "slug": "webhookwebsite", "workspaceId": 1, "createdAt": "2022-11-09T18:39:24.957Z", "updatedAt": "2022-12-10T00:14:17.938Z", "type": "webhook", "syncs": [], "configuration": { "url": "http://httpstat.us/201", "methodKey": "url" } } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update an existing destination\n\nPatch a destination based on its Hightouch ID", "summary": "Update Destination", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The destination's ID", "in": "path", "name": "destinationId", "required": true, "schema": { "format": "double", "type": "number" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationUpdate" }, "example": { "name": "Webhook Website code 201", "configuration": { "url": "http://httpstat.us/201", "methodKey": "url" } } } } } } }, "/destinations": { "get": { "operationId": "ListDestination", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "data": { "items": { "$ref": "#/components/schemas/Destination" }, "type": "array" } }, "required": [ "data" ], "type": "object" }, "examples": { "Example 1": { "value": { "data": [ { "id": 1, "name": "testdestination1", "slug": "testdestination1", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "type": "salesforce", "syncs": [ 1, 2 ], "configuration": { "hostname": "foo", "region": "bar" } }, { "id": 2, "name": "testdestination2", "slug": "testdestination2", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "type": "hubspot", "syncs": [ 1, 2 ], "configuration": { "hostname": "foo", "region": "bar" } } ], "hasMore": false } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List the destinations in the user's workspace", "summary": "List Destinations", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "Filter based on the destination's name", "in": "query", "name": "name", "required": false, "schema": { "type": "string" } }, { "description": "Filter based on destination's slug", "in": "query", "name": "slug", "required": false, "schema": { "type": "string" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "Order the returned destinations", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name", "slug", "createdAt", "updatedAt" ] } } ] }, "post": { "operationId": "CreateDestination", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Destination" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 1, "name": "Webhook Website", "slug": "webhookwebsite", "workspaceId": 1, "createdAt": "2022-11-09T18:39:24.957Z", "updatedAt": "2022-11-09T18:39:24.957Z", "type": "webhook", "syncs": [], "configuration": { "url": "http://httpstat.us/200", "methodKey": "url" } } } } } } }, "401": { "description": "Unauthorized" }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a new destination", "summary": "Create Destination", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationCreate" }, "example": { "name": "Webhook Website", "slug": "webhookwebsite", "type": "webhook", "configuration": { "url": "http://httpstat.us/200", "methodKey": "url" } } } } } } }, "/events/contracts/{contractId}": { "get": { "operationId": "GetContract", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventContract" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": "1", "name": "My Contract", "slug": "my-contract", "workspaceId": 1, "events": [ { "type": "track", "name": "Checked Out", "slug": "track-checked-out", "version": "default", "schema": { "type": "object", "required": [ "req" ], "properties": { "req": { "type": "string" } }, "description": "" }, "onSchemaViolation": "ALLOW_EVENT", "onUndeclaredFields": "BLOCK_EVENT" } ], "onUndeclaredSchema": "BLOCK_EVENT", "eventSources": [ { "id": "1", "name": "Marketing Site" } ], "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z" } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Retrieve a contract based on its contract ID", "summary": "Get Contract", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the contract", "in": "path", "name": "contractId", "required": true, "schema": { "type": "string" } } ] }, "patch": { "operationId": "UpdateContract", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventContractUpdate" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": "1", "name": "My Contract", "workspaceId": 1, "events": [ { "type": "track", "name": "Checked Out", "slug": "track-checked-out", "version": "default", "schema": { "type": "object", "required": [ "req" ], "properties": { "req": { "type": "string" } }, "description": "" }, "onSchemaViolation": "ALLOW_EVENT", "onUndeclaredFields": "BLOCK_EVENT" } ], "onUndeclaredSchema": "BLOCK_EVENT", "eventSources": [ { "id": "1", "name": "Marketing Site" } ], "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z" } } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update an existing event contract\n\nPatch an event contract based on its Hightouch ID", "summary": "Update an Event Contract", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "contractId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventContractUpdate" }, "example": { "events": [ { "type": "track", "name": "Checked Out", "onUndeclaredFields": "BLOCK_EVENT", "onSchemaViolation": "BLOCK_EVENT", "schema": { "type": "object", "properties": { "properties": { "type": "object", "required": [ "total" ], "properties": { "total": { "type": "number" } } } } } } ] } } } } } }, "/events/contracts": { "get": { "operationId": "ListContracts", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "data": { "items": { "$ref": "#/components/schemas/EventContract" }, "type": "array" } }, "required": [ "data" ], "type": "object" }, "examples": { "Example 1": { "value": { "data": [ { "id": "1", "name": "My Contract", "slug": "my-contract", "workspaceId": 1, "events": [ { "type": "track", "name": "Checked Out", "slug": "track-checked-out", "version": "default", "schema": { "type": "object", "required": [ "req" ], "properties": { "req": { "type": "string" } }, "description": "" }, "onSchemaViolation": "BLOCK_EVENT", "onUndeclaredFields": "BLOCK_EVENT" } ], "onUndeclaredSchema": "BLOCK_EVENT", "eventSources": [ { "id": "1", "name": "Marketing Site" } ], "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z" } ], "hasMore": false } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List all event contracts in the current workspace", "summary": "List Event Contracts", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "query", "name": "name", "required": false, "schema": { "type": "string" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "specify the order", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name", "createdAt", "updatedAt" ] } } ] }, "post": { "operationId": "CreateContract", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventContract" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": "1", "name": "My Contract", "workspaceId": 1, "events": [ { "type": "track", "name": "Checked Out", "version": "default", "schema": { "type": "object", "required": [ "req" ], "properties": { "req": { "type": "string" } }, "description": "" }, "onSchemaViolation": "ALLOW_EVENT", "onUndeclaredFields": "BLOCK_EVENT" } ], "onUndeclaredSchema": "BLOCK_EVENT", "eventSources": [ { "id": "1", "name": "Marketing Site" } ], "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z" } } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a new event contract", "summary": "Create an Event Contract", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventContractCreate" }, "example": { "name": "My Contract", "events": [ { "type": "track", "name": "Checked Out", "onUndeclaredFields": "ALLOW_EVENT", "onSchemaViolation": "BLOCK_EVENT", "schema": { "type": "object", "properties": { "properties": { "type": "object", "required": [ "total" ], "properties": { "total": { "type": "number" } } } } } } ] } } } } } }, "/events/domains/{domainId}": { "get": { "operationId": "GetDomain", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventDomain" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Retrieve a domain by its id, including its events and components.", "summary": "Get Domain", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the domain", "in": "path", "name": "domainId", "required": true, "schema": { "type": "string" } } ] }, "patch": { "operationId": "UpdateDomain", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventDomain" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update an existing event domain, replacing its events and components.", "summary": "Update an Event Domain", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The domain's id", "in": "path", "name": "domainId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventDomainUpdate" } } } } } }, "/events/domains": { "get": { "operationId": "ListDomains", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "data": { "items": { "$ref": "#/components/schemas/EventDomain" }, "type": "array" } }, "required": [ "data" ], "type": "object" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List all event domains in the current workspace.", "summary": "List Event Domains", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "query", "name": "name", "required": false, "schema": { "type": "string" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "specify the order", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name", "createdAt", "updatedAt" ] } } ] }, "post": { "operationId": "CreateDomain", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/EventDomain" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a new event domain, with its events and components.", "summary": "Create an Event Domain", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventDomainCreate" } } } } } }, "/idr/{graphId}/trigger": { "post": { "operationId": "TriggerIdrRun", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunIdrOutput" } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Trigger a new IDR run for a graph", "summary": "Trigger IDR run", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "graphId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunIdrInput" } } } } } }, "/idr/{graphId}/runs": { "get": { "operationId": "ListIdrRuns", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListIdrRunsOutput" }, "examples": { "Example 1": { "value": { "data": [ { "id": "715eba82-2097-4c1b-91c0-ae7c279c763a", "graphId": "e9037b3e-2401-48f9-85eb-8c6e75e3a813", "status": "SUCCESS", "createdAt": "2025-06-01T00:00:00.000Z", "startedAt": "2025-06-01T00:00:01.000Z", "finishedAt": "2025-06-01T00:00:02.000Z", "fullRerun": false, "stats": { "deterministic": { "numUniqueProfiles": 100, "numNewUniqueProfiles": 50, "numSourceRows": 1000 } } } ], "hasMore": true } } } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List runs for a given IDR graph", "summary": "List IDR runs", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "Required. ID of the graph to list runs for.", "in": "path", "name": "graphId", "required": true, "schema": { "type": "string" } }, { "description": "Run ID to query for.", "in": "query", "name": "runId", "required": false, "schema": { "type": "string" } }, { "description": "Select runs that started on or after this ISO timestamp.", "in": "query", "name": "after", "required": false, "schema": { "format": "date-time", "type": "string" } }, { "description": "Select runs that started on or before this ISO timestamp.", "in": "query", "name": "before", "required": false, "schema": { "format": "date-time", "type": "string" } }, { "description": "Maximum number of runs to return.", "in": "query", "name": "limit", "required": false, "schema": { "default": 20, "format": "double", "type": "number" } }, { "description": "Offset to start at for pagination.", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "Field to sort by.", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "created_at", "type": "string", "enum": [ "created_at", "started_at", "finished_at" ] } } ] } }, "/idr/{graphId}/queue-for-reprocessing": { "post": { "operationId": "QueueForReprocessing", "responses": { "200": { "description": "ID associated with the reprocessing request. This can be used to query the status of the request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdrQueueForReprocessingOutput" } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Trigger an async job to queue identifier values for reprocessing, optionally adding them to the blocklist.\nIf `block` is true (the default), identifier values will be added to the blocklist and ignored in future runs.\nClusters containing these identifier values will be queued for reprocessing.", "summary": "Queue identifier values for reprocessing", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "Required. ID of the graph containing the identifiers.", "in": "path", "name": "graphId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdrQueueForReprocessingInput" }, "example": { "identifiers": [ { "identifier": "email", "value": "a@b.com" }, { "identifier": "phone", "value": "1234567890" } ], "block": true } } } } } }, "/idr/{graphId}/reprocess-status/{requestId}": { "get": { "operationId": "ReprocessStatus", "responses": { "200": { "description": "The status of the reprocessing request.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IdrReprocessStatusOutput" }, "examples": { "queueing": { "value": { "status": "queueing", "queuedAt": null, "reprocessedAt": null, "reprocessedRunId": null, "error": null } }, "queued": { "value": { "status": "queued", "queuedAt": "2025-10-07T01:23:45.678Z", "reprocessedAt": null, "reprocessedRunId": null, "error": null } }, "reprocessed": { "value": { "status": "reprocessed", "queuedAt": "2025-10-07T01:23:45.678Z", "reprocessedAt": "2025-10-07T01:23:45.678Z", "reprocessedRunId": "123e4567-e89b-12d3-a456-426614174000", "error": null } }, "failed": { "value": { "status": "failed", "queuedAt": null, "reprocessedAt": null, "reprocessedRunId": null, "error": "Failed to write identifiers to data warehouse" } } } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Get the status of a reprocessing request", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "Required. ID of the graph for the reprocessing request.", "in": "path", "name": "graphId", "required": true, "schema": { "type": "string" } }, { "description": "Required. ID of the reprocessing request.", "in": "path", "name": "requestId", "required": true, "schema": { "type": "string" } } ] } }, "/id_graphs/{graphId}/trigger": { "post": { "operationId": "TriggerRunIdGraph", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunIdrOutput" } } } }, "400": { "description": "Bad Request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "DEPRECATED: use `/idr/{graphId}/trigger` instead", "deprecated": true, "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "graphId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunIdrInput" } } } } } }, "/sources/{sourceId}": { "get": { "operationId": "GetSource", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Source" }, "examples": { "Example 1": { "value": { "id": 1, "name": "testSource", "slug": "testSource", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "type": "snowflake", "configuration": { "hostname": "foo", "region": "bar" } } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Retrieve source from source ID", "summary": "Get Source", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the source", "in": "path", "name": "sourceId", "required": true, "schema": { "format": "double", "type": "number" } } ] }, "patch": { "operationId": "UpdateSource", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Source" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 426, "name": "postgres-connection2", "slug": "postgres-connection2", "workspaceId": 1, "createdAt": "2022-12-12T22:46:57.618Z", "updatedAt": "2022-12-15T20:23:22.319Z", "type": "postgres", "configuration": { "host": "example.example.us-east-1.rds.amazonaws.com", "port": "5555", "user": "dbUserName", "database": "dbName" } } } } } } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update an existing source\n\nPatch a source based on its Hightouch ID", "summary": "Update Source", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The source's ID", "in": "path", "name": "sourceId", "required": true, "schema": { "format": "double", "type": "number" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceUpdate" }, "example": { "name": "postgres-connection2", "configuration": { "port": "5555" } } } } } } }, "/sources": { "get": { "operationId": "ListSource", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "data": { "items": { "$ref": "#/components/schemas/Source" }, "type": "array" } }, "required": [ "data" ], "type": "object" }, "examples": { "Example 1": { "value": { "data": [ { "id": 1, "name": "testSource1", "slug": "testSource1", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "type": "snowflake", "configuration": { "hostname": "foo", "region": "bar" } }, { "id": 2, "name": "testSource2", "slug": "testSource2", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "type": "googlesheet", "configuration": { "hostname": "foo", "region": "bar" } } ], "hasMore": false } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" } }, "description": "List all the sources in the current workspace", "summary": "List Sources", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "filter based on name", "in": "query", "name": "name", "required": false, "schema": { "type": "string" } }, { "description": "filter based on slug", "in": "query", "name": "slug", "required": false, "schema": { "type": "string" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "specify the order", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name", "slug", "createdAt", "updatedAt" ] } } ] }, "post": { "operationId": "CreateSource", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Source" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 426, "name": "postgres-connection2", "slug": "postgres-connection2", "workspaceId": 1, "createdAt": "2022-12-12T22:46:57.618Z", "updatedAt": "2022-12-12T22:46:57.618Z", "type": "postgres", "configuration": { "host": "example.example.us-east-1.rds.amazonaws.com", "port": "5432", "user": "dbUserName", "database": "dbName" } } } } } } }, "401": { "description": "Unauthorized" }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a new source", "summary": "Create Source", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceCreate" }, "example": { "name": "postgres-connection2", "slug": "postgres-connection2", "type": "postgres", "configuration": { "host": "example.example.us-east-1.rds.amazonaws.com", "port": "5432", "user": "dbUserName", "database": "dbName", "password": "password!123" } } } } } } }, "/models/{modelId}": { "get": { "operationId": "GetModel", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Model" }, "examples": { "Example 1": { "value": { "id": 1, "name": "testModel", "slug": "testModel", "description": "", "workspaceId": 1, "primaryKey": "id", "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "sourceId": 1, "queryType": "raw_sql", "tags": { "foo": "bar" }, "isSchema": false, "raw": { "sql": "select * from users" }, "syncs": [ 1, 2 ], "lastRunSize": 12345 } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" } }, "description": "Retrieve models from model ID", "summary": "Get Model", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the model", "in": "path", "name": "modelId", "required": true, "schema": { "format": "double", "type": "number" } } ] }, "patch": { "operationId": "UpdateModel", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Model" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 1, "name": "testModel", "slug": "testModel", "description": "", "workspaceId": 1, "primaryKey": "id", "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-17T23:19:05.000Z", "sourceId": 1, "queryType": "raw_sql", "tags": { "foo": "bar" }, "isSchema": false, "raw": { "sql": "select name from users" }, "syncs": [ 1, 2 ], "lastRunSize": 12345 } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update an existing model\n\nPatch a model based on its Hightouch ID", "summary": "Update Model", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The model's ID", "in": "path", "name": "modelId", "required": true, "schema": { "format": "double", "type": "number" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelUpdate" }, "example": { "name": "testmodel", "primaryKey": "id", "raw": { "sql": "select name from users" } } } } } } }, "/models": { "get": { "operationId": "ListModel", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "data": { "items": { "$ref": "#/components/schemas/Model" }, "type": "array" } }, "required": [ "data" ], "type": "object" }, "examples": { "Example 1": { "value": { "data": [ { "id": 1, "name": "testModel", "slug": "testModel", "description": "", "workspaceId": 1, "primaryKey": "id", "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "sourceId": 1, "queryType": "raw_sql", "tags": { "foo": "bar" }, "isSchema": false, "raw": { "sql": "select * from users" }, "syncs": [ 1, 2 ], "lastRunSize": 12345 }, { "id": 2, "name": "testModel2", "slug": "testModel2", "description": "", "workspaceId": 1, "primaryKey": "id", "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "sourceId": 1, "queryType": "raw_sql", "tags": { "foo": "baz" }, "isSchema": false, "raw": { "sql": "select * from accounts" }, "syncs": [ 1, 2 ], "lastRunSize": 6789 } ], "hasMore": false } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List all the models in the current workspace including parent and related models", "summary": "List Models", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "filter based on name", "in": "query", "name": "name", "required": false, "schema": { "type": "string" } }, { "description": "filter based on slug", "in": "query", "name": "slug", "required": false, "schema": { "type": "string" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "specify the order", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name", "slug", "createdAt", "updatedAt" ] } }, { "description": "filter models based on tags (format: key:value), ex: team:marketing. Repeat this parameter for multiple tags.", "in": "query", "name": "tags", "required": false, "schema": { "default": [], "type": "array", "items": { "type": "string" } } } ] }, "post": { "operationId": "CreateModel", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Model" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 3, "name": "testModel3", "slug": "testModel3", "description": "", "workspaceId": 1, "primaryKey": "id", "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "sourceId": 1, "queryType": "raw_sql", "tags": {}, "isSchema": false, "raw": { "sql": "select id, last_name from users" }, "syncs": [], "lastRunSize": null } } } } } }, "401": { "description": "Unauthorized" }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a new model", "summary": "Create Model", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "query", "name": "skipColumnQuery", "required": false, "schema": { "default": false, "type": "boolean" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ModelCreate" }, "example": { "name": "testModel3", "slug": "testModel3", "primaryKey": "id", "sourceId": 1, "queryType": "raw_sql", "isSchema": false, "raw": { "sql": "select id, last_name from users" } } } } } } }, "/syncs/{syncId}": { "get": { "operationId": "GetSync", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Sync" }, "examples": { "Example 1": { "value": { "id": 1, "slug": "testsync", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "destinationId": 1, "modelId": 1, "configuration": { "mode": "upsert", "object": "contacts", "mappings": [ { "to": "email", "from": "email", "type": "standard" }, { "to": "phone", "from": "phone", "type": "standard" } ], "objectId": "0-1", "externalIdMapping": { "to": "firstname", "from": "test_id", "type": "standard" }, "associationMappings": [] }, "schedule": { "type": "interval", "schedule": { "interval": { "unit": "day", "quantity": 1 } } }, "disabled": false, "status": "success", "lastRunAt": "2022-02-16T21:37:58.510Z", "referencedColumns": [ "email", "name" ], "primaryKey": "id", "externalSegment": {}, "tags": { "foo": "bar" } } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" } }, "description": "Retrieve sync from sync ID", "summary": "Get Sync", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the sync", "in": "path", "name": "syncId", "required": true, "schema": { "format": "double", "type": "number" } } ] }, "patch": { "operationId": "UpdateSync", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Sync" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 1, "slug": "testsync3", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-03-19T19:24:34.320Z", "destinationId": 1, "modelId": 4, "configuration": { "mode": "upsert", "object": "contacts", "mappings": [ { "to": "email", "from": "email", "type": "standard" } ], "objectId": "0-1", "externalIdMapping": { "to": "firstname", "from": "test_id", "type": "standard" }, "associationMappings": [] }, "schedule": { "type": "interval", "schedule": { "interval": { "unit": "day", "quantity": 1 } } }, "status": "success", "disabled": true, "lastRunAt": "2022-02-16T21:37:58.510Z", "referencedColumns": [ "email", "name" ], "primaryKey": "id", "externalSegment": {}, "tags": { "foo": "bar" } } } } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Not found" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Update an existing sync\n\nPatch a sync based on its Hightouch ID", "summary": "Update Sync", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The sync's ID", "in": "path", "name": "syncId", "required": true, "schema": { "format": "double", "type": "number" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncUpdate" }, "example": { "configuration": { "mode": "upsert", "object": "contacts", "mappings": [ { "to": "email", "from": "email", "type": "standard" } ], "objectId": "0-1", "externalIdMapping": { "to": "firstname", "from": "test_id", "type": "standard" }, "associationMappings": [] }, "schedule": null, "disabled": true } } } } } }, "/syncs": { "get": { "operationId": "ListSync", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "hasMore": { "type": "boolean" }, "data": { "items": { "$ref": "#/components/schemas/Sync" }, "type": "array" } }, "required": [ "hasMore", "data" ], "type": "object" }, "examples": { "Example 1": { "value": { "hasMore": false, "data": [ { "id": 1, "slug": "testsync", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "destinationId": 1, "modelId": 1, "configuration": { "mode": "upsert", "object": "contacts", "mappings": [ { "to": "email", "from": "email", "type": "standard" }, { "to": "phone", "from": "phone", "type": "standard" } ], "objectId": "0-1", "externalIdMapping": { "to": "firstname", "from": "test_id", "type": "standard" }, "associationMappings": [] }, "schedule": { "type": "interval", "schedule": { "interval": { "unit": "day", "quantity": 1 } } }, "status": "success", "disabled": false, "lastRunAt": "2022-02-16T21:37:58.510Z", "referencedColumns": [ "email", "name" ], "primaryKey": "id", "externalSegment": {}, "tags": { "foo": "bar" } } ] } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List all the syncs in the current workspace", "summary": "List Syncs", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "filter based on slug", "in": "query", "name": "slug", "required": false, "schema": { "type": "string" } }, { "description": "filter based on modelId", "in": "query", "name": "modelId", "required": false, "schema": { "format": "double", "type": "number" } }, { "description": "select syncs that were run after given ISO timestamp", "in": "query", "name": "after", "required": false, "schema": { "format": "date-time", "type": "string" } }, { "description": "select syncs that were run before given ISO timestamp", "in": "query", "name": "before", "required": false, "schema": { "format": "date-time", "type": "string" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "specify the order", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "name", "slug", "createdAt", "updatedAt" ] } } ] }, "post": { "operationId": "CreateSync", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/Sync" }, { "$ref": "#/components/schemas/ValidateErrorJSON" }, { "$ref": "#/components/schemas/InternalServerError" } ] }, "examples": { "Example 1": { "value": { "id": 1, "slug": "testsync3", "workspaceId": 1, "createdAt": "2022-02-16T21:37:58.510Z", "updatedAt": "2022-02-16T21:37:58.510Z", "destinationId": 1, "modelId": 4, "configuration": { "mode": "upsert", "object": "contacts", "mappings": [ { "to": "email", "from": "email", "type": "standard" } ], "objectId": "0-1", "externalIdMapping": { "to": "firstname", "from": "test_id", "type": "standard" }, "associationMappings": [] }, "schedule": { "type": "interval", "schedule": { "interval": { "unit": "day", "quantity": 1 } } }, "status": "success", "disabled": false, "lastRunAt": null, "referencedColumns": [ "email", "name" ], "primaryKey": "id", "externalSegment": {}, "tags": { "foo": "bar" } } } } } } }, "401": { "description": "Unauthorized" }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } }, "500": { "description": "Something went wrong", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InternalServerError" } } } } }, "description": "Create a new sync", "summary": "Create Sync", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncCreate" }, "example": { "slug": "testsync3", "destinationId": "1", "modelId": "4", "configuration": { "mode": "upsert", "object": "contacts", "mappings": [ { "to": "email", "from": "email", "type": "standard" } ], "objectId": "0-1", "externalIdMapping": { "to": "firstname", "from": "test_id", "type": "standard" }, "associationMappings": [] }, "schedule": null, "disabled": false } } } } } }, "/syncs/{syncId}/runs": { "get": { "operationId": "ListSyncRuns", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "properties": { "hasMore": { "type": "boolean" }, "data": { "items": { "$ref": "#/components/schemas/SyncRun" }, "type": "array" } }, "required": [ "hasMore", "data" ], "type": "object" }, "examples": { "Example 1": { "value": { "data": [ { "id": 42, "startedAt": "2022-02-08T16:11:04.712Z", "createdAt": "2022-02-08T16:11:04.712Z", "finishedAt": "2022-02-08T16:11:11.698Z", "querySize": 773, "status": "success", "completionRatio": 0.54, "plannedRows": { "addedCount": 773, "changedCount": 0, "removedCount": 0 }, "successfulRows": { "addedCount": 773, "changedCount": 0, "removedCount": 0 }, "failedRows": { "addedCount": 0, "changedCount": 0, "removedCount": 0 }, "error": null }, { "id": 43, "startedAt": "2022-02-08T16:11:04.712Z", "createdAt": "2022-02-08T17:44:05.198Z", "finishedAt": "2022-02-08T17:44:25.366Z", "querySize": 773, "status": "success", "completionRatio": 0.54, "plannedRows": { "addedCount": 0, "changedCount": 765, "removedCount": 0 }, "successfulRows": { "addedCount": 0, "changedCount": 765, "removedCount": 0 }, "failedRows": { "addedCount": 0, "changedCount": 0, "removedCount": 0 }, "error": null } ], "hasMore": false } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "List all sync runs under a sync", "summary": "List Sync Runs", "security": [ { "bearerAuth": [] } ], "parameters": [ { "in": "path", "name": "syncId", "required": true, "schema": { "format": "double", "type": "number" } }, { "description": "query for specific run id", "in": "query", "name": "runId", "required": false, "schema": { "format": "double", "type": "number" } }, { "description": "select sync runs that are started after given ISO timestamp", "in": "query", "name": "after", "required": false, "schema": { "format": "date-time", "type": "string" } }, { "description": "select sync runs that are started before certain ISO timestamp", "in": "query", "name": "before", "required": false, "schema": { "format": "date-time", "type": "string" } }, { "description": "select sync runs that are started within last given minutes", "in": "query", "name": "within", "required": false, "schema": { "format": "double", "type": "number" } }, { "description": "set the offset on results (for pagination)", "in": "query", "name": "offset", "required": false, "schema": { "default": 0, "format": "double", "type": "number" } }, { "description": "limit the number of objects returned (default is 100)", "in": "query", "name": "limit", "required": false, "schema": { "default": 100, "format": "double", "type": "number" } }, { "description": "specify the order", "in": "query", "name": "orderBy", "required": false, "schema": { "default": "id", "type": "string", "enum": [ "id", "createdAt", "startedAt", "finishedAt" ] } } ] } }, "/syncs/{syncId}/trigger": { "post": { "operationId": "TriggerRun", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunOutput" } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Trigger a new run for the given sync.\n\nIf a run is already in progress, this queues a sync run that will get\nexecuted immediately after the current run completes.", "summary": "Trigger Sync", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the sync to trigger a run", "in": "path", "name": "syncId", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunInput" } } } } } }, "/syncs/trigger": { "post": { "operationId": "TriggerRunCustom", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "anyOf": [ { "$ref": "#/components/schemas/TriggerRunOutput" }, { "$ref": "#/components/schemas/ValidateErrorJSON" } ] } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Trigger a new run globally based on sync id or sync slug\n\nIf a run is already in progress, this queues a sync run that will get\nexecuted immediately after the current run completes.", "summary": "Trigger Sync From ID or Slug", "security": [ { "bearerAuth": [] } ], "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerRunCustomInput" } } } } } }, "/sync-sequences/{syncSequenceId}/trigger": { "post": { "operationId": "TriggerSequenceRun", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TriggerSequenceRunOutput" }, "examples": { "Example 1": { "value": { "id": "0cb7da35-1fff-4d4a-bf1b-6534d515e5b5" } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Trigger a new run for the given sync sequence.\n\nA sequence never runs concurrently with itself. If a run is already in\nprogress, then where run queueing is enabled for the workspace, a single\nfollow-up run is queued and starts after the current run completes\n(repeated triggers return the same queued run); otherwise the id of the\nrun already in progress is returned.", "summary": "Trigger Sync sequence", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the sync sequence to trigger a run", "in": "path", "name": "syncSequenceId", "required": true, "schema": { "type": "string" } } ] } }, "/sync-sequences/runs/{syncSequenceRunId}": { "get": { "operationId": "GetSyncSequenceRun", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SyncSequenceStatusOutput" }, "examples": { "Example 1": { "value": { "id": "0cb7da35-1fff-4d4a-bf1b-6534d515e5b5", "status": "done", "syncRuns": [ { "syncId": 3093, "status": "success", "finishedAt": "2023-10-17T11:06:01.713+00:00", "syncRunId": 6134 }, { "syncId": 1960, "status": "warning", "finishedAt": "2023-10-17T11:06:10.567+00:00", "syncRunId": 6148 } ] } } } } } }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "422": { "description": "Validation Failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidateErrorJSON" } } } } }, "description": "Get the status of a sync sequence run.", "summary": "Sync sequence status", "security": [ { "bearerAuth": [] } ], "parameters": [ { "description": "The id of the sync sequence run", "in": "path", "name": "syncSequenceRunId", "required": true, "schema": { "type": "string" } } ] } } }, "servers": [ { "url": "https://api.hightouch.com/api/v1" } ] }