
Outgoing Integration lets you integrate Synerise with any external service. Thanks to the possibility of building HTTP requests and supplementing them with customer attributes or data calculated by Decision Hub, you can synchronize data by sending them out of Synerise. You can create a [reusable](#creating-reusable-integration) and [single-use](#creating-single-use-integration) integrations to be used in the [workflows](/docs/automation/creating-automation).  


## Creating single-use integration

If you only need to configure a webhook to integrate with an external source for a specific workflow, we recommend creating an integration that only exists in that workflow by [using the **Outgoing Integration node**](/docs/automation/actions/webhook-node).


## Creating reusable integration

To create a reusable webhook which can be used in the [Outgoing Integration node](/docs/automation/actions/webhook-node), perform the instructions described in this section.

### Deciding the approach

- **Use schema builder to create a schema template** - Schema builder lets you create a form which you can use further in the [Outgoing Integration node](/docs/automation/actions/webhook-node). This way, you will configure the node by filling out the form with values which you want to send to the external source eliminating the need to repeatedly define the HTTP method, endpoint, authorization, and request body. Additionally, you can populate fields with variables sourced from the profile/event context, as well as utilize Jinjava for retrieving aggregate or expression results. 
    - To create the form, follow the instructions available in the [Schema builder documentation](/docs/assets/schema-builder/creating-schemas). 
    - For a detailed guide on managing parameters with schemas, refer to the [Managing parameters with schema](/developers/inserts/automation#managing-parameters-with-schemas) section.  


    <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/node-vs-builder.png" class="large" alt="Diagram"><figcaption>Schema template in the Outgoing Integration node </figcaption></figure>

- **Send a custom request body** - You can skip creating a schema template and go straight to creating the outgoing integration that sends a request to a defined endpoint with the same request body which you will define in the ["Enter request body"](#enter-the-request-body) section in this document. The request can contain variables sourced from the profile/event context as well as Jinjava inserts to retrieve analyses results. If you use such integration in the [Outgoing Integration node](/docs/automation/actions/webhook-node), the node won't require further configuration.


### Creating the integration

#### Define the connection
---
In this part of the process, you define the authentication method and providing the information required to establish a connection.

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/empty-custom-block.png" alt="Outgoing Integration creation page" class="full"><figcaption>Outgoing Integration creation page</figcaption></figure>  

1. Go to <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/automation-hub-icon.svg" alt="Automation Hub icon" class="icon"> **Automation Hub > Outgoing**.
2. In the upper-right corner of the screen, click **New integration**.  
1. In the upper-left corner of the screen, enter a name for the integration.
3. In the **Choose connection**, click **Define**.  
4. Once the section is expanded, select the authentication method: 
- **No authentication** - No authentication is required.
- **Login & Password** - This method lets you use basic authentication to authenticate with the remote server.

  <details class="accordion"><summary>Click here to see the instructions</summary><div class="accordion-content"><ol> <li>Click <strong>Select connection</strong>.</li> <li>In the connection list:<ul> <li>If the connection you want to use is in the list, select it and proceed to <a href="#define-the-endpoint">Defining endpoint</a>.</li> <li>If the connection list is empty or you don&#39;t see a connection, you must:<ol> <li>At the bottom of the dropdown list, click <strong>Add connection</strong>. </li> <li>In the <strong>Connection name</strong> field, enter the name of your connection (it&#39;s visible only on the <strong>Select connection</strong> dropdown list).</li> <li>In the <strong>Login</strong> field, enter a login.</li> <li>In the <strong>Password</strong> field, enter the password.</li> <li>Click <strong>Create</strong>.<br> The connection you created is saved and can be used later in other nodes and workflows.</li> </ol> </li> </ul> </li> </ol></div></details>

- **Custom connection** - This method sends an authentication token request before executing the main request defined in the Outgoing integration node settings. The token is fetched when the request data is uncached, then cached according to its TTL, and added to the target request.   

  <details class="accordion"><summary>Click here to see the instructions</summary><div class="accordion-content"><ol> <li>Click <strong>Select connection</strong>.</li> <li>In the connection list:<ul> <li>If the connection you want to use is in the list, select it and proceed to Defining the request section in this article.</li> <li>If the connection list is empty or you don&#39;t see a connection, you must:<ol> <li><p>At the bottom of the dropdown list, click <strong>Add connection</strong>. </p> </li> <li><p>In the <strong>Authorization request</strong> tab, click <strong>Define</strong>.<br> <strong>Result</strong>: </p> <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/custom-connection-request-empty.png" class="large" alt="The Request section in the configuration of a custom connection"><figcaption>The Request section in the configuration of a custom connection</figcaption></figure></li> <li><p>In the <strong>Connection name</strong> field, enter the name of your connection (it&#39;s visible only on the <strong>Select connection</strong> dropdown list or on the list of connections in <strong>Settings &gt; Connections</strong>).</p> </li> <li><p>In <strong>Secret</strong>, enter a value which is required in the request to obtain a token. This value will be anonymized and displayed as asterisks. </p> </li> <li><p>In the <strong>Headers</strong> section, add request headers (in the left field, enter the key; in the right, enter its value).</p> </li> <li><p>In the <strong>Body</strong> field, enter the request body.<br> For example: </p> <pre><code class="language-json">{ "api-key": "{{secret}}" }</code></pre> <p> where <code>{{secret}}</code> retrieves the value of the <strong>Secret</strong> field to anonymize the token. </p> </li> <li><p>Confirm the settings in the <strong>Authorization request</strong> tab by clicking <strong>Apply</strong>. </p> </li> <li><p>In the <strong>Token placement settings</strong> section, click <strong>Define</strong>. </p> </li> <li><p>Click <strong>Retrieve response</strong>.<br> <strong>Result</strong>: </p> <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/custom-connection-response.png" class="large" alt="Retrieved token in the Response section in the custom connection configuration form"><figcaption>Retrieved token in the Response section in the custom connection configuration form</figcaption></figure></li> <li><p>If you:</p> </li> </ol> <ul> <li><p>specify the value in the <strong>Headers</strong> section, the extracted authorization data from the response will be added as a header to the target request. </p> </li> <li><p>provide the value in the <strong>URL Parameters</strong> section, the data will be appended to the target request’s URL as a parameter.<br> You can use the following values to retrieve values from the response: </p> <ul> <li><p><code>authResponseBody</code> - a variable that contains the full body of an authentication response</p> </li> <li><p><code>authResponseStatusCode</code> - a variable that contains the status code of an authentication response</p> </li> <li><p><code>authResponseHeaders</code>- a variable that contains the headers of an authentication response<br> For example: </p> <pre><code class="language-jinjava">Bearer {{ authResponseBody | fromjson | attr("token") }}</code></pre></li> </ul> <p> It takes the <code>JSON</code> response body stored in <code>authResponseBody</code>, parses it into a usable structure, and extracts the value of the <code>token</code> field. Outputs a string like: <code>Bearer &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&quot;</code></p> </li> </ul> <ol start="10"> <li>In <strong>TTL</strong> field, specify the how long the cached response from the external request will be valid.<br>If you leave this field empty, it&#39;s 60 seconds.</li> <li>Confirm by clicking <strong>Apply</strong>.</li> </ol> </li> </ul> </li> </ol></div></details>

- **Synerise API key** - This method is particularly recommended for the users who use Synerise REST API. It lets you select a connection that includes an [API key](/docs/settings/tool/api) with the required permissions. This way, the requests to Synerise API are executed by this integration and a JWT is not required as it is generated while sending requests and attached to the request headers.

  <details class="accordion"><summary>Click here to see the instructions</summary><div class="accordion-content"><ol> <li>Click <strong>Select connection</strong>.</li> <li>If the connection you want to use is in the list, select it and proceed to <a href="#define-the-endpoint">Defining endpoint</a>.<ul> <li>If the connection list is empty or you don&#39;t see a connection, you must:<ol> <li>At the bottom of the dropdown list, click <strong>Add connection</strong>. </li> <li>In the <strong>Connection name</strong> field, enter the name of your connection (it&#39;s visible only on the <strong>Select connection</strong> dropdown list).</li> <li>From <strong>API Key</strong> dropdown, select API key you want to use. If you don&#39;t see any API Keys on the list, verify if you are assigned with a user role that includes permissions to preview API keys.</li> <li>Click <strong>Create</strong>.<br> The connection you created can be used later in other nodes and workflows.</li> </ol> </li> </ul> </li> </ol></div></details>

- **OAuth2 Client Credentials** - This method lets you use your OAuth2 credentials to authorize.

  <details class="accordion"><summary>Click here to see the instructions</summary><div class="accordion-content"><ol> <li>Click <strong>Select connection</strong>.</li> <li>In the connection list:<ul> <li>If the connection you want to use is in the list, select it and proceed to <a href="#define-the-endpoint">Defining endpoint</a>.</li> <li>If the connection list is empty or you don&#39;t see a connection, you must:<ol> <li>At the bottom of the dropdown list, click <strong>Add connection</strong>. </li> <li>In the <strong>Connection name</strong> field, enter the name of your connection (it&#39;s visible only on the <strong>Select connection</strong> dropdown list).</li> <li>In the <strong>Token endpoint URL</strong> field, enter the URL used to obtain an access token from the authorization server.</li> <li>In the <strong>Client ID</strong> field, enter a unique identifier assigned to your application by the service provider.</li> <li>In the <strong>Client secret</strong> field, enter a confidential key issued alongside the Client ID. It is used to securely authenticate your application.</li> <li>Optionally, in the <strong>Scope</strong> field, define the level of access your application is requesting. Scopes specify which actions or data your application can access (for example, read user data, send messages). Refer to the API documentation for the correct scope values.</li> <li>Click <strong>Create</strong>.<br> The connection you created is saved and can be used later in other nodes and workflows.</li> </ol> </li> </ul> </li> </ol></div></details>

- **API Key** - This method lets you authenticate using an API secret by including it in a header of your choice or in a URL parameter — example outputs:
    - the authorization header: `Authorization: Bearer [secret]`
    - URL parameter: `client_id=[rendered secret]`.    
    When you use this connection in the Outgoing Integration node, the token will be automatically added to either the request header or the request URL with every request.  

    
      <details class="accordion"><summary>Click here to see the instructions</summary><div class="accordion-content"><ol> <li>Click <strong>Select connection</strong>.</li> <li>If the connection you want to use is in the list, select it and proceed to Defining the request section in this article.<ul> <li>If the connection list is empty or you don&#39;t see a connection, you must:<ol> <li>At the bottom of the dropdown list, click <strong>Add connection</strong>. </li> <li>In the <strong>Connection name</strong> field, enter the name of your connection (it&#39;s visible only on the <strong>Select connection</strong> dropdown list).</li> <li>In the <strong>Secret</strong> field, enter an API Key.</li> <li>If you:<ul> <li>specify the value in the <strong>Headers</strong> section, the API key will be added as a header to the request. For example, <code>x-api-key: {{secret}}</code> where <code>{{secret}}</code> retrieves the value of the Secret field to anonymize the API key value.</li> <li>provide the value in the <strong>URL Parameters</strong> section, the API key will be appended to the request’s URL as a parameter.</li> </ul> </li> <li>Click <strong>Create</strong>.<br> The connection you created can be used later in other nodes and workflows.</li> </ol> </li> </ul> </li> </ol></div></details>
  
- **SHA256-based authentication** - *This method is recommended exclusively for connecting with Eagle Eye*. This method lets you authenticate using SHA256 algorithm. When a target request is sent, the following headers are added to the request:  
    - **X-EES-AUTH-CLIENT-ID** – the value is taken from the Client ID field.
    - **X-EES-AUTH-HASH** – the value is generated by concatenating the endpoint URI, request body, and client secret, then hashing the result using SHA256.  

    
      <details class="accordion"><summary>Click here to see the instructions</summary><div class="accordion-content"><ol> <li>Click <strong>Select connection</strong>.</li> <li>In the connection list:<ul> <li>If the connection you want to use is in the list, select it and proceed to <a href="#define-the-endpoint">Defining the endpoint</a> section in this article.</li> <li>If the connection list is empty or you don&#39;t see a connection, you must:<ol> <li>In the <strong>Connection name</strong> field, enter the name of the connection.<br> It&#39;s used to find the connection on the list.</li> <li>In <strong>Client ID</strong>, enter a unique identifier assigned to your application by the service provider.</li> <li>In <strong>Client secret</strong>, enter client secret assigned to your application by the service provider. </li> <li>Confirm by clicking <strong>Create</strong>.</li> </ol> </li> </ul> </li> </ol></div></details>


#### Define the endpoint
--- 
In this part of the process, select the HTTP method and define the endpoint to which you will send a request from Synerise. Additionally, you can define the name of the event which will contain the request response when the **Outgoing Integration** node is triggered.

4. In the **Destination endpoint** section, click **Define**.  
    <figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/outgoing-integration-define.png" alt="The Defining endpoint section in the process of creating an outgoing integration" class="full"><figcaption>The Defining endpoint section in the process of creating an outgoing integration</figcaption></figure>  


   <div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   All fields that contain <img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/icons/snippet-icon.png" alt="Snippet icon" class="icon" > accept [snippets](/docs/assets/snippets) or [inserts](/developers/inserts). If you use this integration in a [business workflow](/docs/glossary#business-workflow), profile-related inserts cannot be used.

   </div></div></div>


5. From the **URL** drop-down list, select an HTTP method.
6. In the **URI address** field, enter the endpoint.  
   The URI can contain inserts.  
    
   <div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   This field doesn't allow the endpoints defined as IPs (for example, `51.145.180.18`). You can only use endpoints that contain a domain (for example, `https://example.com`)

   </div></div></div>

4. **Optional:** Upload an icon for the node.
5. In the **Webhook name** field, enter the value that will be displayed in the `name` parameter of the event which will contain the request response.
2. **Optional, recommended:** In the **Event name** field, choose an action name for the [event that contains the request response](/docs/assets/events/event-reference/integration#webhookresponse-and-custom-webhook-response-names) from your selected endpoint. We recommend using a meaningful name instead of the default one.
    - from the dropdown list, you can select the name of the event (event action) that will be generated when a request from this node will be executed. 
    - at the bottom of the dropdown list, you can create a new event using the **Create new event** option.  
        **Result**: A pop-up appears. Fill out the configuration form on the pop-up, according to instructions in step 3 in the [Adding event definitions - in the Web application](/docs/assets/events/event-definitions#in-the-web-application) section.
    - If you leave the field blank, the action defaults to `webhook.response`.
7. Click **Apply**.


#### Select the schema template
---
This part of the process is optional. If you took the **Use schema builder to create a schema template** approach described in [Creating reusable integration](#creating-reusable-integration), in this part of the process, you will select the schema template you created.

<figure>
<img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/outgoing-integration-parameters.png" alt="Selecting a schema in the process of creating an outgoing integration" class="full">
<figcaption>Selecting a schema in the process of creating an outgoing integration</figcaption>
</figure>

2. In the **Configuration schema** section, click **Define**.
3. From the **Schema template** drop-down list, select a schema you created before.
4. Click **Apply**.  

#### Enter the request body
---
In this part of the process, enter a body that contains all parameters and their values which you will send in a request.

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/outgoing-integration-payload.png" alt="Sending out an example request to the endpoint defined in the outgoing integration process" class="full"><figcaption>Sending out an example request to the endpoint defined in the outgoing integration process</figcaption></figure>

5. In the **Webhook payload** section, click **Define**.
6. In the **Payload** text box, enter the JSON payload schema.  
    This JSON schema can include inserts. By filling out fields with dynamic data using Jinjava as described in the [Managing parameters with schemas](/developers/inserts/automation#managing-parameters-with-schemas) section, the request body will be as follows:

    
   <div class="content-tabs" data-tab-group="tabgrp-1290">
   <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1290-0" data-tab-group="tabgrp-1290" data-tab-active="true">Input</button><button class="tab-button" data-tab-id="tabgrp-1290-1" data-tab-group="tabgrp-1290">Output</button></div>

   <div class="tab-panel" data-tab-id="tabgrp-1290-0" data-tab-group="tabgrp-1290" data-tab-active="true">

   <pre><code class="language-json">{
       "field1": "{% context field1 %}",
       "field2": "{% context field2 %}"
   }</code></pre>

   </div>

   <div class="tab-panel" data-tab-id="tabgrp-1290-1" data-tab-group="tabgrp-1290">

   <pre><code class="language-json">{
       "field1": "Value1",
       "field2": "Value2"
   }</code></pre>

   </div>
   </div>
  

14. In the **Headers** sub section, add headers in the following way:
    1. In the **Key** field, enter the header name.
    2. In the **Value** field, enter the header value.  
    The key and value can contain inserts.
    1. If you want to add more headers, click **Add header**.

15. Click **Apply**.

### Custom response event parameters
You can add up to 10 custom parameters in each event that is generated from the response to the request that was sent. This solution allows for even more precise identification of response events, the creation of more detailed analyses and reports, and more accurate error handling.  

<figure><img src="/api/docs/image/54176ad07f146575310749eba44b7c2f42c1b327/docs/automation/_gfx/additional-parameters.png" class="full" alt="The Additional parameters section"><figcaption>The Additional parameters section</figcaption></figure>

1. To define the custom event parameters, in the **Additional parameters** section, click **Define**.  
2. Click **Add parameter**.  
3. In the **Parameter** field, enter the name of the parameter.  
    - The name must not contain special characters or exceed 128 characters
    - The following parameters cannot be sent:
      - `eventUUID`
      - `status`
      - `statusDescription`
      - `uuid`
      - `clientId`
      - `diagramId`
      - `diagramName`
      - `blockId`
      - `blockName`
      - `req`
      - `name`
      - `body`

4. In the **Value** field, enter the parameter value.  
    - The value is always sent as a string when the event's JSON payload is generated. The maximum length of the value is 230 characters.
    - You can use dynamic values in the **Value** field.  

5. If you want to add more parameters, click **Add parameter**, and repeat steps 3-4.

### Saving the integration

In the upper-right corner:

- to save the outgoing integration as a draft, click **Save**.
- to save and make the outgoing integration available for use in workflows, click **Save & publish**.  
