Surveys

Submit Surveys

Submits a user response to a survey, which is defined by the survey ID.

POST
/surveys.submit
AuthorizationBearer <token>

All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request. How do I find my token?

In: header

dispatch_id?string

The unique ID associated with the dispatched survey.

Formatid
dispatched_channels?array<integer>

The ordinals of the source channels on which the survey is sent.

objectstring

The ID of the object this survey is on (e.g. ticket, conversation, etc).

Formatid
recipient?string

The unique ID associated with the recipient of the survey.

Formatid
response?object

Survey response submitted for the object.

Empty Object

response_score?integer

The response score for the survey. Only applicable for CSAT and NPS.

Formatint32
source_channel?string

The source channel from which survey response is submitted.

Formattext
stage?integer

The stage ordinal of the survey response object.

Formatint64
surveystring

The ID of the survey to submit the response to.

Formatid

Response Body

curl -X POST "https://api.devrev.ai/surveys.submit" \  -H "Content-Type: application/json" \  -d '{    "object": "ACC-12345",    "survey": "string"  }'
{}
{
  "detail": "string",
  "message": "string",
  "type": "artifact_already_attached_to_a_parent",
  "existing_parent": "string",
  "is_same": true
}
{
  "detail": "string",
  "message": "string",
  "type": "unauthenticated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden"
}
{
  "detail": "string",
  "message": "string",
  "type": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}