Tournament API › Custom Fields

GET /custom-fields

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/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)

  • Range
    string

    A range of requested items using the custom-fields unit. The size of the range can not exceed 50. (see Pagination)

    Example: custom-fields=0-49

Query Parameters

  • target_type
    string

    The entity affected by the custom fields.

    Possible values: player, team, team_player

    Example: team

  • tournament_ids
    array

    Only return reports for the given list of tournaments.

    Example: 378426939508809728,534138941862841533

Request Body

This endpoint does not require a request body.

Response

[200] Success

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

    The id of tournament.

    Example: "534138941862841533"

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

POST /custom-fields

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/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 does not have any query parameters.

Request Body

Data to provide for create the custom field.

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

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • tournament_id
    string

    The id of tournament.

    Example: "534138941862841533"

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_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

  • options
    object

    Optional

    Options of the custom field.

    Example: {}

Response

[201] Success.

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

    The id of tournament.

    Example: "534138941862841533"

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

GET /custom-fields/{id}

Returns a single custom field of a tournament.

Resource URL

https://api.toornament.com/organizer/v2/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

  • 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
{
    "tournament_id": "534138941862841533",
    "id": "128114939547269789",
    "target_type": "player",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "options": {},
    "machine_name": "my_steam_id",
    "label": "My Steam ID",
    "type": "steam_player_id"
}
Structure (object)
  • tournament_id
    string

    The id of tournament.

    Example: "534138941862841533"

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

PATCH /custom-fields/{id}

Update a single custom field of a tournament.

Resource URL

https://api.toornament.com/organizer/v2/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

  • 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,
    "options": {}
}
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

  • options
    object

    Optional

    Options of the custom field.

    Example: {}

Response

[200] Success.

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

    The id of tournament.

    Example: "534138941862841533"

  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

DELETE /custom-fields/{id}

Delete a custom field of a tournament.

Resource URL

https://api.toornament.com/organizer/v2/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

  • 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

LegacyGET /tournaments/{tournament_id}/custom-fields

This endpoint is in legacy mode. Access will soon be deprecated. It is therefore advised to use another endpoint when possible.

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
[
    {
        "id": "128114939547269789",
        "target_type": "player",
        "default_value": "#steam_id",
        "required": false,
        "public": false,
        "position": 5,
        "options": {},
        "machine_name": "my_steam_id",
        "label": "My Steam ID",
        "type": "steam_player_id"
    }
]
Structure (collection)
  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

LegacyPOST /tournaments/{tournament_id}/custom-fields

This endpoint is in legacy mode. Access will soon be deprecated. It is therefore advised to use another endpoint when possible.

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
{
    "machine_name": "my_steam_id",
    "label": "My Steam ID",
    "type": "steam_player_id",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "options": {},
    "target_type": "player"
}
Structure (object)
  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_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

  • options
    object

    Optional

    Options of the custom field.

    Example: {}

  • target_type
    string

    Optional

    The entity concerned by the custom field.

    Possible values: player, team, team_player

Response

[201] Success.

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

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

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

This endpoint is in legacy mode. Access will soon be deprecated. It is therefore advised to use another endpoint when possible.

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
{
    "id": "128114939547269789",
    "target_type": "player",
    "default_value": "#steam_id",
    "required": false,
    "public": false,
    "position": 5,
    "options": {},
    "machine_name": "my_steam_id",
    "label": "My Steam ID",
    "type": "steam_player_id"
}
Structure (object)
  • id
    string

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

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

This endpoint is in legacy mode. Access will soon be deprecated. It is therefore advised to use another endpoint when possible.

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,
    "options": {}
}
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

  • options
    object

    Optional

    Options of the custom field.

    Example: {}

Response

[200] Success.

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

    The unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    The entity concerned by the custom field.

    Possible values: player, team, team_player

  • 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

  • options
    object

    Options of the custom field.

    Example: {}

  • 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"

  • label
    string

    The display name of a custom field in forms.

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    A data type used for both input and computing.

    Example: "steam_player_id"

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

This endpoint is in legacy mode. Access will soon be deprecated. It is therefore advised to use another endpoint when possible.

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