mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
* Data model draft * Refactor query and assignment usages of old permissions * Backend UI * API serializer * Big string replace * Docs, tests and fixes for teams api * Update docs for device auth * Eliminate old names * Make tests pass * Use new permissions, remove inconsistencies * Add test for translations * Show plugin permissions * Add permission for seating plans * Fix plugin activation * Fix failing test * Refactor to permission groups * Update doc/api/resources/devices.rst Co-authored-by: luelista <weller@rami.io> * Update doc/api/resources/events.rst Co-authored-by: luelista <weller@rami.io> * Update src/pretix/api/serializers/organizer.py Co-authored-by: luelista <weller@rami.io> * Fix typo * Fix python version compat * Replacement after rebase * Add proper permission handling for exports * Docs for exporters * Runtime linting of permission names * Fix typos * Show export page even without orders permission * More legacy compat * Do not strongly validate before plugins are loaded * Rebase migration * Add permission for outgoing mails * Review notes * Update doc/api/resources/teams.rst Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * Clean up logic around exporters * Review and failures * Fix migration leading to forbidden combination * Handle permissions on event copying * Remove print-statements * Make test clearer * Review feedback * Add AnyPermissionOf * migration safety --------- Co-authored-by: luelista <weller@rami.io> Co-authored-by: Richard Schreiber <schreiber@pretix.eu>
262 lines
8.6 KiB
ReStructuredText
262 lines
8.6 KiB
ReStructuredText
Organizers
|
|
==========
|
|
|
|
Resource description
|
|
--------------------
|
|
|
|
An organizers is an entity running any number of events. In pretix, every event belongs to one
|
|
organizer and various settings, such as teams and permissions, are managed on organizer level.
|
|
|
|
The organizer resource contains the following public fields:
|
|
|
|
.. rst-class:: rest-resource-table
|
|
|
|
===================================== ========================== =======================================================
|
|
Field Type Description
|
|
===================================== ========================== =======================================================
|
|
name string The organizer's full name, i.e. the name of an
|
|
organization or company.
|
|
slug string A short form of the name, used e.g. in URLs.
|
|
public_url string The public, customer-facing URL of the organizer, where
|
|
the list of all events can be found (read-only).
|
|
plugins list A list of package names of the enabled plugins for this
|
|
organizer. Note that most plugins are enabled on the
|
|
event level (or both levels). If you remove a plugin
|
|
that is also enabled on some events, it will
|
|
automatically be removed from all events as well.
|
|
===================================== ========================== =======================================================
|
|
|
|
|
|
Endpoints
|
|
---------
|
|
|
|
.. http:get:: /api/v1/organizers/
|
|
|
|
Returns a list of all organizers the authenticated user/token has access to.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
GET /api/v1/organizers/ HTTP/1.1
|
|
Host: pretix.eu
|
|
Accept: application/json, text/javascript
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Vary: Accept
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"count": 1,
|
|
"next": null,
|
|
"previous": null,
|
|
"results": [
|
|
{
|
|
"name": "Big Events LLC",
|
|
"slug": "Big Events",
|
|
"public_url": "https://pretix.eu/bigevents/",
|
|
"plugins": [
|
|
"pretix_datev"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
|
|
:query page: The page number in case of a multi-page result set, default is 1
|
|
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``slug`` and
|
|
``name``. Default: ``slug``.
|
|
:statuscode 200: no error
|
|
:statuscode 401: Authentication failure
|
|
|
|
.. http:get:: /api/v1/organizers/(organizer)/
|
|
|
|
Returns information on one organizer account, identified by its slug.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
GET /api/v1/organizers/bigevents/ HTTP/1.1
|
|
Host: pretix.eu
|
|
Accept: application/json, text/javascript
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Vary: Accept
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"name": "Big Events LLC",
|
|
"slug": "Big Events",
|
|
"public_url": "https://pretix.eu/bigevents/",
|
|
"plugins": [
|
|
"pretix_datev"
|
|
]
|
|
}
|
|
|
|
:param organizer: The ``slug`` field of the organizer to fetch
|
|
:statuscode 200: no error
|
|
:statuscode 401: Authentication failure
|
|
:statuscode 403: The requested organizer does not exist **or** you have no permission to view it.
|
|
|
|
.. http:patch:: /api/v1/organizers/(organizer)/
|
|
|
|
Updates an organizer. Currently only the ``plugins`` field may be updated.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
PATCH /api/v1/organizers/bigevents/ HTTP/1.1
|
|
Host: pretix.eu
|
|
Accept: application/json, text/javascript
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"plugins": [
|
|
"pretix_seating"
|
|
]
|
|
}
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Vary: Accept
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"name": "Big Events LLC",
|
|
"slug": "Big Events",
|
|
"public_url": "https://pretix.eu/bigevents/",
|
|
"plugins": [
|
|
"pretix_seating"
|
|
]
|
|
}
|
|
|
|
:param organizer: The ``slug`` field of the organizer to update
|
|
:statuscode 200: no error
|
|
:statuscode 400: The organizer could not be updated due to invalid submitted data.
|
|
:statuscode 401: Authentication failure
|
|
:statuscode 403: The requested organizer does not exist **or** you have no permission to update this resource.
|
|
|
|
Organizer settings
|
|
------------------
|
|
|
|
pretix organizers and events have lots and lots of parameters of different types that are stored in a key-value store on our system.
|
|
Since many of these settings depend on each other in complex ways, we can not give direct access to all of these
|
|
settings through the API. However, we do expose many of the simple and useful flags through the API.
|
|
|
|
Please note that the available settings flags change between pretix versions, and we do not give a guarantee on backwards-compatibility like with other parts of the API.
|
|
Therefore, we're also not including a list of the options here, but instead recommend to look at the endpoint output
|
|
to see available options. The ``explain=true`` flag enables a verbose mode that provides you with human-readable
|
|
information about the properties.
|
|
|
|
.. note:: Please note that this is not a complete representation of all organizer settings. You will find more settings
|
|
in the web interface.
|
|
|
|
.. warning:: This API is intended for advanced users. Even though we take care to validate your input, you will be
|
|
able to break your shops using this API by creating situations of conflicting settings. Please take care.
|
|
|
|
.. http:get:: /api/v1/organizers/(organizer)/settings/
|
|
|
|
Get current values of organizer settings.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
GET /api/v1/organizers/bigevents/settings/ HTTP/1.1
|
|
Host: pretix.eu
|
|
Accept: application/json, text/javascript
|
|
|
|
**Example standard response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Vary: Accept
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"event_list_type": "calendar",
|
|
…
|
|
}
|
|
|
|
**Example verbose response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Vary: Accept
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"event_list_type":
|
|
{
|
|
"value": "calendar",
|
|
"label": "Default overview style",
|
|
"readonly": false,
|
|
"help_text": "If your event series has more than 50 dates in the future, only the month or week calendar can be used."
|
|
}
|
|
},
|
|
…
|
|
}
|
|
|
|
:param organizer: The ``slug`` field of the organizer to access
|
|
:query explain: Set to ``true`` to enable verbose response mode
|
|
:statuscode 200: no error
|
|
:statuscode 401: Authentication failure
|
|
:statuscode 403: The requested organizer does not exist **or** you have no permission to view this resource.
|
|
|
|
.. http:patch:: /api/v1/organizers/(organizer)/settings/
|
|
|
|
Updates organizer settings. Note that ``PUT`` is not allowed here, only ``PATCH``.
|
|
|
|
.. warning::
|
|
|
|
Settings can be stored at different levels in pretix. If a value is not set on organizer level, a default setting
|
|
from a higher level (global) will be returned. If you explicitly set a setting on organizer level, it
|
|
will no longer be inherited from the higher levels. Therefore, we recommend you to send only settings that you
|
|
explicitly want to set on organizer level. To unset a settings, pass ``null``.
|
|
|
|
**Example request**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
PATCH /api/v1/organizers/bigevents/settings/ HTTP/1.1
|
|
Host: pretix.eu
|
|
Accept: application/json, text/javascript
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"event_list_type": "calendar"
|
|
}
|
|
|
|
**Example response**:
|
|
|
|
.. sourcecode:: http
|
|
|
|
HTTP/1.1 200 OK
|
|
Vary: Accept
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"event_list_type": "calendar",
|
|
…
|
|
}
|
|
|
|
:param organizer: The ``slug`` field of the organizer to update
|
|
:statuscode 200: no error
|
|
:statuscode 400: The organizer could not be updated due to invalid submitted data.
|
|
:statuscode 401: Authentication failure
|
|
:statuscode 403: The requested organizer does not exist **or** you have no permission to create this resource.
|