Client API

People API

The Public Client API is designed for the JavaScript SDK and does not require authentication. It's primarily used for creating persons, sessions, and responses within the Formbricks platform. This API is ideal for client-side interactions, as it doesn't expose sensitive information.

This set of API can be used to


POST/api/v1/client/<environment-id>/people

Create Person

Create User with your own User ID

Mandatory Request Body JSON Keys

  • Name
    userId
    Type
    string
    Description

    User ID which you would like to identify the person with

Request

POST
/api/v1/client/<environment-id>/people
curl -X POST \
'https://app.formbricks.com/api/v1/client/<environment-id>/people' \
-H 'Content-Type: application/json' \
-d '{
    "userId":"docs_user"
}'

Response

{
  "data": {
      "userId": "docs_user"
    }
}

POST/api/v1/client/<environment-id>/people/<user-id>

Update Person

Update Person by their User ID

Mandatory Request Body JSON Keys

  • Name
    attributes
    Type
    JSON
    Description

    Key Value pairs of attributes to add to the user

Request

POST
/api/v1/client/<environment-id>/people/<user-id>
curl -X POST \
--location \
'https://app.formbricks.com/api/v1/client/<environment-id>/people/<user-id>'
-H 'Content-Type: application/json' \
-d '{
    "attributes":{
        "welcome_to":"formbricks"
    }
}'

Response

{
  "data": {}
}

Was this page helpful?