https://prefect.io logo
Title
b

Ben Muller

11/02/2022, 8:52 PM
Is there a way to restrict access for an API Key to only one workspace?
1
k

Kalise Richmond

11/02/2022, 8:54 PM
Yes, at the organization level you can create a service account and then associate it to a single workspace. https://docs.prefect.io/ui/organizations/?query=service+account+#service-accounts
b

Ben Muller

11/02/2022, 8:58 PM
🙏
@Kalise Richmond - now that I have a service account with only access to one workspace - I need to set the
PREFECT_API_URL
env in my ECS environment. How do I find out the user id part of the url ?
<https://api.prefect.cloud/api/accounts/USER_ID/workspaces/WORKSPACE_ID>
r

Ryan Peden

11/02/2022, 9:11 PM
A quick way to find the URL is running
prefect cloud login
locally and after login, run
prefect config view
to see the URL.
b

Ben Muller

11/02/2022, 9:12 PM
so I need to login to my service account?
k

Kalise Richmond

11/02/2022, 9:12 PM
Also I believe it's just the account ID, not the user Id that you need after the
/accounts
b

Ben Muller

11/02/2022, 9:13 PM
yeah but you cant login to a service account - so that is hard to obtain?
r

Ryan Peden

11/02/2022, 9:13 PM
Sorry Ben - I missed where you mentioned it is a service account - my mistake.
b

Ben Muller

11/02/2022, 9:13 PM
or is an account the organisation?
misleading if we are talking about Orgs / Service accounts
k

Kalise Richmond

11/02/2022, 9:13 PM
Account is the organization. The URL at the top of the workspace on the flow runs dashboard should provide you with the account id and workspace id
b

Ben Muller

11/02/2022, 9:14 PM
gotcha