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

    A unique identifier of the tournament.

Query Parameters

  • target_type
    string

    Possible values: player, team, team_player

Request Body

This endpoint doesn't require a request body.

Response

[200] Success

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

    A unique identifier for the custom-field

    Example: "128114939547269789"

  • machine_name
    string

    A name used to identify a custom field for computing purposes (maximum 255 characters, accepts only "a-z0-9_" characters)

    Example: "my_steam_id"

  • label
    string

    A name used in forms to display a custom field (maximum 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

  • default_value
    mixed

    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 values of the custom field are public

    Example: false

  • position
    integer

    An ordering position used in forms

    Example: 5

POST /tournaments/{tournament_id}/custom-fields

Authorized Access

Create a custom-field for a tournament. You can not exceed 128 custom-fields in total for 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)

Query Parameters

This endpoint doesn't have any query parameters.

Request Body

Data to provide for create the custom-field.

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

    A name used to identify a custom field for computing purposes (maximum 255 characters, accepts only "a-z0-9_" characters)

    Example: "my_steam_id"

  • label
    string

    A name used in forms to display a custom field (maximum 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, by default is team or player.

    Possible values: player, team, team_player

  • default_value
    mixed

    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 values of the custom field are public

    Example: false

  • position
    integer

    Optional

    An ordering position used in forms

    Example: 5

Response

[201] Success

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

    A unique identifier for the custom-field

    Example: "128114939547269789"

  • machine_name
    string

    A name used to identify a custom field for computing purposes (maximum 255 characters, accepts only "a-z0-9_" characters)

    Example: "my_steam_id"

  • label
    string

    A name used in forms to display a custom field (maximum 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

  • default_value
    mixed

    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 values of the custom field are public

    Example: false

  • position
    integer

    An ordering position used in forms

    Example: 5

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

Authorized Access

Returns a custom field by the given id.

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

    A unique identifier of the tournament.

  • id
    string

    The id of the requested custom-field.

Query Parameters

This endpoint doesn't have any query parameters.

Request Body

This endpoint doesn't require a request body.

Response

[200] Success

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

    A unique identifier for the custom-field

    Example: "128114939547269789"

  • machine_name
    string

    A name used to identify a custom field for computing purposes (maximum 255 characters, accepts only "a-z0-9_" characters)

    Example: "my_steam_id"

  • label
    string

    A name used in forms to display a custom field (maximum 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

  • default_value
    mixed

    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 values of the custom field are public

    Example: false

  • position
    integer

    An ordering position used in forms

    Example: 5

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

    A unique identifier of the tournament.

  • id
    string

    The id of the requested custom-field.

Query Parameters

This endpoint doesn't 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

    A name used in forms to display a custom field (maximum 255 characters)

    Example: "My Steam ID"

  • default_value
    mixed

    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 values of the custom field are public

    Example: false

  • position
    integer

    An ordering position used in forms

    Example: 5

Response

[200] Success

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

    A unique identifier for the custom-field

    Example: "128114939547269789"

  • machine_name
    string

    A name used to identify a custom field for computing purposes (maximum 255 characters, accepts only "a-z0-9_" characters)

    Example: "my_steam_id"

  • label
    string

    A name used in forms to display a custom field (maximum 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

  • default_value
    mixed

    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 values of the custom field are public

    Example: false

  • position
    integer

    An ordering position used in forms

    Example: 5

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

    A unique identifier of the tournament.

  • id
    string

    The id of the requested custom-field.

Query Parameters

This endpoint doesn't have any query parameters.

Request Body

This endpoint doesn't require a request body.

Response

[204] Success