Passthrough Schemas

Passthrough schemas allow you to pull in and push out custom objects that you don't have defined yet in your session. For example, you might want to sync custom objects in CRMs.

To enable passthrough schemas, simply specify passthrough_schemas: true when initiating a session (POST api/session/initiate).

You must also specify schema_selection: true, since your user will have to choose which custom objects to pass-through.

To get the data format of the passthrough schemas, you may either:

  1. Poll the GET api/session/configuration endpoint, which will successfully return once the user finishes configuring the session, or
  2. Setup the configuration_webhook when initiating a session (POST api/session/initiate).

In either case, the configuration data will be returned in the following format:

{
  "success": true,
  "session_id": "6566e85e7cf20dca9cef0c0a",
  "endgrate": {
    "provider": "hubspot",
    "provider_info": {
      "name": "hubspot",
      "display_name": "HubSpot",
      "url": "https://www.hubspot.com/",
      "image": "https://endgrate.nyc3.cdn.digitaloceanspaces.com/integration/hubspot.png",
      "auth_type": "oauth",
      "specific": {},
      "endgrate_provider_type": "CRM"
    }
  },
  "schemas": {
    "contact": {
      "integration_info": {
        "name": "get-contacts",
        "display_name": "Get Contacts",
        "method": "IMPORT"
      },
      "integration": "get-contacts",
      "schema": {
        "type": "object",
        "associations": true,
        "endgrate_type": "crm-contact",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "age": {
            "type": "number"
          },
          "is_employed": {
            "type": "boolean"
          },
          "lifecyclestage": {
            "title": "Lifecycle Stage",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "crm-contact",
        "session_method": "IMPORT"
      },
      "passthrough_fields": {
        "properties": {
          "lifecyclestage": {
            "title": "Lifecycle Stage",
            "type": "string"
          },
          "required": []
        }
      }
    }
  },
  "passthrough_schemas": {
    "custom": {
      "integration_info": {
        "name": "get-custom-objects",
        "display_name": "Get Custom Objects",
        "method": "IMPORT"
      },
      "integration": "get-custom-objects",
      "schema": {
        "type": "object",
        "associations": true,
        "endgrate_type": "Custom",
        "properties": null,
        "required": [],
        "title": "custom",
        "session_method": "IMPORT"
      },
      "passthrough_fields": {
        "customfield1": {
          "type": "string"
        },
        "required": [
          "customfield1"
        ]
      }
    }
  }
}

The passthrough_schemas attribute is an object that contains the passthrough schemas for the session, keyed by endgrate_type. The endgrate_types will be the name of the custom object. All fields in the passthrough schema are passthrough fields, and their format is specified in the passthrough_fields attribute.