Custom Fields

GET /tournaments/{tournament_id}/custom-fields

Authorized Access

Returns the complete definition of all custom fields for a given tournament. This includes both public and private custom fields. A custom field may be associated to a player, a team or a team's player. For more information, please read the Custom Fields documentation.

Resource URL

https://api.toornament.com/organizer/v2/tournaments/{tournament_id}/custom-fields

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:admin scope (see Authorization)

Path parameters

  • tournament_id
    string

    The id of the tournament you want to retrieve data about.

Query Parameters

  • target_type
    string

    The entity affected by the custom fields.

    Possible values: player, team, team_player

    Example: team

Request Body

This endpoint does not require a request body.

Response

[200] Success

Example
[
    {
        "label": "My Steam ID",
        "default_value": "#steam_id",
        "required": false,
        "public": false,
        "position": 5,
        "machine_name": "my_steam_id",
        "type": "steam_player_id",
        "target_type": "player",
        "id": 128114939547269789
    }
]
Structure (collection)
  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    The position of the field in forms.

    Example: 5

  • machine_name
    string

    A name used to identify a custom field for computing purposes.

    Pattern: ^[a-z0-9_]+$

    Max. length: 255 characters

    Example: "my_steam_id"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

POST /tournaments/{tournament_id}/custom-fields

Authorized Access

Create a new custom field in a tournament. You can not have more than 128 custom fields in a tournament.

Resource URL

https://api.toornament.com/organizer/v2/tournaments/{tournament_id}/custom-fields

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:admin scope (see Authorization)

Path parameters

  • tournament_id
    string

    The id of the tournament you want to retrieve data about.

Query Parameters

This endpoint does not have any query parameters.

Request Body

Data to provide for create the custom field.

Example
{
    "label": "My Steam ID",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "machine_name": "my_steam_id",
    "type": "steam_player_id",
    "target_type": "player"
}
Structure (object)
  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    Optional

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Optional

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Optional

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    Optional

    The position of the field in forms.

    Example: 5

  • machine_name
    string

    A name used to identify a custom field for computing purposes.

    Pattern: ^[a-z0-9_]+$

    Max. length: 255 characters

    Example: "my_steam_id"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

  • target_type
    string

    Optional

    The entity concerned by the custom field.

    Possible values: player, team, team_player

Response

[201] Success.

Example
{
    "label": "My Steam ID",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "machine_name": "my_steam_id",
    "type": "steam_player_id",
    "target_type": "player",
    "id": 128114939547269789
}
Structure (object)
  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    The position of the field in forms.

    Example: 5

  • machine_name
    string

    A name used to identify a custom field for computing purposes.

    Pattern: ^[a-z0-9_]+$

    Max. length: 255 characters

    Example: "my_steam_id"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

GET /tournaments/{tournament_id}/custom-fields/{id}

Authorized Access

Returns a single custom field of a tournament.

Resource URL

https://api.toornament.com/organizer/v2/tournaments/{tournament_id}/custom-fields/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:admin scope (see Authorization)

Path parameters

  • tournament_id
    string

    The id of the tournament you want to retrieve data about.

  • id
    string

    The id of the requested custom field.

Query Parameters

This endpoint does not have any query parameters.

Request Body

This endpoint does not require a request body.

Response

[200] Success

Example
{
    "label": "My Steam ID",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "machine_name": "my_steam_id",
    "type": "steam_player_id",
    "target_type": "player",
    "id": 128114939547269789
}
Structure (object)
  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    The position of the field in forms.

    Example: 5

  • machine_name
    string

    A name used to identify a custom field for computing purposes.

    Pattern: ^[a-z0-9_]+$

    Max. length: 255 characters

    Example: "my_steam_id"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

PATCH /tournaments/{tournament_id}/custom-fields/{id}

Authorized Access

Update a single custom field of a tournament.

Resource URL

https://api.toornament.com/organizer/v2/tournaments/{tournament_id}/custom-fields/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:admin scope (see Authorization)

Path parameters

  • tournament_id
    string

    The id of the tournament you want to retrieve data about.

  • id
    string

    The id of the requested custom field.

Query Parameters

This endpoint does not have any query parameters.

Request Body

Data to provide for update the custom field.

Example
{
    "label": "My Steam ID",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5
}
Structure (object)
  • label
    string

    Optional

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    Optional

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Optional

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Optional

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    Optional

    The position of the field in forms.

    Example: 5

Response

[200] Success.

Example
{
    "label": "My Steam ID",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "machine_name": "my_steam_id",
    "type": "steam_player_id",
    "target_type": "player",
    "id": 128114939547269789
}
Structure (object)
  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    A default value (can be array, scalar or null).

    Example: #steam_id

  • required
    boolean

    Whether the custom field is required.

    Example: false

  • public
    boolean

    Whether the value of the custom field is public.

    Example: false

  • position
    integer

    The position of the field in forms.

    Example: 5

  • machine_name
    string

    A name used to identify a custom field for computing purposes.

    Pattern: ^[a-z0-9_]+$

    Max. length: 255 characters

    Example: "my_steam_id"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

DELETE /tournaments/{tournament_id}/custom-fields/{id}

Authorized Access

Delete a custom field of a tournament.

Resource URL

https://api.toornament.com/organizer/v2/tournaments/{tournament_id}/custom-fields/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with organizer:admin scope (see Authorization)

Path parameters

  • tournament_id
    string

    The id of the tournament you want to retrieve data about.

  • id
    string

    The id of the requested custom field.

Query Parameters

This endpoint does not have any query parameters.

Request Body

This endpoint does not require a request body.

Response

[204] Success