Management 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.
GET/api/v1/client/people/getOrCreate
Get or Create Person
Fetch a Person or create (if they don't exist) by their userId and the environmentId.
Mandatory Query Parameters
- Name
userId
- Type
- string
- Description
User ID to fetch or create (if it does not exist)
- Name
enviornmentId
- Type
- string
- Description
Formbricks Environment ID
Request
GET
/api/v1/client/people/getOrCreatecurl --location \
'https://app.formbricks.com/api/v1/client/people/getOrCreate?userId=<user-id>&environmentId=<env-id>'
Response
{
"data": {
"person": {
"id": "clm4bcxms02hspj0ht05k6q5c",
"environmentId": "cll2m30r70004mx0huqkitgqv"
}
}
}