Platform API › Custom Fields

GET /custom-fields

Returns the complete definition of all custom fields associated to platform users. This includes both public and private custom fields. For more information, please read the Custom Fields documentation.

Resource URL

https://api.toornament.com/platform/v2/custom-fields

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform:admin scope (see Authorization)

Query Parameters

  • target_type
    string

    The entity affected by the custom fields.

    Possible values: user

Request Body

This endpoint does not require a request body.

Response

[200] Success

Example
[
    {
        "id": "128114939547269789",
        "target_type": "user",
        "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

    Unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    Entity affected by the custom field.

    Possible values: user

  • default_value
    mixed|null

    Default value (can be array, scalar or null). The type of value depends on the custom field type.

    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

    Position of the custom field (used for display purposes).

    Example: 5

  • options
    object

    Options of the custom field.

    Example: {}

  • machine_name
    string

    Name used to identify a custom field for computing purposes.

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

    Max. length: 255 characters

    Example: "my_steam_id"

  • label
    string

    Label of a custom field (used for display purposes).

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    Data type used for both input and computing.

    Example: "steam_player_id"

POST /custom-fields

Create a new custom field on the platform. You can not have more than 128 custom fields.

Resource URL

https://api.toornament.com/platform/v2/custom-fields

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform:admin scope (see Authorization)

Query Parameters

This endpoint does not have any query parameters.

Request Body

Data to provide to create a custom field.

Example
{
    "target_type": "user",
    "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

    Entity affected by the custom field.

    Possible values: user

  • machine_name
    string

    Name used to identify a custom field for computing purposes.

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

    Max. length: 255 characters

    Example: "my_steam_id"

  • label
    string

    Label of a custom field (used for display purposes).

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    Data type used for both input and computing.

    Example: "steam_player_id"

  • default_value
    mixed|null

    Optional

    Default value (can be array, scalar or null). The type of value depends on the custom field type.

    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

    Position of the custom field (used for display purposes).

    Example: 5

  • options
    object

    Optional

    Options of the custom field.

    Example: {}

Response

[201] Success.

Example
{
    "id": "128114939547269789",
    "target_type": "user",
    "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

    Unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    Entity affected by the custom field.

    Possible values: user

  • default_value
    mixed|null

    Default value (can be array, scalar or null). The type of value depends on the custom field type.

    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

    Position of the custom field (used for display purposes).

    Example: 5

  • options
    object

    Options of the custom field.

    Example: {}

  • machine_name
    string

    Name used to identify a custom field for computing purposes.

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

    Max. length: 255 characters

    Example: "my_steam_id"

  • label
    string

    Label of a custom field (used for display purposes).

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    Data type used for both input and computing.

    Example: "steam_player_id"

GET /custom-fields/{id}

Returns a single custom field related to the platform.

Resource URL

https://api.toornament.com/platform/v2/custom-fields/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform: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
{
    "id": "128114939547269789",
    "target_type": "user",
    "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

    Unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    Entity affected by the custom field.

    Possible values: user

  • default_value
    mixed|null

    Default value (can be array, scalar or null). The type of value depends on the custom field type.

    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

    Position of the custom field (used for display purposes).

    Example: 5

  • options
    object

    Options of the custom field.

    Example: {}

  • machine_name
    string

    Name used to identify a custom field for computing purposes.

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

    Max. length: 255 characters

    Example: "my_steam_id"

  • label
    string

    Label of a custom field (used for display purposes).

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    Data type used for both input and computing.

    Example: "steam_player_id"

PATCH /custom-fields/{id}

Update a single custom field related to the platform.

Resource URL

https://api.toornament.com/platform/v2/custom-fields/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform: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 to 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

    Label of a custom field (used for display purposes).

    Max. length: 255 characters

    Example: "My Steam ID"

  • default_value
    mixed|null

    Optional

    Default value (can be array, scalar or null). The type of value depends on the custom field type.

    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

    Position of the custom field (used for display purposes).

    Example: 5

  • options
    object

    Optional

    Options of the custom field.

    Example: {}

Response

[200] Success.

Example
{
    "id": "128114939547269789",
    "target_type": "user",
    "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

    Unique identifier of the custom field.

    Example: "128114939547269789"

  • target_type
    string

    Entity affected by the custom field.

    Possible values: user

  • default_value
    mixed|null

    Default value (can be array, scalar or null). The type of value depends on the custom field type.

    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

    Position of the custom field (used for display purposes).

    Example: 5

  • options
    object

    Options of the custom field.

    Example: {}

  • machine_name
    string

    Name used to identify a custom field for computing purposes.

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

    Max. length: 255 characters

    Example: "my_steam_id"

  • label
    string

    Label of a custom field (used for display purposes).

    Max. length: 255 characters

    Example: "My Steam ID"

  • type
    string

    Data type used for both input and computing.

    Example: "steam_player_id"

DELETE /custom-fields/{id}

Delete a custom field related to the platform.

Resource URL

https://api.toornament.com/platform/v2/custom-fields/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform: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