Thread
#prefect-community
    t

    Tim Wright

    7 months ago
    Hey community. I was hoping someone could help with a way to generate API Keys from a single admin account? As part of our deployment, we're trying to limit the number of manual steps and would like to be able to create API Keys for our Service Accounts using an automated script. Is this possible? (We're using Prefect Cloud) Thanks in advance for the help.
    Anna Geller

    Anna Geller

    7 months ago
    You would need to use GraphQL mutation called
    create_api_key
    for this, it’s definitely possible. If you can’t figure out the mutation syntax, LMK and we can certainly help
    t

    Tim Wright

    7 months ago
    Thanks Anna - I was messing around with that at the end of last week tryin to query
    users
    without much luck. Just a few minutes ago I was able to find the
    user_view_same_tenant
    which appears to return the SA user information. From there it was pretty straightforward using
    create_api_key
    . Thanks for the super fast response.
    Anna Geller

    Anna Geller

    7 months ago
    nice work figuring that out with the query, GraphQL inputs can be challenging sometimes