Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Functions
Start here if you're adding integrations to your AI, Agent or Copilot.
Quickstart for AI
Step-by-step guide to execute app functions from your AI application
Flows
Start here if you want to build workflow-style integrations for your users.
Integry is an Integration Platform as a Service (iPaaS) that allows you to add an integration marketplace to your product in minutes.
You build flows between your app and up to 250+ other apps. Your users get a fully native integration experience within your product. Their data moves seamlessly between their apps.
Integry Flows comes with:
Ready-to-use authentication, triggers, queries and actions of 270+ apps
An intuitive, powerful, low-code flow builder that you will use to build one-way, or two-way, flows between your app and other apps
A customizable marketplace UI that you will embed in your app (using an SDK) where your users will discover, setup and manage their integrations
Detailed logs of integration runs with customizable error notifications enabling you to proactively support your users
User-level reporting and adoption notifications to effectively drive usage and ROI
A robust, scalable, secure backend with SOC 2, GDPR and CCPA compliance
We are in the process of migrating Flows help docs. For now, please go here.
In this guide, we will use the and to enable users to connect apps and invoke functions in those apps from your AI application.
Before you proceed, please for a free trial (if you haven't).
Follow the steps .
Your users have to first connect an app before you can invoke functions in that app. You could use or more of the following options.
Call the method to easily show all (or some) available apps as a marketplace. Users will simply click an app to connect.
Let's say your user says they want to "send a message saying hello! to the random channel on slack".
In order to execute the slack-post-message
function, you have to first predict that its the most relevant function.
Sample Response:
The response will be empty if Integry is unable to predict the function. You can ask the user to improve the prompt
and try again.
In order to invoke a function, you have to first prepare the arguments based on the parameters that the function requires.
Parameter vs Argument: A function parameter is the placeholder name of the type of input the function expects. The actual value passed is called the argument.
Sample Response for Prediction with Populated Arguments:
The response is the same as above.
If you use predict the arguments with Integry AI, we handle this for you.
This will open the Function UI (with the pre-filled arguments) in a modal.
This method returns a result
object with the filled-in arguments that you can use to invoke the function.
Functions that mutate data can potentially do irreversible damage. Even if you have predicted the arguments, consider always showing the Function UI to the user (with the predicted arguments) so they can confirm before you execute.
The result
object will have the response from the app if the function was executed (or error details if it wasn't).
In this case, you should see the following success response from Slack in the console:
That's it! You have enabled your users to connect apps and execute functions in those apps from your AI application using Integry Functions.
Try fetching data using a function like pipedrive-get-all-persons
. It supports paginated calls so the the result will include a next_page
cursor that you will include in the arguments in the next invocation.
Build your own apps marketplace and call the method when they click on an app.
Call method (when they try to use a function of an app) to check if the app is connected. If not, ask them to .
You can simply pass the prompt to Integry and , or (by listing all available functions).
Call the API endpoint with predict_function=true&prompt=<user_message>
to get the most relevant function. You can also have Integry .
Retrieve a list of available functions using the endpoint and pass them to your AI model. Your model will predict the function to use.
If you need to call an endpoint that is not supported by Integry, you can make a .
Similar to predicting the function, you can simply pass the prompt to Integry and , or (using the function spec).
Call the API endpoint with predict_function=true&predict_arguments=true&prompt=<user_message>
to get the most relevant function with populated arguments.
Alternatively, if you predicted the function yourself and want Integry to predict the arguments, call the API endpoint with predict_arguments=true&prompt=<user_message>
to get the function with populated arguments.
Call the endpoint to get the function spec and pass it to your AI model. Your model will predict and populate the arguments.
You may need to make additional calls to to fetch options. Once you have the related data from the source function, use your model to pick the most relevant value from the set.
Before you invoke the function, if you want the user to confirm the predicted arguments, or provide one (or more) required arguments that could not be predicted, you can call method to show the Function UI to the user (with pre-filled arguments, if any).
Call with the <function_name>
and arguments
object to execute the function.
Source functions return object arrays that can be used to dynamically populate dropdown options, or fetch custom fields.
Functions like slack-post-message
require the user to provide an ID value for the channel
parameter. Source functions help populate such arguments.
For example, when you show the Function UI to the user so they can select a channel
, we call the source function slack-list-conversations
(using the user's auth credentials) to populate the channel
dynamic dropdown.
In fact, when you predict the arguments with Integry AI, we call the same source function to get the list of channels so we can predict the most relevant option.
When you get a function, the description of a field will mention if there is a source function available to list the options for that field.
Sample response for GET /functions/slack-post-message
:
Apps like Hubspot let the user completely customize objects to represent their business. Hence, functions like hubspot-create-contact
don't have any typical standard parameters like email, name, etc. Instead, it requires an object parameter called properties
in which all the fields of the contact to be created have to be passed. Source functions help populate such arguments.
When you show the Function UI to the user so they can fill the Contact object fields, we call the source function hubspot-list-properties
(with objectType
: Contact) to fetch all the custom fields for the Contact object.
Similarly, when you predict the arguments with Integry AI, we call the same source function to get the list of fields so we can predict the most relevant values for the fields.
When you get a function, the description of an object field will mention if there is a source function available to list the fields for that object.
Sample response for GET /functions/hubspot-create-contact
:
You can call a source function like any other function via the API or SDK.
In fact, they can typically be called headlessly because they usually don't have any required parameters. You should cache the data to avoid repeated calls.
Good candidates to cache are channel list, user list, issue types, project names, etc. Ultimately, it depends on your use-case, but you can also implement a generic solution for supporting function data.
You cannot list all source functions, per se, because they are context-dependent. Instead, you can list all query type functions with GET /functions?type=query
.
See /functions
for more options.
The Integry API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded and form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
The Integry API requires an App-Key
, User-ID
and a hash of App-Secret
and User-ID
in the request headers to authenticate requests.
You can view and copy your App-Key
and App-Secret
from the Integry app.
User-ID
is a unique string identifier for a user in your app. Function Calls and Integrations are associated to a user ID.
If your app has workspaces/accounts and you want integrations to be shared across all users in a workspace/account, use the workspace/account ID as the user ID.
Calculate the hash server-side using HMAC SHA256.
Pass the App-Key
, computed hash and User-ID
in the headers of the API call.
GET
/apps
List all apps available in Integry. If you need more, please reach out!
Response
GET
/apps/<app_name>
Get the details of an individual app by passing <app_name>
as a path variable.
Response
GET
/functions
List all functions available in Integry. If you need more, make a passthrough request or reach out!
GET
/functions/<function_name>
Get the JSON schema of an individual function by passing function name as a path variable.
All supported function parameters
are returned as keys, along with their type
and description
as key, value pairs. Required parameters are listed in the required
array.
Sample response for pipedrive-add-a-person
get function call:
POST
/functions/<function_name>/
Call a function by passing <function_name>
as a path variable and the function parameters in the request body. Integry will automatically add the user's authentication credentials (eg. access token, API key) to the call.
Integry will execute the function if the user has already connected their account for the function app, and all required parameters (if any) are provided in the body. These function calls will show in the Function Calls log in the Integry app.
Integry will not execute the function if the user has not connected an account, or the parameters passed are invalid. These function calls will not show in the Function Calls log.
Pass the function parameters in the request body.
Sample body for pipedrive-add-a-person
function call:
Sample body for pipedrive-get-all-persons
function call with next_page
:
If Integry executes the function, it will respond with a 200 OK
with following keys in the response body:
network_code
: HTTP response status code of the onwards API call made by Integry.
output
: HTTP response body of the onwards API call made by Integry.
next_page
: The cursor for the next page. It will only be present in responses of functions that support paginated calls. If there are no more pages, it will be empty.
If Integry does not execute the function, it will respond with a 400 Bad Request
with following keys in the response body:
error
: Summary of the error.
error_details[]
: Detailed errors for individual fields (if applicable).
Sample responses for pipedrive-add-a-person
and pipedrive-get-all-persons
:
In rare cases where Integry is unable to determine if there are more pages, it will respond with a next_page
cursor. Your subsequent call will return an empty output[]
and next_page
cursor since there are no more pages.
This reference documents every object and method available in Integry’s browser-side JavaScript library, Integry.js.
To use the Integry JS SDK, you need to include it in your project. You can install it via npm:
Or include it via a script tag:
The Integry JS SDK requires an App-Key
and a hash of App-Secret
and User-ID
to authenticate calls.
You can view and copy your App-Key
and App-Secret
from the Integry app.
User-ID
is a unique string identifier for a user in your app. Function Calls and Integrations are associated to a user ID.
If your app has workspaces/accounts and you want integrations to be shared across all users in a workspace/account, use the workspace/account ID as the user ID.
Calculate the hash server-side using HMAC SHA256.
Call IntegryJS(authentication)
with theApp-Key
, computed hash and User-ID
to create an instance of the Integry object.
This method emits a ready
event if the access credentials are valid.
Some SDK methods emit events (eg. ready
, app-connected
) that you can leverage to manipulate the user journey.
Call eventEmitter.on('<event_name>')
method.
Events emitted by the SDK are scoped to the instance on which the eventEmitter
object is configured. There is no possibility of naming collision with global events, or even with the same event subscribed on multiple SDK instances.
Call eventEmitter.unsub('<event_name>')
method.
All methods in the Integry JS SDK return Promises
. It is recommended to always include .catch()
to handle errors gracefully. Here is an example:
Integry supports many apps like Slack, Hubspot, or Jira.
showApps(apps, renderMode, containerID)
Renders a marketplace-style listing of apps. You can show all apps or specific apps.
If you want to directly connect an app from your own marketplace, use connect(appName).
app-connected
Fired when the user successfully connects an app. It includes the app details along with an array of connected_accounts
sorted by modified_at
in descending order.
app-disconnected
Fired when the user disconnects an app. It includes the app details along with an array of remaining connected_accounts
(if any) sorted by modified_at
in descending order.
connectApp(appName)
Invokes a UI flow to prompt the user to authenticate with the specified app. After the user connects, Integry verifies that it can access their account. It also refreshes the token, if needed.
Use this to connect apps if you are not using showApps() .
This method returns a connectedAccountId
(string).
If you use connectApp()
to enable your users to connect multiple accounts for an app, you will need to use this ID when you disconnectApp(), showFunctionUI() and invokeFunction().
disconnectApp(appName, connectedAccountId)
Disconnects the user's connected account for an app.
This method returns a Promise
which resolves if the account is disconnected.
isAppConnected(appName)
Checks if the user has connected the specified app.
This method returns a boolean result
. It will be true if the user has one (or more) connected account(s) with this app.
If your users have connected multiple accounts, use getConnectedAccounts() to get their IDs.
getConnectedAccounts(appName)
Returns a user's connected accounts for an app.
This method returns an array of connected_accounts
.
showFunctionUI(functionName, params, connectedAccountId)
Renders the UI for a specific function. This method shows the user a pre-filled form based on the provided action ID and parameters, allowing them to review and confirm the action before executing it.
This method returns a result
object with the filled-in arguments.
Use it as params
to invokeFunction().
invokeFunction(functionName, params, connectedAccountId)
Invokes the specified function of an app with the provided parameters. Integry will automatically include your user's authentication credentials when making the onwards API call.
Integry will execute the function if the user has already connected their account for the function app, and all required parameters (if any) are provided in params
. These function calls will show in the Function Calls log in the Integry app.
Integry will not execute the function if the user has not connected an account, or the parameters passed are invalid. These function calls will not show in the Function Calls log.
Sample params
object for pipedrive-add-a-person
function call:
The functions which fetch data from an app will often return pages of data and allow you to fetch further data by making subsequent calls. These functions use cursor-based pagination via the next_page
parameter that is returned in the result
(if there are more pages).
Sample params
object for pipedrive-get-all-persons
function call with next_page
:
Returns
If Integry executes the function, this method returns a result
object with following keys:
network_code
: HTTP response status code of the onwards API call made by Integry.
output
: HTTP response body of the onwards API call made by Integry.
next_page
: The cursor for the next page. It will only be present in responses of functions that support paginated calls. If there are no more pages, it will be empty.
If Integry does not execute the function, this method returns a result
object with following keys:
error
: Summary of the error.
error_details[]
: Detailed errors for individual fields (if applicable).
Sample responses for pipedrive-add-a-person
and pipedrive-get-all-persons
:
In rare cases where Integry is unable to determine if there are more pages, it will respond with a next_page
cursor. Your subsequent call will return an empty output[]
and next_page
cursor since there are no more pages.
getFunction(functionName)
Gets the signature for a specific function to understand the parameters.
Returns
This method returns a result
object with the function's signature.
We have Functions for the most commonly used endpoints of 200+ apps.
If you want to do anything else, you can call the Passthrough Request function of any app we support via API endpoint or SDK method. Integry will automatically add the user's auth credentials to the request.
POST
/<app_name>-passthrough-request
Integry will execute the function if the user has already connected their account for the function app, and the method
and URL
parameters are provided in the body. These function calls will show in the Function Calls log in the Integry app.
Integry will not execute the function if the user has not connected an account, or the parameters passed are invalid. These function calls will not show in the Function Calls log.
Name | Type | Description | Required |
---|---|---|---|
If Integry executes the function, it will respond with a 200 OK
with following keys in the response body:
network_code
: HTTP response status code of the onwards API call made by Integry.
output
: HTTP response body of the onwards API call made by Integry.
If Integry does not execute the function, it will respond with a 400 Bad Request
with following keys in the response body:
error
: Summary of the error.
error_details[]
: Detailed errors for individual fields (if applicable).
invokeFunction(<app_name>-passthrough-request, params, connectedAccountId)
Integry will execute the function if the user has already connected their account for the function app, and the method
and URL
parameters are provided in the params
object. These function calls will show in the Function Calls log in the Integry app.
Integry will not execute the function if the user has not connected an account, or the parameters passed are invalid. These function calls will not show in the Function Calls log.
If Integry executes the function, this method returns a result
object with following keys:
network_code
: HTTP response status code of the onwards API call made by Integry.
output
: HTTP response body of the onwards API call made by Integry.
If Integry does not execute the function, this method returns a result
object with following keys:
error
: Summary of the error.
error_details[]
: Detailed errors for individual fields (if applicable).
GET
/functions?type=passthrough
List all passthrough request functions supported by Integry. See /functions
for more options.
Name | Value |
---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Required |
---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Name | Type | Description | Example | Required |
---|---|---|---|---|
Content-Type
application/json
App-Key
<App key>
Hash
<App secret + User-ID hash>
User-ID
<User ID>
connected_only
boolean
Only return apps that the user has connected
true
false
cursor
string
Use the cursor to get the next page.
false
app
string
Only return functions of an app
slack
false
type
string
Allowed values: query
, mutation
, passthrough
query
false
connected_only
boolean
Only return functions of apps that the user has connected
true
false
predict_function
boolean
Uses the prompt
to predict one function. See Predict Function with Integry AI.
true
false
predict_arguments
boolean
Only allowed if predict_function=true
. Uses the prompt
to predict the arguments of the predicted function. See Predict Arguments with Integry AI.
true
false
prompt
string
Prompt to use to predict function (and arguments).
Send a message saying hello on slack
true if predict_function=true
cursor
string
Page size is 50. Use the cursor to get the next page.
false
include
string
Include info for rendering the function UI. Allowed values: meta
meta
false
predict_arguments
boolean
Uses the prompt
to predict the arguments of the function. See Predict Arguments with Integry AI.
true
false
prompt
string
Prompt to use to predict function (and arguments).
Send a message saying hello on slack
true if predict_arguments=true
include
string
Include info for rendering the function UI. Allowed values: meta
meta
false
connected_account_id
Number
The ID of the connected account to use for calling the function. Only use if the user has connected multiple accounts.
32543
false
apps
string[]
A list of specific apps to show. Defaults to [] to show all apps.
false
renderMode
string
Specifies the mode in which the marketplace will be rendered. Allowed values: IntegryJS.MarketplaceRenderModes.MODAL
, IntegryJS.MarketplaceRenderModes.INLINE
. Defaults to modal if not specified.
false
containerId
string
The ID of the HTML container in which the marketplace content will be rendered.
true if renderMode=IntegryJS.MarketplaceRenderModes.INLINE
appName
string
The name of the app you want the user to connect.
slack
true
appName
string
The name of the app to disconnect.
slack
true
connectedAccountId
string
The ID of the connected account to delete.
1234
true if the user has multiple connected accounts of this app
appName
string
The name of the app.
slack
true
appName
string
The name of the app.
slack
true
functionName
string
The name of the function to render.
slack-post-message
true
params
object
An object containing the function parameters.
{"limit":5}
true
connectedAccountId
string
The connected account to use for executing the action. Only use if the user has connected multiple accounts.
12456
false
functionName
string
The name of the function to execute
slack-post-message
true
params
object
An object containing the function parameters.
{"limit":5}
true
connectedAccountId
string
The connected account to use for executing the action. Only use if the user has connected multiple accounts.
43654
false
functionName
string
The name of the function to execute
slack-post-message
true
method
string
Request method
true
url
string
Request URL
true
body
object
Request body
false
functionName
string
The name of the function to execute
slack-post-message
true
params
object
An object containing the function parameters.
{"method":"",
"url":"",
"body":""}
true
connectedAccountId
string
The connected account to use for executing the action. Only use if the user has connected multiple accounts.
43654
false