How to obtain account_id and workspace_id

Hi. I’m new to prefect. I installed it locally and want to trigger a deployment programmatically via the api.
As described in the docs

I know how to set the API_KEY prefect config set PREFECT_API_KEY='foobar', but I don’t know how to obtain the account_id and workspace_id.

Can this only be obtained using prefect cloud?