Skip to main content
POST
Record a survey response

Authorizations

Authorization
string
header
required

Bearer API key. Secret server keys start with gt_live_; client-safe browser keys start with gt_pub_ (write-only, origin-pinned). Create and scope keys in Settings → API Keys.

Path Parameters

id
string<uuid>
required

The survey's UUID.

Body

application/json
personId
string<uuid>
required

An active person in your workspace.

externalId
string
required

Your own stable id for this answer. Re-sending it for the same survey returns the first response instead of creating another.

Required string length: 1 - 255
score
integer

The first question's score. It must sit inside that question's scale, and must match answers.q0 when you send both.

Required range: 0 <= x <= 10
answers
object

Answers keyed by zero-based question index: q0, q1 and so on. A score is an integer inside the question's scale. A multiple choice or dropdown answer is one of the listed options. A checkbox answer is a list of options. A ranking is every option, in your order. A matrix is an object of row to column. A date is YYYY-MM-DD. A consent answer is true. Text answers are at most 5,000 characters. Required questions that are visible must be answered. comment carries a free-text comment.

hidden
object

Values for the survey's hiddenFields. At most 10 keys, each name at most 40 characters. Names the survey does not list are dropped.

subject
object

The record a response is about: a deal, ticket, plan or custom record. Name it by its GainTrace id, or, for a deal or ticket, by the id it has in your CRM or help desk (externalId, with source when more than one connection holds that id). For a custom record, send the data model's model slug and the record's externalId. The record must exist, must not be archived, and must belong to the same Company as the person.

Response

This externalId was already recorded. The first response is returned.

data
object
required