Devices

See also Device authentication.

Device resource

The device resource contains the following public fields:

Field

Type

Description

device_id

integer

Internal ID of the device within this organizer

unique_serial

string

Unique identifier of this device

name

string

Device name

all_events

boolean

Whether this device has access to all events

limit_events

list

List of event slugs this device has access to

hardware_brand

string

Device hardware manufacturer (read-only)

hardware_model

string

Device hardware model (read-only)

software_brand

string

Device software product (read-only)

software_version

string

Device software version (read-only)

created

datetime

Creation time

initialized

datetime

Time of initialization (or null)

initialization_token

string

Token for initialization

revoked

boolean

Whether this device no longer has access

security_profile

string

The name of a supported security profile restricting API access

Device endpoints

GET /api/v1/organizers/(organizer)/devices/

Returns a list of all devices within a given organizer.

Example request:

GET /api/v1/organizers/bigevents/devices/ 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": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "device_id": 1,
      "unique_serial": "UOS3GNZ27O39V3QS",
      "initialization_token": "frkso3m2w58zuw70",
      "all_events": false,
      "limit_events": [
        "museum"
      ],
      "revoked": false,
      "name": "Scanner",
      "created": "2020-09-18T14:17:40.971519Z",
      "initialized": "2020-09-18T14:17:44.190021Z",
      "security_profile": "full",
      "hardware_brand": "Zebra",
      "hardware_model": "TC25",
      "software_brand": "pretixSCAN",
      "software_version": "1.5.1"
    }
  ]
}
Query Parameters
  • page (integer) – The page number in case of a multi-page result set, default is 1

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

Status Codes
GET /api/v1/organizers/(organizer)/devices/(device_id)/

Returns information on one device, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/devices/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

{
  "device_id": 1,
  "unique_serial": "UOS3GNZ27O39V3QS",
  "initialization_token": "frkso3m2w58zuw70",
  "all_events": false,
  "limit_events": [
    "museum"
  ],
  "revoked": false,
  "name": "Scanner",
  "created": "2020-09-18T14:17:40.971519Z",
  "initialized": "2020-09-18T14:17:44.190021Z",
  "security_profile": "full",
  "hardware_brand": "Zebra",
  "hardware_model": "TC25",
  "software_brand": "pretixSCAN",
  "software_version": "1.5.1"
}
Parameters
  • organizer – The slug field of the organizer to fetch

  • device_id – The device_id field of the device to fetch

Status Codes
POST /api/v1/organizers/(organizer)/devices/

Creates a new device

Example request:

POST /api/v1/organizers/bigevents/devices/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json

{
  "name": "Scanner",
  "all_events": true,
  "limit_events": [],
}

Example response:

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

{
  "device_id": 1,
  "unique_serial": "UOS3GNZ27O39V3QS",
  "initialization_token": "frkso3m2w58zuw70",
  "all_events": true,
  "limit_events": [],
  "revoked": false,
  "name": "Scanner",
  "created": "2020-09-18T14:17:40.971519Z",
  "security_profile": "full",
  "initialized": null
  "hardware_brand": null,
  "hardware_model": null,
  "software_brand": null,
  "software_version": null
}
Parameters
  • organizer – The slug field of the organizer to create a device for

Status Codes
PATCH /api/v1/organizers/(organizer)/devices/(device_id)/

Update a device.

Example request:

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

{
  "name": "Foo"
}

Example response:

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

{
  "id": 1,
  "name": "Foo",
  ...
}
Parameters
  • organizer – The slug field of the organizer to modify

  • device_id – The device_id field of the device to modify

Status Codes
  • 200 OK – no error

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

  • 401 Unauthorized – Authentication failure

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