---
description: "Read and manage category question definitions, order registration questions, and refresh existing ticket snapshots."
group: "Resources"
order: 16
---

# Category questions

Define the registration questions shared by products in a category.

## Read definitions {#read-definitions}

`GET /{event_id}/categories/index.json` returns every category with its `CategoryField` array. `GET /{event_id}/category_fields/edit/{category_id}/{question_id}.json` reads one definition in a `CategoryField` envelope. Use question UUIDs as keys and `order` for display order. The `category_fields/view` action has no JSON list view; use the category list.

These are current definitions. Purchased attendees can retain historical question snapshots after definitions change. See [categories](/en-us/docs/categories.md) for managing the parent group.

## Create and update {#create-and-update}

| Method and path after the event UUID | Result |
| --- | --- |
| `PUT /category_fields/edit/{category_id}.json` | Create a definition. HTTP 302 redirects to its organizer edit page with the new question UUID and `success=1`. |
| `PUT /category_fields/edit/{category_id}/{question_id}.json` | Edit a definition. HTTP 200 echoes submitted `CategoryField` data with assigned IDs; it has no `ok` flag. |

```
{"CategoryField":{"name":"Dietary preference","type":"text","mandatory":0,"on_ticket":1}}
```

Both writes require `name` (2–255 characters) and `type`. Optional fields are `mandatory`, `options`, `on_ticket`, `selfservice_disabled`, `other` and `answer_amount`. The route assigns the category and question IDs. Use question types available in your organizer editor; company/event settings affect the available choices.

Choice types use scalar option labels, such as `["Vegetarian","None"]`. Workshop options use rows with `question` and optional `amount`; paid questions use `{"price":"5.00"}`. Omit options for text questions. Empty option labels are discarded and malformed options are rejected.

Validation failures return HTTP 400 with `{"success":false,"error":"validation_failed","errors":{...}}`. Missing or foreign IDs can redirect. Disable redirect following: a creation redirect can carry the generic JSON body `{"error":"invalid_request"}` even after success. Inspect `Location` and re-read the category list to confirm creation or an edit before retrying.

## Remove and reorder {#remove-and-reorder}

See [question types and answers](/en-us/docs/question-types.md) for every accepted definition type, conditional option shapes, Other answers and attendee payloads. The [integration recipes](/en-us/docs/integration-recipes.md) connect definitions with products and attendee edits.

`POST /{event_id}/category_fields/delete/{question_id}.json` removes an event-owned question and compacts ordering. Send `X-Requested-With: XMLHttpRequest` for the JSON branch; otherwise it redirects to the organizer UI. With no request body, success is `[]`. Re-read definitions to confirm removal; historical ticket snapshots can retain the deleted definition.

`POST /{event_id}/category_fields/order/{category_id}.json` requires the complete ordered question UUID array in `CategoryField`. Include every current question exactly once. Invalid, foreign or incomplete lists return HTTP 400; success is HTTP 204 without a body.

```
{"CategoryField":["77777777-7777-4777-8777-777777777777"]}
```

## Refresh existing tickets {#refresh-existing-tickets}

`POST /{event_id}/category_fields/update_all_tickets/{category_id}/{question_id}.json` verifies the selected definition and refreshes product/question snapshots for attendees whose products belong to that category. The refresh can include all current category definitions. A successful no-body request returns `[]`; re-read affected attendees to verify the result.

This batch is not atomic across all attendees. HTTP 500 can return `{"success":false,"error":"ticket_update_failed","failed_ids":[...]}` after earlier attendees were already updated. Inspect those IDs and current snapshots before retrying. Updating current definitions alone does not rewrite purchased tickets.

## Edit attendee answers {#edit-attendee-answers}

Use the [attendee answer and question actions](/en-us/docs/attendee-management.md) to edit one attendee's answers or archived question snapshot. They enforce attendee ownership and editable order state separately from definition management.
