API
API Overview
The Formbricks API is currently in beta and is subject to change. We will do our best to notify you of any changes.
Formbricks offers two types of APIs: the Public Client API and the Management API. Each API serves a different purpose, has different authentication requirements, and provides access to different data and settings.
View our API Documentation in more than 30 frameworks and languages.
Public Client API
The Public Client API is designed for our SDKs and does not require authentication. This API is ideal for client-side interactions, as it doesn't expose sensitive information.
We currently have the following Client API methods exposed and below is their documentation attached in Postman:
- Displays API - Mark Survey as Displayed or Update an existing Display by linking it with a Response for a Person
- People API - Create & Update a Person (e.g. attributes, email, userId, etc)
- Responses API - Create & Update a Response for a Survey
Management API
The Management API provides access to all data and settings that your account has access to in the Formbricks app. This API requires a personal API Key for authentication, which can be generated in the Settings section of the Formbricks app. Checkout the API Key Setup below to generate & manage API Keys.
We currently have the following Management API methods exposed and below is their documentation attached in Postman:
- Action Class API - Create, List, and Delete Action Classes
- Attribute Class API - Create, List, and Delete Attribute Classes
- Me API - Retrieve Account Information
- People API - List and Delete People
- Response API - List, List by Survey, Update, and Delete Responses
- Survey API - List, Create, Update, generate multiple suId and Delete Surveys
- Webhook API - List, Create, and Delete Webhooks
How to Generate an API key
The API requests are authorized with a personal API key. This API key gives you the same rights as if you were logged in at formbricks.com - don't share it around!
- Go to your settings on app.formbricks.com.
- Go to page “API keys”
- Create a key for the development or production environment.
- Copy the key immediately. You won’t be able to see it again.
Store API key safely! Anyone who has your API key has full control over your account. For security
reasons, you cannot view the API key again.
Test your API Key
Hit the below request to verify that you are authenticated with your API Key and the server is responding.
Get My Profile
Get the product details and environment type of your account.
Mandatory Headers
- Name
x-Api-Key
- Type
- string
- Description
Your Formbricks API key.
Delete a personal API key
- Go to settings on app.formbricks.com.
- Go to page “API keys”.
- Find the key you wish to revoke and select “Delete”.
- Your API key will stop working immediately.
Request
curl --location \
'https://app.formbricks.com/api/v1/me' \
--header \
'x-api-key: <your-api-key>'
Response
{
"id": "cll2m30r70004mx0huqkitgqv",
"createdAt": "2023-08-08T18:04:59.922Z",
"updatedAt": "2023-08-08T18:04:59.922Z",
"type": "production",
"product": {
"id": "cll2m30r60003mx0hnemjfckr",
"name": "My Product"
},
"appSetupCompleted": false,
"websiteSetupCompleted": false,
}
Can’t figure it out? Join our Discord and we'd be glad to assist you!