Formbricks Open source Forms & Surveys Logo

Client API

API: Create response

POST
http://localhost:300/api/v1/client/environments/{environmentId}/responses
Add a new submission to a form by form ID.

Parameters

Body

surveyId
string
The customer and metadata you want to link the submission to.
personId

*

string
Customer or user email. This is the primary key to identify users
response
JSON
The content of the submission.
response.data

*

string
The data of the response as JSON object.
response.finished
boolean
Determines if submission is marked as complete.

Body Example

{
  "response": {
    data: {
      "clfqjny0v0003yzgscnog1j9i": 10,
      "clfqjtn8n0070yzgs6jgx9rog": "I love Formbricks"
    },
    finished: true, // optional
  },
  "personId: "clfqjny0v000ayzgsycx54a2c",
  "surveyId": "clfqz1esd0000yzah51trddn8"
}

Responses

 
200
success
field namerequireddefaultdescription
responseyes-The response object (answers to the survey). It requires a data object. In this object the key is the questionId, the value the answer of the user to this question.
personIdyes-The person this response is connected to.
surveyIdyes-The survey this response is connected to.
finishednofalseMark a response as complete to be able to filter accordingly.
Was this page helpful?
Previous
API Key Setup

Need help? 🤓

Join our Discord and ask away. We're happy to help where we can!

Join Discord