Platform API › Users

GET /users

Retrieves all users on the platform. Users are always listed by creation date (descending order).

Resource URL

https://api.toornament.com/platform/v2/users

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform:user scope (see Authorization)

  • Range
    string

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

    Example: users=0-49

Query Parameters

  • enabled
    integer

    Whether the participant is enabled.

    Possible values: 0, 1

  • created_before
    string

    A datetime to include all users created before or at the datetime in RFC 3339 format (combined date, time and utc offset).

    Format: datetime

    Example: 2023-07-18T00:00:00+00:00

  • created_after
    string

    A datetime to include all users created after or at the datetime in RFC 3339 format (combined date, time and utc offset).

    Format: datetime

    Example: 2023-07-18T00:00:00+00:00

  • provider_type
    string

    Only return users associated with the given provider type.

    Example: discord

  • provider_identifiers
    array

    A list of identifiers for the provider type.

    Example: 80351110224678912,80351110224678913

Request Body

This endpoint does not require a request body.

Response

[200] Success

Example
[
    {
        "id": "475141143408399456",
        "nickname": "Pokap",
        "email": "[email protected]",
        "enabled": true,
        "two_factor_auth_enabled": true,
        "timezone": "America\/Los_Angeles",
        "locale": "en_US",
        "providers": [
            {
                "type": "discord",
                "identifier": "80351110224678912"
            }
        ],
        "expired_at": null,
        "created_at": "2023-07-18T00:00:00+00:00",
        "custom_fields": {}
    }
]
Structure (collection)
  • id
    string

    Unique identifier of the user.

    Example: "475141143408399456"

  • nickname
    string

    Nickname of the user.

    Max. length: 40 characters

    Example: "Pokap"

  • email
    string

    Email of the user.

    Max. length: 254 characters

    Example: "[email protected]"

  • enabled
    boolean

    Whether the user is enabled. A disabled user still exists but can no longer log in.

    Example: true

  • two_factor_auth_enabled
    boolean

    Whether the two-factor authentication is enabled.

    Example: true

  • timezone
    string|null

    Time zone from the IANA tz database. For more information, please read the Time Zones documentation.

    Example: "America/Los_Angeles"

  • locale
    string|null

    Locale of the user (combined language ISO 639-1 and country code ISO 3166-1 alpha-2).

    Example: "en_US"

  • providers
    array[object]

    A list of provider identifiers and types associated with this account.

  • expired_at
    string|null

    Date/time on which the user account expires (RFC 3339; combined date, time and utc offset).

    Format: datetime

  • created_at
    string

    Date/time on which the user was created (RFC 3339; combined date, time and utc offset).

    Format: datetime

    Example: "2023-07-18T00:00:00+00:00"

  • custom_fields
    object

    Values of the custom fields configured on the platform using the machine names as keys. For more information, please read the Custom Fields documentation.

    Example: {}

GET /users/{id}

Returns a single user on the platform.

Resource URL

https://api.toornament.com/platform/v2/users/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform:user scope (see Authorization)

Path parameters

  • id
    string

    The id of the requested user.

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": "475141143408399456",
    "nickname": "Pokap",
    "email": "[email protected]",
    "enabled": true,
    "two_factor_auth_enabled": true,
    "timezone": "America\/Los_Angeles",
    "locale": "en_US",
    "providers": [
        {
            "type": "discord",
            "identifier": "80351110224678912"
        }
    ],
    "expired_at": null,
    "created_at": "2023-07-18T00:00:00+00:00",
    "custom_fields": {}
}
Structure (object)
  • id
    string

    Unique identifier of the user.

    Example: "475141143408399456"

  • nickname
    string

    Nickname of the user.

    Max. length: 40 characters

    Example: "Pokap"

  • email
    string

    Email of the user.

    Max. length: 254 characters

    Example: "[email protected]"

  • enabled
    boolean

    Whether the user is enabled. A disabled user still exists but can no longer log in.

    Example: true

  • two_factor_auth_enabled
    boolean

    Whether the two-factor authentication is enabled.

    Example: true

  • timezone
    string|null

    Time zone from the IANA tz database. For more information, please read the Time Zones documentation.

    Example: "America/Los_Angeles"

  • locale
    string|null

    Locale of the user (combined language ISO 639-1 and country code ISO 3166-1 alpha-2).

    Example: "en_US"

  • providers
    array[object]

    A list of provider identifiers and types associated with this account.

  • expired_at
    string|null

    Date/time on which the user account expires (RFC 3339; combined date, time and utc offset).

    Format: datetime

  • created_at
    string

    Date/time on which the user was created (RFC 3339; combined date, time and utc offset).

    Format: datetime

    Example: "2023-07-18T00:00:00+00:00"

  • custom_fields
    object

    Values of the custom fields configured on the platform using the machine names as keys. For more information, please read the Custom Fields documentation.

    Example: {}

PATCH /users/{id}

Update a single user on the platform.

Resource URL

https://api.toornament.com/platform/v2/users/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform:user scope (see Authorization)

Path parameters

  • id
    string

    The id of the requested user.

Query Parameters

  • custom_field_required
    integer

    Whether the custom fields configured as required should be required during this request.

    Possible values: 0, 1

    Default: 0

Request Body

Data to provide to update a user.

Example
{
    "nickname": "Pokap",
    "email": "[email protected]",
    "enabled": true,
    "two_factor_auth_enabled": true,
    "timezone": "America\/Los_Angeles",
    "locale": "en_US",
    "custom_fields": {}
}
Structure (object)
  • nickname
    string

    Optional

    Nickname of the user.

    Max. length: 40 characters

    Example: "Pokap"

  • email
    string

    Optional

    Email of the user.

    Max. length: 254 characters

    Example: "[email protected]"

  • enabled
    boolean

    Optional

    Whether the user is enabled. A disabled user still exists but can no longer log in.

    Example: true

  • expired_at
    string|null

    Optional

    Date/time on which the user account expires (RFC 3339; combined date, time and utc offset).

    Format: datetime

  • two_factor_auth_enabled
    boolean

    Optional

    Whether the two-factor authentication is enabled.

    Example: true

  • timezone
    string|null

    Optional

    Time zone from the IANA tz database. For more information, please read the Time Zones documentation.

    Example: "America/Los_Angeles"

  • locale
    string|null

    Optional

    Locale of the user (combined language ISO 639-1 and country code ISO 3166-1 alpha-2).

    Example: "en_US"

  • custom_fields
    object

    Optional

    Values of the custom fields configured on the platform using the machine names as keys. For more information, please read the Custom Fields documentation.

    Example: {}

Response

[200] Success.

Example
{
    "id": "475141143408399456",
    "nickname": "Pokap",
    "email": "[email protected]",
    "enabled": true,
    "two_factor_auth_enabled": true,
    "timezone": "America\/Los_Angeles",
    "locale": "en_US",
    "providers": [
        {
            "type": "discord",
            "identifier": "80351110224678912"
        }
    ],
    "expired_at": null,
    "created_at": "2023-07-18T00:00:00+00:00",
    "custom_fields": {}
}
Structure (object)
  • id
    string

    Unique identifier of the user.

    Example: "475141143408399456"

  • nickname
    string

    Nickname of the user.

    Max. length: 40 characters

    Example: "Pokap"

  • email
    string

    Email of the user.

    Max. length: 254 characters

    Example: "[email protected]"

  • enabled
    boolean

    Whether the user is enabled. A disabled user still exists but can no longer log in.

    Example: true

  • two_factor_auth_enabled
    boolean

    Whether the two-factor authentication is enabled.

    Example: true

  • timezone
    string|null

    Time zone from the IANA tz database. For more information, please read the Time Zones documentation.

    Example: "America/Los_Angeles"

  • locale
    string|null

    Locale of the user (combined language ISO 639-1 and country code ISO 3166-1 alpha-2).

    Example: "en_US"

  • providers
    array[object]

    A list of provider identifiers and types associated with this account.

  • expired_at
    string|null

    Date/time on which the user account expires (RFC 3339; combined date, time and utc offset).

    Format: datetime

  • created_at
    string

    Date/time on which the user was created (RFC 3339; combined date, time and utc offset).

    Format: datetime

    Example: "2023-07-18T00:00:00+00:00"

  • custom_fields
    object

    Values of the custom fields configured on the platform using the machine names as keys. For more information, please read the Custom Fields documentation.

    Example: {}

DELETE /users/{id}

Delete a user on the platform.

Resource URL

https://api.toornament.com/platform/v2/users/{id}

HTTP headers

  • X-Api-Key
    string

    API key of your application (see Authentication)

  • Authorization
    string

    Access token with platform:user scope (see Authorization)

Path parameters

  • id
    string

    The id of the requested user.

Query Parameters

This endpoint does not have any query parameters.

Request Body

This endpoint does not require a request body.

Response

[204] Success