curl --request POST \
--url https://app.gaintrace.com/api/v1/surveys/{id}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'active'})
};
fetch('https://app.gaintrace.com/api/v1/surveys/{id}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.gaintrace.com/api/v1/surveys/{id}/status"
payload = { "status": "active" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "7b6f2c1e-4d3a-4b5c-9e8f-1a2b3c4d5e6f",
"name": "Relationship NPS",
"measure": "nps",
"status": "active",
"questions": [
{
"text": "How likely are you to recommend us to a colleague?",
"type": "rating",
"required": true
},
{
"text": "What is the main reason for your score?",
"type": "text",
"required": false
}
],
"settings": {
"thankYouTitle": "Thank you",
"reminders": {
"afterDays": 3,
"max": 1
}
},
"cooldownDays": 90,
"createdAt": "2026-10-14T09:00:00.000Z",
"updatedAt": "2026-10-14T09:00:00.000Z"
}
}{
"error": {
"code": "bad_request",
"message": "Invalid JSON body",
"doc_url": "https://docs.gaintrace.com/errors#bad_request"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing Authorization header",
"doc_url": "https://docs.gaintrace.com/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Insufficient scope: write:companies required",
"doc_url": "https://docs.gaintrace.com/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "Company not found",
"doc_url": "https://docs.gaintrace.com/errors#not_found"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "Request validation failed. name: name is required",
"doc_url": "https://docs.gaintrace.com/errors#unprocessable_entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Can't accept more than 60 requests a minute from one API key. Retry in 23 seconds.",
"doc_url": "https://docs.gaintrace.com/errors#rate_limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "Something went wrong. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#internal_server_error"
}
}{
"error": {
"code": "service_unavailable",
"message": "We had trouble reaching the database. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#service_unavailable"
}
}{
"error": {
"code": "gateway_timeout",
"message": "The request timed out. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#gateway_timeout"
}
}Change survey status
Launch a draft, close a survey, or reopen a closed one. Launching validates the survey contract again. A launched survey can’t return to draft, so only active and closed are accepted. Moving to active or closed fires the survey.launched or survey.closed webhook. Sending the status the survey already has changes nothing and fires nothing. If the launch re-validation fails a cross-field rule, the call returns 400 bad_request with a generic message and no field detail. Requires a secret server key (gt_live_). Publishable keys (gt_pub_) return 403.
Scope: write:surveys
curl --request POST \
--url https://app.gaintrace.com/api/v1/surveys/{id}/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({status: 'active'})
};
fetch('https://app.gaintrace.com/api/v1/surveys/{id}/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.gaintrace.com/api/v1/surveys/{id}/status"
payload = { "status": "active" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "7b6f2c1e-4d3a-4b5c-9e8f-1a2b3c4d5e6f",
"name": "Relationship NPS",
"measure": "nps",
"status": "active",
"questions": [
{
"text": "How likely are you to recommend us to a colleague?",
"type": "rating",
"required": true
},
{
"text": "What is the main reason for your score?",
"type": "text",
"required": false
}
],
"settings": {
"thankYouTitle": "Thank you",
"reminders": {
"afterDays": 3,
"max": 1
}
},
"cooldownDays": 90,
"createdAt": "2026-10-14T09:00:00.000Z",
"updatedAt": "2026-10-14T09:00:00.000Z"
}
}{
"error": {
"code": "bad_request",
"message": "Invalid JSON body",
"doc_url": "https://docs.gaintrace.com/errors#bad_request"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing Authorization header",
"doc_url": "https://docs.gaintrace.com/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Insufficient scope: write:companies required",
"doc_url": "https://docs.gaintrace.com/errors#forbidden"
}
}{
"error": {
"code": "not_found",
"message": "Company not found",
"doc_url": "https://docs.gaintrace.com/errors#not_found"
}
}{
"error": {
"code": "unprocessable_entity",
"message": "Request validation failed. name: name is required",
"doc_url": "https://docs.gaintrace.com/errors#unprocessable_entity"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Can't accept more than 60 requests a minute from one API key. Retry in 23 seconds.",
"doc_url": "https://docs.gaintrace.com/errors#rate_limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "Something went wrong. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#internal_server_error"
}
}{
"error": {
"code": "service_unavailable",
"message": "We had trouble reaching the database. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#service_unavailable"
}
}{
"error": {
"code": "gateway_timeout",
"message": "The request timed out. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#gateway_timeout"
}
}Authorizations
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
The survey's UUID.
Body
active, closed Response
The survey with its new status.
Show child attributes
Show child attributes
Was this page helpful?