Events
Update an event question
A reused field_key updates an existing active question or restores an unused archived question; an archived question with saved answers returns 409. Omitted fields are preserved when updating. Requires the event management capability; all referenced records must belong to this event and organization.
PUT
/
admin
/
events
/
{eventId}
/
questions
/
{id}
Update an event question
curl --request PUT \
--url https://api.gratona.com/v1/admin/events/{eventId}/questions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "buyer",
"field_key": "dietary_preferences",
"field_label": "Dietary preferences",
"field_type": "text",
"help_text": "Example",
"options": [
"Example"
],
"applies_to_ticket_type_ids": [
1
],
"required": false,
"is_active": false,
"sort_order": 1
}
'import requests
url = "https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}"
payload = {
"scope": "buyer",
"field_key": "dietary_preferences",
"field_label": "Dietary preferences",
"field_type": "text",
"help_text": "Example",
"options": ["Example"],
"applies_to_ticket_type_ids": [1],
"required": False,
"is_active": False,
"sort_order": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'buyer',
field_key: 'dietary_preferences',
field_label: 'Dietary preferences',
field_type: 'text',
help_text: 'Example',
options: ['Example'],
applies_to_ticket_type_ids: [1],
required: false,
is_active: false,
sort_order: 1
})
};
fetch('https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'scope' => 'buyer',
'field_key' => 'dietary_preferences',
'field_label' => 'Dietary preferences',
'field_type' => 'text',
'help_text' => 'Example',
'options' => [
'Example'
],
'applies_to_ticket_type_ids' => [
1
],
'required' => false,
'is_active' => false,
'sort_order' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}"
payload := strings.NewReader("{\n \"scope\": \"buyer\",\n \"field_key\": \"dietary_preferences\",\n \"field_label\": \"Dietary preferences\",\n \"field_type\": \"text\",\n \"help_text\": \"Example\",\n \"options\": [\n \"Example\"\n ],\n \"applies_to_ticket_type_ids\": [\n 1\n ],\n \"required\": false,\n \"is_active\": false,\n \"sort_order\": 1\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"buyer\",\n \"field_key\": \"dietary_preferences\",\n \"field_label\": \"Dietary preferences\",\n \"field_type\": \"text\",\n \"help_text\": \"Example\",\n \"options\": [\n \"Example\"\n ],\n \"applies_to_ticket_type_ids\": [\n 1\n ],\n \"required\": false,\n \"is_active\": false,\n \"sort_order\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"buyer\",\n \"field_key\": \"dietary_preferences\",\n \"field_label\": \"Dietary preferences\",\n \"field_type\": \"text\",\n \"help_text\": \"Example\",\n \"options\": [\n \"Example\"\n ],\n \"applies_to_ticket_type_ids\": [\n 1\n ],\n \"required\": false,\n \"is_active\": false,\n \"sort_order\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 1,
"client_id": 1,
"event_id": 1,
"scope": "Example",
"field_key": "dietary_preferences",
"field_label": "Dietary preferences",
"field_type": "Example",
"help_text": "Example",
"options": [
"Example"
],
"applies_to_ticket_type_ids": [
1
],
"required": false,
"is_active": false,
"sort_order": 1,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Path Parameters
Body
application/json
⌘I
Update an event question
curl --request PUT \
--url https://api.gratona.com/v1/admin/events/{eventId}/questions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": "buyer",
"field_key": "dietary_preferences",
"field_label": "Dietary preferences",
"field_type": "text",
"help_text": "Example",
"options": [
"Example"
],
"applies_to_ticket_type_ids": [
1
],
"required": false,
"is_active": false,
"sort_order": 1
}
'import requests
url = "https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}"
payload = {
"scope": "buyer",
"field_key": "dietary_preferences",
"field_label": "Dietary preferences",
"field_type": "text",
"help_text": "Example",
"options": ["Example"],
"applies_to_ticket_type_ids": [1],
"required": False,
"is_active": False,
"sort_order": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scope: 'buyer',
field_key: 'dietary_preferences',
field_label: 'Dietary preferences',
field_type: 'text',
help_text: 'Example',
options: ['Example'],
applies_to_ticket_type_ids: [1],
required: false,
is_active: false,
sort_order: 1
})
};
fetch('https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'scope' => 'buyer',
'field_key' => 'dietary_preferences',
'field_label' => 'Dietary preferences',
'field_type' => 'text',
'help_text' => 'Example',
'options' => [
'Example'
],
'applies_to_ticket_type_ids' => [
1
],
'required' => false,
'is_active' => false,
'sort_order' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}"
payload := strings.NewReader("{\n \"scope\": \"buyer\",\n \"field_key\": \"dietary_preferences\",\n \"field_label\": \"Dietary preferences\",\n \"field_type\": \"text\",\n \"help_text\": \"Example\",\n \"options\": [\n \"Example\"\n ],\n \"applies_to_ticket_type_ids\": [\n 1\n ],\n \"required\": false,\n \"is_active\": false,\n \"sort_order\": 1\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": \"buyer\",\n \"field_key\": \"dietary_preferences\",\n \"field_label\": \"Dietary preferences\",\n \"field_type\": \"text\",\n \"help_text\": \"Example\",\n \"options\": [\n \"Example\"\n ],\n \"applies_to_ticket_type_ids\": [\n 1\n ],\n \"required\": false,\n \"is_active\": false,\n \"sort_order\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/events/{eventId}/questions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scope\": \"buyer\",\n \"field_key\": \"dietary_preferences\",\n \"field_label\": \"Dietary preferences\",\n \"field_type\": \"text\",\n \"help_text\": \"Example\",\n \"options\": [\n \"Example\"\n ],\n \"applies_to_ticket_type_ids\": [\n 1\n ],\n \"required\": false,\n \"is_active\": false,\n \"sort_order\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 1,
"client_id": 1,
"event_id": 1,
"scope": "Example",
"field_key": "dietary_preferences",
"field_label": "Dietary preferences",
"field_type": "Example",
"help_text": "Example",
"options": [
"Example"
],
"applies_to_ticket_type_ids": [
1
],
"required": false,
"is_active": false,
"sort_order": 1,
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}