Data field options

Note

This API is part of an upcoming larger change to our API. The API documentation already reflects the future version. Until the change, this resource is still available at /questions/(id)/options/. The new version is expected to be released for hosted pretix early December and for self-hosted pretix with version 2027.1. You can find more information on our blog.

Resource description

Data fields of type “choice” or “multiple choice” can have different options attached.

As with data fields, data field options exist on two resource paths, depending on whether the data field is attached to orders or order positions. Therefore, each endpoint below has two different URLs.

The options resource contains the following public fields:

Field

Type

Description

id

integer

Internal ID of the option

position

integer

An integer, used for sorting

identifier

string

An arbitrary string that can be used for matching with other sources.

answer

multi-lingual string

The displayed value of this option

Endpoints

GET /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/
GET /api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/

Returns a list of all options for a given data field.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/datafields/position/11/options/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 1,
      "identifier": "LVETRWVU",
      "position": 1,
      "answer": {"en": "S"}
    },
    {
      "id": 2,
      "identifier": "DFEMJWMJ",
      "position": 2,
      "answer": {"en": "M"}
    },
    {
      "id": 3,
      "identifier": "W9AH7RDE",
      "position": 3,
      "answer": {"en": "L"}
    }
  ]
}
Query Parameters:
  • page (integer) – The page number in case of a multi-page result set, default is 1

  • active (boolean) – If set to true or false, only data fields with this value for the field active will be returned.

Parameters:
  • organizer – The slug field of the organizer to fetch

  • event – The slug field of the event to fetch

  • datafield – The id field of the data field to fetch

Status Codes:
  • 200 OK – no error

  • 401 Unauthorized – Authentication failure

  • 403 Forbidden – The requested organizer/event/data field does not exist or you have no permission to view this resource.

GET /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/(id)/
GET /api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/(id)/

Returns information on one option, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "id": 1,
  "identifier": "LVETRWVU",
  "position": 1,
  "answer": {"en": "S"}
}
Parameters:
  • organizer – The slug field of the organizer to fetch

  • event – The slug field of the event to fetch

  • datafield – The id field of the data field to fetch

  • id – The id field of the option to fetch

Status Codes:
  • 200 OK – no error

  • 401 Unauthorized – Authentication failure

  • 403 Forbidden – The requested organizer/event does not exist or you have no permission to view this resource.

POST /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/
POST /api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/

Create a new option

Example request:

POST /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json

{
  "identifier": "LVETRWVU",
  "position": 1,
  "answer": {"en": "S"}
}

Example response:

HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json

{
  "id": 1,
  "identifier": "LVETRWVU",
  "position": 1,
  "answer": {"en": "S"}
}
Parameters:
  • organizer – The slug field of the organizer of the event/data field to create a option for

  • event – The slug field of the event to create a option for

  • datafield – The id field of the data field to create a option for

Status Codes:
PATCH /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/(id)/
PATCH /api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/(id)/

Update an option. You can also use PUT instead of PATCH. With PUT, you have to provide all fields of the resource, other fields will be reset to default. With PATCH, you only need to provide the fields that you want to change.

You can change all fields of the resource except the id field.

Example request:

PATCH /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
Content-Length: 94

{
  "position": 3
}

Example response:

HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json

{
  "id": 1,
  "identifier": "LVETRWVU",
  "position": 1,
  "answer": {"en": "S"}
}
Parameters:
  • organizer – The slug field of the organizer to modify

  • event – The slug field of the event to modify

  • id – The id field of the data field to modify

  • id – The id field of the option to modify

Status Codes:
  • 200 OK – no error

  • 400 Bad Request – The option could not be modified due to invalid submitted data

  • 401 Unauthorized – Authentication failure

  • 403 Forbidden – The requested organizer/event does not exist or you have no permission to change this resource.

DELETE /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/(id)/
DELETE /api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/(id)/

Delete an option.

Example request:

DELETE /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

HTTP/1.1 204 No Content
Vary: Accept
Parameters:
  • organizer – The slug field of the organizer to modify

  • event – The slug field of the event to modify

  • datafield – The id field of the data field to modify

  • id – The id field of the option to delete

Status Codes: