# prefect-community

Riccardo Tesselli

07/19/2022, 1:16 PM
hello, in Prefect 2.0 I’ve defined a new custom block as described in Once I’ve defined the model, is there a way to upload the definition of the block in Prefect cloud without having to create a block instance from code and the save it? I mean, I want to be able to see in the UI the new custom block definition without having to define a dummy instance of it
and connected to this question, how can I delete from Prefect cloud a definition of a custom block?


07/19/2022, 2:00 PM
Hey @Riccardo Tesselli, great questions! Currently, the best way to register a custom block without saving it is to use the
method. Here’s an example:
Copy code
from prefect.blocks.core import Block

class Custom(Block):
    value: str

Running this script will register the
block for configuration in the UI. We’re working on building out the capability to register blocks via the CLI, so this process should improve in the future. For deleting custom block types, you’ll need to use the REST API for now. Here’s a link to the documentation for the endpoint that handles deleting block types:

Riccardo Tesselli

07/19/2022, 2:33 PM
thank you @alex!
just un update. The code example you provided gave me an error (coro was never awaited). This is how I’ve done:
Copy code

Anna Geller

07/19/2022, 11:18 PM
@Riccardo Tesselli if you wait 1-2 weeks, it's very likely that the CLI for this will already exist
🎉 1