Grafana Orgs API

The Admin Organizations HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission (The default admin user is called `admin` and has permission to use this API).

Operations 14

GET /orgs Search all Organizations #
POST /orgs Create Organization #
GET /orgs/name/{org_name} Get Organization by Name #
GET /orgs/{org_id} Get Organization by ID #
PUT /orgs/{org_id} Update Organization #
DELETE /orgs/{org_id} Delete Organization #
PUT /orgs/{org_id}/address Update Organization's address #
GET /orgs/{org_id}/quotas Fetch Organization quota #
PUT /orgs/{org_id}/quotas/{quota_target} Update user quota #
GET /orgs/{org_id}/users Get Users in Organization #
POST /orgs/{org_id}/users Add a new user to the current organization #
GET /orgs/{org_id}/users/search Search Users in Organization #
DELETE /orgs/{org_id}/users/{user_id} Delete user in current organization #
PATCH /orgs/{org_id}/users/{user_id} Update Users in Organization #

Documentation

📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/
📖
Authentication
https://grafana.com/docs/grafana/latest/developers/http_api/authentication/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard_versions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard_permissions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard_public/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/folder/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/folder_dashboard_search/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/folder_permissions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/data_source/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/datasource_permissions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/datasource_lbac_rules/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/annotations/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/org/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/user/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/team/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/team_sync/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/preferences/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/access_control/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/sso-settings/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/admin/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/licensing/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/reporting/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/query_and_resource_caching/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/library_element/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/correlations/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/snapshot/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/short_url/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/query_history/

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/grafana-com-orgs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

grafana-com-orgs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'The Grafana backend exposes an HTTP API, the same API is used by the frontend to do

    everything from saving dashboards, creating users and updating data sources.'
  title: Grafana HTTP API. Orgs API
  contact:
    name: Grafana Labs
    url: https://grafana.com
    email: hello@grafana.com
  version: 0.0.1
servers:
- url: /api
security:
- basic: []
- api_key: []
tags:
- description: The Admin Organizations HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission (The default admin user is called `admin` and has permission to use this API).
  name: Orgs
paths:
  /orgs:
    get:
      tags:
      - Orgs
      summary: Search all Organizations
      operationId: searchOrgs
      parameters:
      - name: page
        in: query
        schema:
          type: integer
          format: int64
          default: 1
      - description: 'Number of items per page

          The totalCount field in the response can be used for pagination list E.g. if totalCount is equal to 100 teams and the perpage parameter is set to 10 then there are 10 pages of teams.'
        name: perpage
        in: query
        schema:
          type: integer
          format: int64
          default: 1000
      - name: name
        in: query
        schema:
          type: string
      - description: If set it will return results where the query value is contained in the name field. Query values with spaces need to be URL encoded.
        name: query
        in: query
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/searchOrgsResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '409':
          $ref: '#/components/responses/conflictError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
    post:
      description: Only works if users.allow_org_create is set.
      tags:
      - Orgs
      summary: Create Organization
      operationId: createOrg
      responses:
        '200':
          $ref: '#/components/responses/createOrgResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '409':
          $ref: '#/components/responses/conflictError'
        '500':
          $ref: '#/components/responses/internalServerError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrgCommand'
        required: true
  /orgs/name/{org_name}:
    get:
      tags:
      - Orgs
      summary: Get Organization by Name
      operationId: getOrgByName
      parameters:
      - name: org_name
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          $ref: '#/components/responses/getOrgByNameResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
  /orgs/{org_id}:
    get:
      tags:
      - Orgs
      summary: Get Organization by ID
      operationId: getOrgByID
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/getOrgByIDResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
    put:
      tags:
      - Orgs
      summary: Update Organization
      operationId: updateOrg
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgForm'
        required: true
    delete:
      tags:
      - Orgs
      summary: Delete Organization
      operationId: deleteOrgByID
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
  /orgs/{org_id}/address:
    put:
      tags:
      - Orgs
      summary: Update Organization's address
      operationId: updateOrgAddress
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgAddressForm'
        required: true
  /orgs/{org_id}/quotas:
    get:
      description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:read` and scope `org:id:1` (orgIDScope).
      tags:
      - Orgs
      summary: Fetch Organization quota
      operationId: getOrgQuota
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/getQuotaResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/internalServerError'
  /orgs/{org_id}/quotas/{quota_target}:
    put:
      description: If you are running Grafana Enterprise and have Fine-grained access control enabled, you need to have a permission with action `orgs.quotas:write` and scope `org:id:1` (orgIDScope).
      tags:
      - Orgs
      summary: Update user quota
      operationId: updateOrgQuota
      parameters:
      - name: quota_target
        in: path
        required: true
        schema:
          type: string
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '404':
          $ref: '#/components/responses/notFoundError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateQuotaCmd'
        required: true
  /orgs/{org_id}/users:
    get:
      description: 'If you are running Grafana Enterprise and have Fine-grained access control enabled

        you need to have a permission with action: `org.users:read` with scope `users:*`.'
      tags:
      - Orgs
      summary: Get Users in Organization
      operationId: getOrgUsers
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/getOrgUsersResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
    post:
      description: 'Adds a global user to the current organization.


        If you are running Grafana Enterprise and have Fine-grained access control enabled

        you need to have a permission with action: `org.users:add` with scope `users:*`.'
      tags:
      - Orgs
      summary: Add a new user to the current organization
      operationId: addOrgUser
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddOrgUserCommand'
        required: true
  /orgs/{org_id}/users/search:
    get:
      description: 'If you are running Grafana Enterprise and have Fine-grained access control enabled

        you need to have a permission with action: `org.users:read` with scope `users:*`.'
      tags:
      - Orgs
      summary: Search Users in Organization
      operationId: searchOrgUsers
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/searchOrgUsersResponse'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      security:
      - basic: []
  /orgs/{org_id}/users/{user_id}:
    delete:
      description: 'If you are running Grafana Enterprise and have Fine-grained access control enabled

        you need to have a permission with action: `org.users:remove` with scope `users:*`.'
      tags:
      - Orgs
      summary: Delete user in current organization
      operationId: removeOrgUser
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      - name: user_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
    patch:
      description: 'If you are running Grafana Enterprise and have Fine-grained access control enabled

        you need to have a permission with action: `org.users.role:update` with scope `users:*`.'
      tags:
      - Orgs
      summary: Update Users in Organization
      operationId: updateOrgUser
      parameters:
      - name: org_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      - name: user_id
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        '200':
          $ref: '#/components/responses/okResponse'
        '400':
          $ref: '#/components/responses/badRequestError'
        '401':
          $ref: '#/components/responses/unauthorisedError'
        '403':
          $ref: '#/components/responses/forbiddenError'
        '500':
          $ref: '#/components/responses/internalServerError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgUserCommand'
        required: true
components:
  responses:
    unauthorisedError:
      description: UnauthorizedError is returned when the request is not authenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseBody'
    createOrgResponse:
      description: (empty)
      content:
        application/json:
          schema:
            type: object
            required:
            - orgId
            - message
            properties:
              message:
                description: Message Message of the created org.
                type: string
                example: Data source added
              orgId:
                description: ID Identifier of the created org.
                type: integer
                format: int64
                example: 65
    internalServerError:
      description: InternalServerError is a general error indicating something went wrong internally.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseBody'
    conflictError:
      description: ConflictError
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseBody'
    badRequestError:
      description: BadRequestError is returned when the request is invalid and it cannot be processed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseBody'
    getOrgUsersResponse:
      description: (empty)
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/OrgUserDTO'
    getOrgByIDResponse:
      description: (empty)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgDetailsDTO'
    searchOrgsResponse:
      description: (empty)
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/OrgDTO'
    okResponse:
      description: An OKResponse is returned if the request was successful.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SuccessResponseBody'
    forbiddenError:
      description: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseBody'
    getQuotaResponse:
      description: (empty)
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/QuotaDTO'
    searchOrgUsersResponse:
      description: (empty)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SearchOrgUsersQueryResult'
    getOrgByNameResponse:
      description: (empty)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OrgDetailsDTO'
    notFoundError:
      description: NotFoundError is returned when the requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponseBody'
  schemas:
    Address:
      type: object
      properties:
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        country:
          type: string
        state:
          type: string
        zipCode:
          type: string
    OrgDetailsDTO:
      type: object
      properties:
        address:
          $ref: '#/components/schemas/Address'
        id:
          type: integer
          format: int64
        name:
          type: string
    ErrorResponseBody:
      type: object
      required:
      - message
      properties:
        error:
          description: Error An optional detailed description of the actual error. Only included if running in developer mode.
          type: string
        message:
          description: a human readable version of the error
          type: string
        status:
          description: 'Status An optional status to denote the cause of the error.


            For example, a 412 Precondition Failed error may include additional information of why that error happened.'
          type: string
    SearchOrgUsersQueryResult:
      type: object
      properties:
        orgUsers:
          type: array
          items:
            $ref: '#/components/schemas/OrgUserDTO'
        page:
          type: integer
          format: int64
        perPage:
          type: integer
          format: int64
        totalCount:
          type: integer
          format: int64
    OrgDTO:
      type: object
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
    AddOrgUserCommand:
      type: object
      properties:
        loginOrEmail:
          type: string
        role:
          type: string
          enum:
          - None
          - Viewer
          - Editor
          - Admin
    UpdateOrgUserCommand:
      type: object
      properties:
        role:
          type: string
          enum:
          - None
          - Viewer
          - Editor
          - Admin
    UpdateOrgAddressForm:
      type: object
      properties:
        address1:
          type: string
        address2:
          type: string
        city:
          type: string
        country:
          type: string
        state:
          type: string
        zipcode:
          type: string
    UpdateOrgForm:
      type: object
      properties:
        name:
          type: string
    UpdateQuotaCmd:
      type: object
      properties:
        limit:
          type: integer
          format: int64
        target:
          type: string
    QuotaDTO:
      type: object
      properties:
        limit:
          type: integer
          format: int64
        org_id:
          type: integer
          format: int64
        target:
          type: string
        used:
          type: integer
          format: int64
        user_id:
          type: integer
          format: int64
    OrgUserDTO:
      type: object
      properties:
        accessControl:
          type: object
          additionalProperties:
            type: boolean
        authLabels:
          type: array
          items:
            type: string
        avatarUrl:
          type: string
        created:
          type: string
          format: date-time
        email:
          type: string
        isDisabled:
          type: boolean
        isExternallySynced:
          type: boolean
        isProvisioned:
          type: boolean
        lastSeenAt:
          type: string
          format: date-time
        lastSeenAtAge:
          type: string
        login:
          type: string
        name:
          type: string
        orgId:
          type: integer
          format: int64
        role:
          type: string
        uid:
          type: string
        userId:
          type: integer
          format: int64
    SuccessResponseBody:
      type: object
      properties:
        message:
          type: string
    CreateOrgCommand:
      type: object
      properties:
        name:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
    basic:
      type: http
      scheme: basic