Formbricks

Learn how to use Formbricks with Composio

Overview

SLUG: FORMBRICKS

Description

Formbricks is an open-source platform for building and managing surveys, enabling organizations to collect and analyze user feedback effectively.

Authentication Details

generic_api_key
stringRequired

Connecting to Formbricks

Create an auth config

Use the dashboard to create an auth config for the Formbricks toolkit. This allows you to connect multiple Formbricks accounts to Composio for agents to use.

1

Select App

Navigate to Formbricks.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Formbricks Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4formbricks_auth_config_id = "ac_YOUR_FORMBRICKS_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Formbricks for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, formbricks_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Formbricks toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["FORMBRICKS"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Create Action Class

Description

Tool to create a new action class. Use when defining custom action logic in your environment.

Action Parameters

description
string
environmentId
stringRequired
key
stringRequired
name
stringRequired
noCodeConfig
object
type
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Attribute Class

Description

Tool to create an attribute class in Formbricks. Use when you need to define new attribute classes for segmentation or attributes management.

Action Parameters

description
string
environmentId
stringRequired
isUnique
boolean
key
stringRequired
name
string
type
stringDefaults to custom

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Contact

Description

Tool to create a new contact. Use when you need to register a contact in a Formbricks environment.

Action Parameters

attributes
objectRequired
environmentId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Display

Description

Tool to mark a survey as displayed or link it to a response. Use after obtaining the survey and environment IDs to register a display instance.

Action Parameters

environmentId
stringRequired
surveyId
stringRequired
userId
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Survey Response

Description

Tool to create a response for a survey. Use after collecting all survey answers.

Action Parameters

createdAt
string
data
objectRequired
displayId
string
endingId
string
finished
booleanRequired
language
string
meta
object
singleUseId
string
surveyId
stringRequired
ttc
object
updatedAt
string
variables
object

Action Response

contactAttributes
object
contactId
string
createdAt
stringRequired
data
objectRequired
displayId
string
endingId
string
error
string
finished
booleanRequired
id
stringRequired
language
string
meta
object
singleUseId
string
successful
booleanRequired
surveyId
stringRequired
ttc
object
updatedAt
stringRequired
variables
object

Tool Name: Create Survey

Description

Tool to create a new survey. Use after defining survey details and questions.

Action Parameters

environmentId
stringRequired
name
stringRequired
questions
arrayRequired
type
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Webhook

Description

Tool to create a new webhook. Use when you need to register an external endpoint to receive form response events.

Action Parameters

environmentId
stringRequired
name
stringRequired
source
stringRequired
surveyIds
arrayRequired
triggers
arrayRequired
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Attribute Class

Description

Tool to delete an attribute class. Use when you need to remove an attribute class by its ID after confirming it's no longer needed.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Person

Description

Tool to delete a person. Use when you need to remove a person's record from Formbricks after confirming the ID.

Action Parameters

personId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Survey Response

Description

Tool to delete a survey response by its ID. Use when you need to remove an existing response after confirming its ID.

Action Parameters

id
stringRequired

Action Response

createdAt
stringRequired
data
objectRequired
error
string
finished
booleanRequired
id
stringRequired
language
string
meta
objectRequired
person
objectRequired
personAttributes
objectRequired
singleUseId
string
successful
booleanRequired
surveyId
stringRequired
tags
arrayRequired
ttc
objectRequired
updatedAt
stringRequired

Tool Name: Delete Survey

Description

Tool to delete a survey by its ID. Use when you need to remove a survey after confirming its ID.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Team

Description

Tool to delete a team. Use when you need to remove a team by its ID after confirming it's no longer needed.

Action Parameters

organization_id
stringRequired
team_id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Webhook

Description

Tool to delete a webhook by ID. Use when you need to remove an existing webhook from Formbricks. Use after confirming the webhook ID.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Account Info

Description

Tool to retrieve account information. Use when you need details about the authenticated Formbricks account.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get All Contacts

Description

Tool to retrieve all contacts within the organization. Use when you need a complete list of contacts.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: Get Me

Description

Tool to retrieve current authenticated organization's and environment details. Use when you need to fetch organization and environment information for the current API key.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Responses

Description

Tool to retrieve a list of survey responses. Use when you need to page, sort, or filter responses.

Action Parameters

contactId
string
endDate
string
limit
integerDefaults to 50
order
stringDefaults to desc
skip
integer
sortBy
stringDefaults to createdAt
startDate
string
surveyId
string

Action Response

data
arrayRequired
error
string
meta
objectRequired
successful
booleanRequired

Tool Name: Get Roles

Description

Tool to retrieve all available roles in the system. Use when you need system roles for access control.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: Get Users

Description

Tool to retrieve a list of users within the environment using the Management API.

Action Parameters

limit
integer
organizationId
string
skip
integer

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: Get Webhook

Description

Tool to retrieve details of a specific webhook. Use when you need to inspect a webhook's configuration by ID.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List Action Classes

Description

Tool to list all action classes. Use when you need to inspect available action classes for workflows.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: List Attribute Classes

Description

Tool to list all attribute classes. Use when you need to retrieve existing attribute classes for segmentation or management.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: List Surveys

Description

Tool to list all surveys. Use when you need to retrieve a summary of all surveys available in the environment.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: List Webhooks

Description

Tool to list all webhooks. Use when you need to retrieve all configured webhooks for the current environment.

Action Parameters

endDate
string
limit
integer
order
string
skip
integer
sortBy
string
startDate
string
surveyIds
array

Action Response

data
arrayRequired
error
string
meta
object
successful
booleanRequired

Tool Name: Update Person

Description

Tool to update an existing person. Use when you need to modify contact attributes in a Formbricks environment.

Action Parameters

attributes
objectRequired
environmentId
stringRequired
userId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Survey Response

Description

Tool to update an existing survey response. Use after identifying the response to modify.

Action Parameters

contactAttributes
object
contactId
string
createdAt
string
data
objectRequired
displayId
string
endingId
string
finished
booleanRequired
id
stringRequired
language
string
meta
object
singleUseId
string
surveyId
stringRequired
ttc
object
updatedAt
string
variables
object

Action Response

contactAttributes
object
contactId
string
createdAt
stringRequired
data
objectRequired
displayId
string
endingId
string
error
string
finished
booleanRequired
id
stringRequired
language
string
meta
object
singleUseId
string
successful
booleanRequired
surveyId
stringRequired
ttc
object
updatedAt
stringRequired
variables
object

Tool Name: Update Survey

Description

Tool to update an existing survey. Use after confirming survey ID to modify its properties.

Action Parameters

delay
number
displayLimit
integer
displayOption
string
displayPercentage
number
endings
array
hiddenFields
object
id
stringRequired
isVerifyEmailEnabled
boolean
languages
array
name
string
questions
array
redirectUrl
string
showLanguageSwitch
boolean
status
string
surveyClosedMessage
string
triggers
array
welcomeCard
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Webhook

Description

Tool to update an existing webhook. Use when you need to apply modifications to a webhook's configuration.

Action Parameters

environmentId
stringRequired
id
stringRequired
name
stringRequired
source
stringRequired
surveyIds
arrayRequired
triggers
arrayRequired
url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Upload Bulk Contacts

Description

Tool to upload multiple contacts in bulk. Use when you need to import up to 250 contacts at once.

Action Parameters

contacts
arrayRequired
environmentId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Upload Private File

Description

Tool to obtain S3 presigned upload data for a private survey file. Use after confirming environmentId and surveyId.

Action Parameters

environmentId
stringRequired
fileName
stringRequired
fileType
stringRequired
surveyId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Upload Public File

Description

Tool to get S3 presigned data for uploading a public file. Use after environment creation to retrieve upload details.

Action Parameters

allowedFileExtensions
array
environmentId
stringRequired
fileName
stringRequired
fileType
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired