### Custom Alias Examples Source: https://docs.stacksync.com/agentic-workflows/triggers/email-trigger.md Examples of valid custom aliases that can be configured for a workflow. ```text order-intake@stacksync.email team.alerts@stacksync.email onboarding_requests@stacksync.email ``` -------------------------------- ### MongoDB Connection String Examples Source: https://docs.stacksync.com/connectors/mongodb.md Examples of SRV and Standard connection string formats for MongoDB. ```text mongodb+srv://myDatabaseUser:D1fficultP%40ssw0rd@cluster0.example.mongodb.net/?retryWrites=true&w=majority ``` ```text mongodb://myDatabaseUser:D1fficultP%40ssw0rd@mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&replicaSet=myRepl ``` -------------------------------- ### Verify Stacksync CLI Installation Source: https://docs.stacksync.com/developers/getting-started-with-stacksync-cli/quickstart.md Check that the CLI is correctly installed and accessible in your path. ```bash stacksync --version ``` -------------------------------- ### Install and Test Connectivity with Netcat Source: https://docs.stacksync.com/two-way-sync/connectors/setup-options/ssh-tunneling/accessing-private-azure-resource-via-a-jumpbox.md Installs netcat and verifies network reachability to the private database port. ```bash sudo apt install netcat -y ``` ```bash nc -zv 5432 ``` -------------------------------- ### SSH Key Format Example Source: https://docs.stacksync.com/connectors/setup-options/ssh-tunneling/accessing-a-private-gcp-database-via-a-jumpbox.md Example of the public key format used for SSH authentication. ```text ssh-rsa AAAAB3... hello@example.com ``` -------------------------------- ### Install Stacksync CLI on Windows Source: https://docs.stacksync.com/developers/getting-started-with-stacksync-cli/quickstart.md Run these PowerShell commands to download and configure the CLI binary. ```powershell $Version = (Invoke-RestMethod https://cli.stacksync.com/latest).Trim() $Url = "https://cli.stacksync.com/$Version/stacksync-windows-x64.zip" $Root = Join-Path $env:LOCALAPPDATA "stacksync" $Zip = Join-Path $env:TEMP "stacksync.zip" Invoke-WebRequest -Uri $Url -OutFile $Zip Expand-Archive -Path $Zip -DestinationPath $Root -Force $Bin = Join-Path $Root "stacksync" [Environment]::SetEnvironmentVariable( "Path", "$([Environment]::GetEnvironmentVariable('Path', 'User'));$Bin", "User" ) $env:Path = "$Bin;$env:Path" ``` -------------------------------- ### Initialize Single-Node Replica Set Source: https://docs.stacksync.com/connectors/mongodb.md Commands to start a MongoDB instance and initialize it as a replica set. ```bash mongod --port 27017 --dbpath /path/to/data --replSet rs0 --auth --keyFile /path/to/keyfile ``` ```bash echo "" > /path/to/keyfile ``` ```bash mongosh "mongodb://localhost:27017" ``` ```mongodb rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "localhost:27017" }] }) ``` -------------------------------- ### Install Stacksync CLI on macOS and Linux Source: https://docs.stacksync.com/developers/getting-started-with-stacksync-cli/quickstart.md Use the shell script to install the latest version of the CLI. ```bash curl -fsSL https://cli.stacksync.com/install.sh | sh ``` -------------------------------- ### GET /start-here/quick-start.md Source: https://docs.stacksync.com/connectors Performs a query against the documentation index to retrieve answers, excerpts, and sources based on a natural language question. ```APIDOC ## GET /start-here/quick-start.md ### Description Perform an HTTP GET request on the documentation index with the `ask` parameter, and the optional `goal` parameter to retrieve answers and relevant excerpts. ### Method GET ### Endpoint https://docs.stacksync.com/start-here/quick-start.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to tailor the answer. ### Response #### Success Response (200) - **answer** (string) - A direct answer to the question. - **excerpts** (array) - Relevant excerpts from the documentation. - **sources** (array) - Sources used to generate the answer. ``` -------------------------------- ### Payload and Reference Example Source: https://docs.stacksync.com/agentic-workflows/features/dynamic-data-referencing.md Example of an input payload and the corresponding reference syntax to access a nested field. ```json { "body": { "exampleBody": "value" } } ``` ```text {{ input.body.exampleBody }} ``` -------------------------------- ### Private Key Format Example Source: https://docs.stacksync.com/connectors/setup-options/ssh-tunneling/windows-server-2025-jumpbox.md The expected format for the client's private SSH key file. ```text -----BEGIN PRIVATE KEY----- ... ... -----END PRIVATE KEY----- ``` -------------------------------- ### Configure Dynamic Content Source: https://docs.stacksync.com/agentic-workflows/developers/module-schema-reference.md Setup for managed or custom content loading, including field-based dependencies. ```json { "content": { "type": ["managed"], "content_objects": [ { "id": "users" } ] } } ``` ```json { "content": { "type": ["managed"], "content_objects": [ { "id": "users_in_channel", "content_object_depends_on_fields": [ { "id": "channel" } ] } ] } } ``` ```json { "content_object_depends_on_fields": [ { "id": "channels.items" } ] } ``` -------------------------------- ### Verify Database Connectivity Source: https://docs.stacksync.com/connectors/setup-options/ssh-tunneling/accessing-a-private-gcp-database-via-a-jumpbox.md Commands to install telnet and test the network path to the private database instance. ```bash # Install telnet if not already installed sudo apt install telnet -y # Test the connection to your database telnet ``` -------------------------------- ### Add specific field types Source: https://docs.stacksync.com/api-proxy/salesforce.md Examples for creating Text and Picklist fields, which may require additional parameters like length or valueSet. ```url curl -X POST https://eu.api-proxy.stacksync.com/v1/object/add_custom_field/{object_name} \ -H "Authorization: Bearer *****" \ -H "Content-Type: application/json" \ -d '{"data": {"name": "field_name", "type": "Text", "label": "list_field", "length":100}}' ``` ```url curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name} \ -H "Authorization: Bearer ******" \ -H "Content-Type: application/json" \ -d '{ "data": { "name": "picklistField", "type": "Picklist", "label": "picklistField", "valueSet": { "restricted": false, "valueSetDefinition": { "sorted": false, "value": [ { "fullName": "Option1", "default": false }, { "fullName": "Option2", "default": false }, { "fullName": "Option3", "default": false } ] } } } }' ``` -------------------------------- ### Enable Auto-Security Updates Source: https://docs.stacksync.com/two-way-sync/connectors/setup-options/ssh-tunneling/accessing-private-azure-resource-via-a-jumpbox.md Installs and configures unattended-upgrades to keep the jumpbox secure. ```bash sudo apt install unattended-upgrades sudo dpkg-reconfigure --priority=low unattended-upgrades ``` -------------------------------- ### Example API Response Source: https://docs.stacksync.com/api-proxy/attio.md Sample JSON response structure returned by the Attio API proxy. ```json { "data": [ { "api_slug": "subscriptions", "created_at": "2024-07-27T16:08:23.773000000Z", "id": { "object_id": "fdfcc8f8-8c1e-4ad0-b20e-1b4930b8a1cb", "workspace_id": "0d9fb69e-fa23-46c7-8816-8fa0d32ee4e2" }, "plural_noun": "Subscriptions", "singular_noun": "Subscription" }, { "api_slug": "people", "created_at": "2024-07-22T17:54:44.560000000Z", "id": { "object_id": "5bef7430-3f17-40d7-b88c-02bcbcb658ca", "workspace_id": "25d9671a-b1f1-48d8-81a2-6a214e8b04bd" }, "plural_noun": "People", "singular_noun": "Person" } ] } ``` -------------------------------- ### GET /start-here/community.md Source: https://docs.stacksync.com/edi Performs a query against the documentation index to retrieve an answer based on a specific question and an optional end goal. ```APIDOC ## GET https://docs.stacksync.com/start-here/community.md ### Description Performs an HTTP GET request on the documentation index to retrieve a direct answer to a question, along with relevant excerpts and sources. ### Method GET ### Endpoint https://docs.stacksync.com/start-here/community.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question to ask, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to help tailor the answer. ### Response - The response contains a direct answer to the question and relevant excerpts and sources from the documentation. ``` -------------------------------- ### PostgreSQL Insert Query with Placeholders Source: https://docs.stacksync.com/two-way-sync/features/event-triggers/database-query.md Example demonstrating how to map record fields into a PostgreSQL INSERT statement using the <> placeholder. ```sql // Sample <> JSON { "name":"John", "address":{ "street":"123 Main Street", "postal_code": 650 } } // PostgreSQL query to insert name and the postal code INSERT INTO user_table (user_name, postal_code) VALUES ('<>.name', <>.address.postal_code); ``` -------------------------------- ### GET /what-is-stacksync.md Source: https://docs.stacksync.com/llms.txt Performs a query against the documentation index to receive a direct answer and relevant excerpts. ```APIDOC ## GET /what-is-stacksync.md ### Description Perform an HTTP GET request on the documentation index with the `ask` parameter, and the optional `goal` parameter to retrieve answers and relevant excerpts. ### Method GET ### Endpoint https://docs.stacksync.com/what-is-stacksync.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question to ask, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to tailor the answer. ``` -------------------------------- ### GET /start-here/community.md Source: https://docs.stacksync.com/guides/add-a-new-custom-field-to-an-existing-sync Performs a query against the documentation index to retrieve answers, excerpts, and sources based on a natural language question. ```APIDOC ## GET /start-here/community.md ### Description Perform an HTTP GET request on the documentation index with the `ask` parameter to retrieve a direct answer to a question along with relevant documentation excerpts. ### Method GET ### Endpoint https://docs.stacksync.com/start-here/community.md ### Parameters #### Query Parameters - **ask** (string) - Required - The specific, self-contained question written in natural language. - **goal** (string) - Optional - Describes the broader end goal to help tailor the response. ### Request Example GET https://docs.stacksync.com/start-here/community.md?ask=How+do+I+add+a+custom+field?&goal=sync+data ``` -------------------------------- ### API Response Example Source: https://docs.stacksync.com/two-way-sync/api-proxy/salesforce The expected JSON response structure after a successful update request. ```json { "data": [ { "errors": [], "id": "0010600002BpLWtAAN", "success": true }, { "errors": [], "id": "0010600002BpLWuAAN", "success": true } ] } ``` -------------------------------- ### Cascading Dropdowns Example Source: https://docs.stacksync.com/two-way-sync/developers/module-schema-reference.md Use load_schema to update dependent fields based on a selection. ```json { "id": "country", "type": "object", "label": "Country", "on_action": { "load_schema": true }, "choices": { "values": [ {"value": {"id": "us", "label": "United States"}, "label": "United States"}, {"value": {"id": "ca", "label": "Canada"}, "label": "Canada"} ] } }, { "id": "state", "type": "object", "label": "State/Province", "content": { "type": ["managed"], "content_objects": [ { "id": "states_by_country", "content_object_depends_on_fields": [ {"id": "country"} ] } ] } } ``` -------------------------------- ### Insert response body Source: https://docs.stacksync.com/api-proxy/salesforce.md Example JSON response body returned after an insert operation. ```json { "data": [ { "errors": [], "id": "0010600002BpRZDAA3", "success": true }, { "errors": [], "id": "0010600002BpRZEAA3", "success": true } ] } ``` -------------------------------- ### Upsert Response Format Source: https://docs.stacksync.com/api-proxy/salesforce.md Example JSON response structure returned by the upsert operation. ```json { "data": [ { "errors": [], "id": "0010600002BpLWtAAN", "success": true } ] } ``` -------------------------------- ### Retrieve Account Record via Proxy Source: https://docs.stacksync.com/api-proxy/salesforce.md Examples for fetching a specific Salesforce Account record using the proxy service. ```bash curl -X GET https://eu.api-proxy.stacksync.com/v1/proxy/https://MyDomainName.my.salesforce.com/services/data/v60.0/sobjects/Account/0017S00000GYoL3QAL \ -H "Authorization: Bearer your_api_proxy_service_token" ``` ```python import requests url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://MyDomainName.my.salesforce.com/services/data/v60.0/sobjects/Account/0017S00000GYoL3QAL" api_proxy_service_token = "your_api_proxy_service_token" headers = { 'Authorization': f'Bearer {api_proxy_service_token}' } response = requests.get(url, headers=headers) ``` ```javascript const url = `https://eu.api-proxy.stacksync.com/v1/proxy/https://MyDomainName.my.salesforce.com/services/data/v60.0/sobjects/Account/0017S00000GYoL3QAL`; const api_proxy_service_token = 'your_api_proxy_service_token'; const headers = { 'Authorization': `Bearer ${apiProxyServiceToken}` }; fetch(url, { method: 'GET', headers: headers }) .then(response => response.json()) .then(data => { console.log(data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### Retrieve Salesforce records via API Proxy Source: https://docs.stacksync.com/two-way-sync/api-proxy/salesforce Examples for fetching specific fields for a list of Salesforce object IDs. ```url curl -X POST https://eu.api-proxy.stacksync.com/v1/object/get/Account \ -H "Authorization: Bearer your_api_proxy_service_token" \ -H "Content-Type: application/json" \ -d '{"data": {"ids": ["0010600002BpLWuAAN", "0010600002BpLWtAAN"], "fields": ["Name"]}}' ``` ```python import requests object_name = 'Account' url = f"https://eu.api-proxy.stacksync.cloud/v1/object/get/{object_name}" data ={ "data": { "ids" : ["0010600002BpLWuAAN", "0010600002BpLWtAAN"], "fields" : ["Name"] } } api_proxy_service_token = "your_api_proxy_service_token" headers = { 'Authorization': f'Bearer {api_proxy_service_token}', 'Content-Type': 'application/json' } response = requests.post(url, json=data, headers=headers) ``` ```javascript const object_name = 'Account'; const url = `https://eu.api-proxy.stacksync.cloud/v1/object/get/${object_name}`; const data ={ data: { ids: ["0010600002BpLWuAAN", "0010600002BpLWtAAN"], fields: ["Name"] } }; const api_proxy_service_token = 'your_api_proxy_service_token'; const headers = { 'Authorization': `Bearer ${apiProxyServiceToken}`, 'Content-Type': 'application/json' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => { console.log(data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### Add a custom field via API Source: https://docs.stacksync.com/api-proxy/salesforce.md Use these examples to create a custom field by sending a POST request to the add_custom_field endpoint. ```url curl -X POST https://eu.api-proxy.stacksync.com/v1/object/add_custom_field/{object_name} \ -H "Authorization: Bearer your_api_proxy_service_token" \ -H "Content-Type: application/json" \ -d '{"data": {"name": "field_name", "type": "field_type", "label": "field_label"}}' ``` ```python import requests headers = { 'Authorization': 'Bearer your_api_proxy_service_token', 'Content-Type': 'application/json', } json_data = { 'data': { 'name': 'field_name', 'type': 'field_type', 'label': 'field_label' }, } response = requests.post( 'https://eu.api-proxy.stacksync.com/v1/object/add_custom_field/{object_name}', headers=headers, json=json_data, ) ``` ```javascript fetch('https://eu.api-proxy.stacksync.com/v1/object/add_custom_field/{object_name}' method: 'POST', headers: { 'Authorization': 'Bearer your_api_proxy_service_token', 'Content-Type': 'application/json' }, // body: '{"data": {"field_name": "field_name", "field_type": "field_type"}}', body: JSON.stringify({ 'data': { 'field_name': 'field_name', 'field_type': 'field_type' } }) }); ``` -------------------------------- ### Example itemList JSON Structure Source: https://docs.stacksync.com/two-way-sync/connectors/netsuite/transaction-line-items.md Represents the format of the itemList field containing nested transaction line items within a single record. ```json [ { "item": { "internalId": "38704" }, "quantity": 2, "rate": 10.0, "line": 1 }, { "item": { "internalId": "38705" }, "quantity": 1, "rate": 25.0, "line": 2 } ] ``` -------------------------------- ### Update Salesforce records via API Proxy Source: https://docs.stacksync.com/two-way-sync/api-proxy/salesforce Examples for performing batch updates on Salesforce objects using different programming environments. ```url curl -X POST https://eu.api-proxy.stacksync.com/v1/object/update/Account \ -H "Authorization: Bearer your_api_proxy_service_token" \ -H "Content-Type: application/json" \ -d '{"data":[{"id": "0010600002BpLWtAAN", "name": "John Doe"}, {"id": "0010600002BpLWuAAN", "name": "Jane Smith"}]}' ``` ```python import requests object_name = 'Account' url = f"https://eu.api-proxy.stacksync.cloud/v1/object/update/{object_name}" data ={ "data": [ { 'id': '0010600002BpLWtAAN', 'name': 'John Doe', 'site': 'www.example.com' }, { 'id': '0010600002BpLWuAAN', 'name': 'Jane Smith', 'site': 'www.example.com' } ] } api_proxy_service_token = "your_api_proxy_service_token" headers = { 'Authorization': f'Bearer {api_proxy_service_token}', 'Content-Type': 'application/json' } response = requests.post(url, json=data, headers=headers) ``` ```javascript const objectName = 'Account'; const url = `https://eu.api-proxy.stacksync.cloud/v1/object/update/${objectName}`; const data ={ data: [ { id: '0010600002BpLWtAAN', name: 'John Doe', site: 'www.example.com' }, { id: '0010600002BpLWuAAN', name: 'Jane Smith', site: 'www.example.com' } ] }; const apiProxyServiceToken = 'your_api_proxy_service_token'; const headers = { 'Authorization': `Bearer ${apiProxyServiceToken}`, 'Content-Type': 'application/json' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => { console.log(data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### Upsert Salesforce Object via API Proxy Source: https://docs.stacksync.com/two-way-sync/api-proxy/salesforce Examples for performing an upsert operation on a Salesforce Account object using different programming environments. ```url curl -X POST https://eu.api-proxy.stacksync.com/v1/object/upsert/Account \ -H "Authorization: Bearer your_api_proxy_service_token" \ -H "Content-Type: application/json" \ -d '{"data":[{"name":"Jon Doe"}],"match_key":"name"}' ``` ```python import requests object_name = 'Account' url = f"https://eu.api-proxy.stacksync.cloud/v1/object/upsert/{object_name}" data = { "data": [ { "name": "Jon Doe", "site": "example.com" } ], "match_key": "name" } api_proxy_service_token = "your_api_proxy_service_token" headers = { 'Authorization': f'Bearer {api_proxy_service_token}', 'Content-Type': 'application/json' } response = requests.post(url, json=data, headers=headers) ``` ```javascript const object_name = 'Account'; const url = `https://eu.api-proxy.stacksync.cloud/v1/object/upsert/${object_name}`; const data ={ data: [ { name: 'Jon Doe', "site": "example.com" } ], match_key: "name" }; const api_proxy_service_token = 'your_api_proxy_service_token'; const headers = { 'Authorization': `Bearer ${apiProxyServiceToken}`, 'Content-Type': 'application/json' }; fetch(url, { method: 'POST', headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(data => { console.log(data); }) .catch(error => { console.error(error); }); ``` -------------------------------- ### Create a Workflow Connector project Source: https://docs.stacksync.com/developers/getting-started-with-stacksync-cli/build-your-first-workflow-connector.md Initializes a new connector project directory. ```bash stacksync workflow-connector create "My App" ``` -------------------------------- ### Example Response Body Source: https://docs.stacksync.com/api-proxy/hubspot.md The structure of the JSON response returned by the get records endpoint. ```json { "data": [ { "archived": false, "createdAt": "2024-01-31T13:17:43.128Z", "id": "227400", "properties": { "createdate": "2024-01-31T13:17:43.128Z", "firstname": null, "hs_object_id": "227400", "lastmodifieddate": "2024-02-02T15:05:54.183Z" }, "updatedAt": "2024-02-02T15:05:54.183Z" }, { "archived": false, "createdAt": "2024-01-31T13:17:43.128Z", "id": "227386", "properties": { "createdate": "2024-01-31T13:17:43.128Z", "firstname": null, "hs_object_id": "227386", "lastmodifieddate": "2024-01-31T13:28:37.746Z" }, "updatedAt": "2024-01-31T13:28:37.746Z" } ] } ``` -------------------------------- ### Get Attio Objects Source: https://docs.stacksync.com/api-proxy/attio.md Examples for retrieving Attio objects using the Pass Through endpoint. ```curl curl -X GET https://eu.api-proxy.stacksync.com/v1/proxy/https://api.attio.com/v2/objects \ -H "Authorization: Bearer your_api_proxy_service_token" ``` ```python import requests url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.attio.com/v2/objects" headers = { "Authorization": "Bearer your_api_proxy_service_token", } response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.attio.com/v2/objects"; fetch(url, { method: "GET", headers: { Authorization: "Bearer your_api_proxy_service_token", }, }) .then((r) => r.json()) .then((json) => console.log(json)) .catch((e) => console.error(e)); ``` -------------------------------- ### Get HubSpot Object Schema Source: https://docs.stacksync.com/api-proxy/hubspot.md Examples for retrieving property definitions for a specific HubSpot object. ```bash curl -X GET https://eu.api-proxy.stacksync.com/v1/proxy/https://api.hubapi.com/crm/v3/properties/ \ -H "Authorization: Bearer your_api_proxy_service_token" \ ``` ```python import requests # Parameters url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.hubapi.com/crm/v3/properties/" headers = { "Authorization": "Bearer your_api_proxy_service_token" } # Send GET request response = requests.get(url, headers=headers) ``` ```javascript // Parameters const url = "https://eu.api-proxy.stacksync.com/v1/proxy/https://api.hubapi.com/crm/v3/properties/"; const headers = { "Authorization": "Bearer your_api_proxy_service_token" }; // Send GET request fetch(url, { method: 'GET', headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Navigate to the project directory Source: https://docs.stacksync.com/developers/getting-started-with-stacksync-cli/build-your-first-workflow-connector.md Changes the current working directory to the newly created project folder. ```bash cd workflows-app-my-app ``` -------------------------------- ### Labeled Association Field Example Source: https://docs.stacksync.com/connectors/hubspot/associations/associations-cdc-boost.md Example property label for a primary association between contacts and tickets. ```text sync_associations_contacts_tickets_label_primary ``` -------------------------------- ### Unlabeled Association Field Example Source: https://docs.stacksync.com/connectors/hubspot/associations/associations-cdc-boost.md Example property label for an unlabeled association between contacts and tickets. ```text sync_associations_contacts_tickets_label_none ```