API

API Overview

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. Or directly try out our APIs in Postman by clicking the button below:

Run in Postman

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:

  • Actions API - Create actions for a Person
  • 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:

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!

  1. Go to your settings on app.formbricks.com.
  2. Go to page “API keys” Add API Key
  3. Create a key for the development or production environment.
  4. Copy the key immediately. You won’t be able to see it again. API Key Secret

Test your API Key

Hit the below request to verify that you are authenticated with your API Key and the server is responding.

GET/api/v1/me

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

  1. Go to settings on app.formbricks.com.
  2. Go to page “API keys”.
  3. Find the key you wish to revoke and select “Delete”.
  4. Your API key will stop working immediately.

Request

GET
/api/v1/me
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"
  },
  "widgetSetupCompleted": false
}

Can’t figure it out? Join our Discord and we'd be glad to assist you!


Was this page helpful?