UserRestriction

Represents a restriction on a user.

  • PERCORSI RISORSE
  • /cloud/v2/universes/{universe_id}/user-restrictions
  • /cloud/v2/universes/{universe_id}/places/{place_id}/user-restrictions

Attributi

pathstring

The resource path of the user restriction.

Formats:

  • universes/{universe_id}/user-restrictions/{user_restriction_id}
  • universes/{universe_id}/places/{place_id}/user-restrictions/{user_restriction_id}.
updateTimestring
Solo output

The timestamp when the user restriction was last updated. Questa stringa è formattata come Timestamp.

userstring
Solo output

The affected user.

gameJoinRestrictionobject

The user is banned from the parent universe or place.

URL di base

https://apis.roblox.com
Risorsa UserRestriction

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

List User Restrictions
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions

List user restrictions for users that have ever been banned in either a universe or a specific place.

Campi
universe.user-restriction:read
RichiestaParametri percorso
universe_idstring
Necessario

The universe ID.

Parametri query
maxPageSizenumber

The maximum number of user restrictions to return. The service might return fewer than this value. If unspecified, at most 10 user restrictions are returned. The maximum value is 100 and higher values are set to 100.

pageTokenstring

A page token, received from a previous call, to retrieve a subsequent page.

When paginating, all other parameters provided to the subsequent call must match the call that provided the page token.

filterstring

This field may be set in order to filter the resources returned.

The filter field supports a very small subset of CEL:

  • Only the game_join_restriction.active field is supported.
  • Only the == operator is available; no other operators nor built-ins are supported.

Example filter: game_join_restriction.active == "true".

Risposta

A list of UserRestrictions in the parent collection.

userRestrictionsarray<UserRestriction>

The UserRestrictions from the specified Universe or Place.

nextPageTokenstring

A token that you can send as a pageToken parameter to retrieve the next page. If this field is omitted, there are no subsequent pages.

GET /cloud/v2/universes/{universe_id}/user-restrictions

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions?maxPageSize=10&pageToken={string}&filter={string}' \
-H 'x-api-key: {your-api-key}'
Risposta

{
"userRestrictions": [
{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}
],
"nextPageToken": "string"
}

UserRestriction

Get User Restriction
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

Get the user restriction.

Campi
universe.user-restriction:read
RichiestaParametri percorso
universe_idstring
Necessario

The universe ID.

user_restriction_idstring
Necessario

The user-restriction ID.

GET /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}' \
-H 'x-api-key: {your-api-key}'
Risposta

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

Update User Restriction
Beta

PATCH /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

Update the user restriction.

Campi
universe.user-restriction:write
RichiestaParametri percorso
universe_idstring
Necessario

The universe ID.

user_restriction_idstring
Necessario

The user-restriction ID.

Parametri query
updateMaskstring

The list of fields to update.

The game_join_restriction field must be updated atomically; field masks that index into game_join_restriction (such as "game_join_restriction.active") are not supported. Questa stringa è formattata come Timestamp.

idempotencyKey.keystring

The unique key to use for idempotency.

idempotencyKey.firstSentstring

The timestamp at which the first request was sent.

If this is further in the past than the lifetime of the idempotency key (which may exceed the annotated minimum lifetime), the server must return an error. Questa stringa è formattata come Timestamp.

Corpo della richiestaUserRestriction
PATCH /cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}

curl -L -X PATCH 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions/{user_restriction_id}?updateMask={string}&idempotencyKey.key={string}&idempotencyKey.firstSent={string}' \
-H 'x-api-key: {your-api-key}' \
-H 'Content-Type: application/json' \
--data '{
"gameJoinRestriction": {
"active": true,
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true
}
}'
Risposta

{
"path": "universes/123/user-restrictions/123",
"updateTime": "2023-07-05T12:34:56Z",
"user": "users/156",
"gameJoinRestriction": {
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"excludeAltAccounts": true,
"inherited": true
}
}

UserRestriction

List User Restriction Logs
Beta

GET /cloud/v2/universes/{universe_id}/user-restrictions:listLogs

List changes to UserRestriction resources within a given universe. This includes both universe-level and place-level restrictions.

For universe-level restriction logs, the place field will be empty.

Campi
universe.user-restriction:read
RichiestaParametri percorso
universe_idstring
Necessario

The universe ID.

Parametri query
maxPageSizenumber

The maximum number of UserRestrictionLogs to return. The service may return fewer than this value. If unspecified, at most 10 UserRestrictionLogs are returned. The maximum value is 100 and higher values are set to 100.

pageTokenstring

A page token, received from a previous call, to retrieve a subsequent page.

When paginating, all other parameters provided to the subsequent call must match the call that provided the page token.

filterstring

This field may be set to filter the logs returned.

The filter field supports a very small number of CEL:

  • user
  • place
  • The == comparison operator is available.
  • The && logical operator is also supported.

As an example, filtering for a user and a place takes the form filter="user == 'users/123'" && "place == 'places/456'".

Risposta

Returns a list of change logs applied to UserRestriction resources.

logsarray<object>

The UserRestrictionLogs from the specified Universe.

nextPageTokenstring

A token that you can send as a pageToken parameter to retrieve the next page. If this field is omitted, there are no subsequent pages.

GET /cloud/v2/universes/{universe_id}/user-restrictions:listLogs

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/user-restrictions:listLogs?maxPageSize=10&pageToken={string}&filter={string}' \
-H 'x-api-key: {your-api-key}'
Risposta

{
"logs": [
{
"user": "users/156",
"place": "places/456",
"moderator": {
"robloxUser": "users/156"
},
"createTime": "2023-07-05T12:34:56Z",
"active": true,
"startTime": "2023-07-05T12:34:56Z",
"duration": "3s",
"privateReason": "some private reason",
"displayReason": "some display reason",
"restrictionType": {
"gameJoinRestriction": {}
},
"excludeAltAccounts": true
}
],
"nextPageToken": "string"
}