Teams

Warning

Unlike our user interface, the team API does allow you to lock yourself out by deleting or modifying the team your user or API key belongs to. Be careful around here!

Team resource

The team resource contains the following public fields:

Field

Type

Description

id

integer

Internal ID of the team

name

string

Team name

all_events

boolean

Whether this team has access to all events

limit_events

list

List of event slugs this team has access to

require_2fa

boolean

Whether members of this team are required to use two-factor authentication

can_create_events

boolean

can_change_teams

boolean

can_change_organizer_settings

boolean

can_manage_customers

boolean

can_manage_reusable_media

boolean

can_manage_gift_cards

boolean

can_change_event_settings

boolean

can_change_items

boolean

can_view_orders

boolean

can_change_orders

boolean

can_view_vouchers

boolean

can_change_vouchers

boolean

can_checkin_orders

boolean

Changed in version 4.18: The can_manage_reusable_media permission has been added.

Team member resource

The team member resource contains the following public fields:

Field

Type

Description

id

integer

Internal ID of the user

email

string

The user’s email address

fullname

string

The user’s full name (or null)

require_2fa

boolean

Whether this user uses two-factor-authentication

Team invite resource

The team invite resource contains the following public fields:

Field

Type

Description

id

integer

Internal ID of the invite

email

string

The invitee’s email address

Team API token resource

The team API token resource contains the following public fields:

Field

Type

Description

id

integer

Internal ID of the invite

name

string

Name of this API token

active

boolean

Whether this API token is active (can never be set to true again once false)

token

string

The actual API token. Will only be sent back during token creation.

Team endpoints

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

Returns a list of all teams within a given organizer.

Example request:

GET /api/v1/organizers/bigevents/teams/ 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": [
    {
      "id": 1,
      "name": "Admin team",
      "all_events": true,
      "limit_events": [],
      "require_2fa": true,
      "can_create_events": true,
      ...
    }
  ]
}
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)/teams/(id)/

Returns information on one team, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/teams/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,
  "name": "Admin team",
  "all_events": true,
  "limit_events": [],
  "require_2fa": true,
  "can_create_events": true,
  ...
}
Parameters:
  • organizer – The slug field of the organizer to fetch

  • id – The id field of the team to fetch

Status Codes:
POST /api/v1/organizers/(organizer)/teams/

Creates a new team

Example request:

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

{
  "name": "Admin team",
  "all_events": true,
  "limit_events": [],
  "require_2fa": true,
  "can_create_events": true,
  ...
}

Example response:

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

{
  "id": 2,
  "name": "Admin team",
  "all_events": true,
  "limit_events": [],
  "require_2fa": true,
  "can_create_events": true,
  ...
}
Parameters:
  • organizer – The slug field of the organizer to create a team for

Status Codes:
PATCH /api/v1/organizers/(organizer)/teams/(id)/

Update a team. 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.

Example request:

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

{
  "can_create_events": true
}

Example response:

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

{
  "id": 1,
  "name": "Admin team",
  "all_events": true,
  "limit_events": [],
  "require_2fa": true,
  "can_create_events": true,
  ...
}
Parameters:
  • organizer – The slug field of the organizer to modify

  • id – The id field of the team to modify

Status Codes:
  • 200 OK – no error

  • 400 Bad Request – The team 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.

DELETE /api/v1/organizers/(organizer)/teams/(id)/

Deletes a team.

Example request:

DELETE /api/v1/organizers/bigevents/teams/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Example response:

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

  • id – The id field of the team to delete

Status Codes:

Team member endpoints

GET /api/v1/organizers/(organizer)/teams/(team)/members/

Returns a list of all members of a team.

Example request:

GET /api/v1/organizers/bigevents/teams/1/members/ 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": [
    {
      "id": 1,
      "fullname": "John Doe",
      "email": "john@example.com",
      "require_2fa": true
    }
  ]
}
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

  • team – The id field of the team to fetch

Status Codes:
GET /api/v1/organizers/(organizer)/teams/(team)/members/(id)/

Returns information on one team member, identified by their ID.

Example request:

GET /api/v1/organizers/bigevents/teams/1/members/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,
  "fullname": "John Doe",
  "email": "john@example.com",
  "require_2fa": true
}
Parameters:
  • organizer – The slug field of the organizer to fetch

  • team – The id field of the team to fetch

  • id – The id field of the member to fetch

Status Codes:
DELETE /api/v1/organizers/(organizer)/teams/(team)/members/(id)/

Removes a member from the team.

Example request:

DELETE /api/v1/organizers/bigevents/teams/1/members/1/ HTTP/1.1
Host: pretix.eu

Example response:

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

  • team – The id field of the team to modify

  • id – The id field of the member to delete

Status Codes:

Team invite endpoints

GET /api/v1/organizers/(organizer)/teams/(team)/invites/

Returns a list of all invitations to a team.

Example request:

GET /api/v1/organizers/bigevents/teams/1/invites/ 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": [
    {
      "id": 1,
      "email": "john@example.com"
    }
  ]
}
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

  • team – The id field of the team to fetch

Status Codes:
GET /api/v1/organizers/(organizer)/teams/(team)/invites/(id)/

Returns information on one invite, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/teams/1/invites/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,
  "email": "john@example.org"
}
Parameters:
  • organizer – The slug field of the organizer to fetch

  • team – The id field of the team to fetch

  • id – The id field of the invite to fetch

Status Codes:
POST /api/v1/organizers/(organizer)/teams/(team)/invites/

Invites someone into the team. Note that if the user already has a pretix account, you will receive a response without an id and instead of an invite being created, the user will be directly added to the team.

Example request:

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

{
  "email": "mark@example.org"
}

Example response:

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

{
  "id": 1,
  "email": "mark@example.org"
}
Parameters:
  • organizer – The slug field of the organizer to modify

  • team – The id field of the team to modify

Status Codes:
DELETE /api/v1/organizers/(organizer)/teams/(team)/invites/(id)/

Revokes an invite.

Example request:

DELETE /api/v1/organizers/bigevents/teams/1/invites/1/ HTTP/1.1
Host: pretix.eu

Example response:

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

  • team – The id field of the team to modify

  • id – The id field of the invite to delete

Status Codes:

Team API token endpoints

GET /api/v1/organizers/(organizer)/teams/(team)/tokens/

Returns a list of all API tokens of a team.

Example request:

GET /api/v1/organizers/bigevents/teams/1/tokens/ 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": [
    {
      "id": 1,
      "active": true,
      "name": "Test token"
    }
  ]
}
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

  • team – The id field of the team to fetch

Status Codes:
GET /api/v1/organizers/(organizer)/teams/(team)/tokens/(id)/

Returns information on one token, identified by its ID.

Example request:

GET /api/v1/organizers/bigevents/teams/1/tokens/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,
  "active": true,
  "name": "Test token"
}
Parameters:
  • organizer – The slug field of the organizer to fetch

  • team – The id field of the team to fetch

  • id – The id field of the token to fetch

Status Codes:
POST /api/v1/organizers/(organizer)/teams/(team)/tokens/

Creates a new token.

Example request:

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

{
  "name": "New token"
}

Example response:

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

{
  "id": 2,
  "name": "New token",
  "active": true,
  "token": "",
}
Parameters:
  • organizer – The slug field of the organizer to modify

  • team – The id field of the team to create a token for

Status Codes:
DELETE /api/v1/organizers/(organizer)/teams/(team)/tokens/(id)/

Disables a token.

Example request:

DELETE /api/v1/organizers/bigevents/teams/1/tokens/1/ HTTP/1.1
Host: pretix.eu

Example response:

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

{
  "id": 1,
  "name": "My token",
  "active": false
}
Parameters:
  • organizer – The slug field of the organizer to modify

  • team – The id field of the team to modify

  • id – The id field of the token to delete

Status Codes: