Creating multiple Service Accounts/ Tokens (via the API) for individual organisations

  • What Grafana version and what operating system are you using?
    Grafana v10.0.3 (eb8dd72637)

  • What are you trying to achieve?
    Create an token for admin access to a single Grafana organisation

  • How are you trying to achieve it?
    I have create a new “admin” account for the Grafana instance I’m testing on.
    I’m using that account to call the Service Account and Tokens API’s.
    First I create the service account, and then I create the tokens.

  • What happened?
    It works but the service account only appears in the admin users default organisation.

  • What did you expect to happen?
    I would like to specify the orgId on the Service Account and have the Service Account created in that organisation.

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No, the service account is created - it’s just in the wrong organisation.

  • Did you follow any online instructions? If so, what is the URL?
    Service account HTTP API | Grafana documentation

I suspect I am missing something, but nothing in the documentation suggests what it is or how I fix it - I’d be very happy if this was just a documentation problem!

Yep. It was a documentation issue.

This allows you to switch the context for the signed in user to a different organisation.