Skip to content

Creator

rblxopencloud.Asset

Represents an uploaded and processed asset on Roblox.

Warning

This class isn't designed to be created by users. It is returned by Creator.upload_asset(), and Creator.update_asset().

Attributes:

Name Type Description
id int

The ID of the asset.

type AssetType

The type of the asset.

name str

The asset's name.

description str

The asset's description.

creator Union[User, Group]

The rblxopencloud.User and rblxopencloud.Group the asset was uploaded to.

revision_id Optional[int]

The ID of the current revision (only for updatable assets).

revision_time Optional[datetime]

The timestamp the current revision was made (only for updatable assets).

rblxopencloud.PendingAsset

Represents an asset uploaded to Roblox, but hasn't been processed yet.

Warning

This class isn't designed to be created by users. It is returned by Creator.upload_asset(), and Creator.update_asset().

fetch_operation()

Checks if the asset has finished proccessing, if so returns the asset's rblxopencloud.Asset object.

Returns:

Type Description
Optional[Asset]

If it has finished processing it'll return the asset's rblxopencloud.Asset object, otherwise it'll return None.

Raises:

Type Description
InvalidKey

The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address.

RateLimited

You've exceeded the rate limits.

ServiceUnavailable

The Roblox servers ran into an error, or are unavailable right now.

rblx_opencloudException

Roblox returned an unexpected error.

rblxopencloud.Creator

Represents a base object that assets can be uploaded to, such as users or groups.

Warning

This class isn't designed to be created by users. It bases rblxopencloud.User(), and rblxopencloud.Group().

Attributes:

Name Type Description
id int

The user/group ID.

upload_asset(file, asset_type, name, description, expected_robux_price=0)

Uploads the file requested file onto roblox as an asset with the provided name and description. The following asset types and file formats are accepted:

Asset Type File Formats
rblxopencloud.AssetType.Decal .png, .jpeg, .bmp, .tga
rblxopencloud.AssetType.Audio .mp3, .ogg
rblxopencloud.AssetType.Model .fbx

The asset:read and asset:write scopes are required for OAuth2 authorization.

Example

You can upload a file stored on your computer like this:

with open('path-to/file.png', 'rb') as file:
    creator.upload_asset(file, AssetType.Decal, "Asset Name", "This is the description")

if not isinstance(asset, Asset):
    while True:
        status = asset.fetch_status()
        if status: 
            asset = status
            break

print(asset)
If the asset is from hosted from a URL on the internet, you could use this:
import requests, io

response = requests.get('https://example.com/file.png')
response.raise_for_status()

file = io.BytesIO(response.content)
file.name = "file.png"

creator.upload_asset(file, AssetType.Decal, "Asset Name", "This is the description")

Parameters:

Name Type Description Default
file BytesIO

The file opened in bytes to be uploaded.

required
asset_type Union[AssetType, str]

The type of asset you're uploading.

required
name str

The name of your asset.

required
description str

The description of your asset.

required
expected_robux_price int

The amount of robux expected to upload. Fails if lower than actual price.

0

Returns:

Type Description
Union[Asset, PendingAsset]

Returns rblxopencloud.Asset if the asset is processed instantly, otherwise it will return rblxopencloud.PendingAsset`.

Raises:

Type Description
InvalidAsset

The file is either an unsupported type, uploaded as the wrong rblxopencloud.AssetType, or has been corrupted.

ModeratedText

The name or description was moderated by Roblox's text filter.

InvalidKey

The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address.

RateLimited

You've exceeded the rate limits.

ServiceUnavailable

The Roblox servers ran into an error, or are unavailable right now.

rblx_opencloudException

Roblox returned an unexpected error.

Danger

Avoid uploading assets to Roblox that you don't have full control over, such as AI generated assets or content created by unknown people. Assets uploaded that break Roblox's Terms of Services can get your account moderated.

For OAuth2 developers, it has been confirmed by Roblox staff in this DevForum post, that your app will not be punished if a malicious user uses it to upload Terms of Service violating content, and instead the authorizing user's account will be punished.

update_asset(asset_id, file)

Uploads the file requested file onto roblox, replacing the existing asset. The following asset types and file formats can be updated:

Asset Type File Formats
rblxopencloud.AssetType.Model .fbx

The asset:read and asset:write scopes are required for OAuth2 authorization.

Parameters:

Name Type Description Default
asset_id int

The ID of the asset to update.

required
file BytesIO

The file opened in bytes to be replace the old one.

required

Returns:

Type Description
Union[Asset, PendingAsset]

Returns rblxopencloud.Asset if the asset is processed instantly, otherwise it will return rblxopencloud.PendingAsset`.

Raises:

Type Description
InvalidAsset

The file is either an unsupported type, uploaded as the wrong rblxopencloud.AssetType, or has been corrupted.

ModeratedText

The name or description was moderated by Roblox's text filter.

InvalidKey

The API key isn't valid, doesn't have access to upload assets, or is from an invalid IP address.

RateLimited

You've exceeded the rate limits.

ServiceUnavailable

The Roblox servers ran into an error, or are unavailable right now.

rblx_opencloudException

Roblox returned an unexpected error.

Danger

Avoid uploading assets to Roblox that you don't have full control over, such as AI generated assets or content created by unknown people. Assets uploaded that break Roblox's Terms of Services can get your account moderated.

For OAuth2 developers, it has been confirmed by Roblox staff in this DevForum post, that your app will not be punished if a malicious user uses it to upload Terms of Service violating content, and instead the authorizing user's account will be punished.

rblxopencloud.AssetType

Bases: Enum

Enum denoting what type a rblxopencloud.Asset is.

Attributes:

Name Type Description
Unknown 0

The asset type is unknown.

Decal 1
Audio 2
Model 3