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 name | required | default | description |
---|---|---|---|
response | yes | - | 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. |
personId | yes | - | The person this response is connected to. |
surveyId | yes | - | The survey this response is connected to. |
finished | no | false | Mark a response as complete to be able to filter accordingly. |