Grafana Login API

The Login API from Grafana — 1 operation(s) for login.

OpenAPI Specification

grafana-login-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Grafana HTTP Access Login API
  description: The Grafana HTTP API provides programmatic access to Grafana's core functionality including dashboards, data sources, alerts, users, organizations, folders, annotations, and teams. Authentication is handled via API keys, basic auth, or OAuth tokens passed in the Authorization header.
  version: 11.0.0
  contact:
    name: Grafana Labs
    url: https://grafana.com
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
- url: https://{instance}.grafana.net/api
  description: Grafana Cloud
  variables:
    instance:
      default: your-instance
- url: http://localhost:3000/api
  description: Local Grafana instance
security:
- BearerAuth: []
- BasicAuth: []
- ApiKeyAuth: []
tags:
- name: Login
paths:
  /users/lookup:
    parameters: []
    get:
      tags:
      - Login
      summary: Grafana Get User By Login Or Email
      description: The Grafana API endpoint /users/lookup with the GET method allows administrators to retrieve detailed information about a specific user by providing either their login username or email address as a query parameter. This operation is particularly useful when you need to fetch user details but only have their login credentials or email rather than their numeric user ID. The endpoint returns comprehensive user information including the user's ID, email, name, login, theme preferences, organization details, and authentication labels. Access to this endpoint typically requires administrator privileges as it exposes sensitive user information across the Grafana instance.
      operationId: getUserByLoginOrEmail
      parameters:
      - name: loginOrEmail
        in: query
        description: loginOrEmail of the user
        required: true
        style: form
        explode: true
        schema:
          type: string
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProfileDTO'
        '401':
          description: UnauthorizedError is returned when the request is not authenticated.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: NotFoundError is returned when the requested resource was not found.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: InternalServerError is a general error indicating something went wrong internally.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
      deprecated: false
      x-api-evangelist-processing:
        SplitPascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        WriteDescription: true
        ChooseTags: true
components:
  schemas:
    ErrorResponseBody:
      title: ErrorResponseBody
      required:
      - message
      type: object
      properties:
        error:
          type: string
          description: Error An optional detailed description of the actual error. Only included if running in developer mode.
        message:
          type: string
          description: a human readable version of the error
        status:
          type: string
          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.'
    UserProfileDTO:
      title: UserProfileDTO
      type: object
      properties:
        accessControl:
          type: object
          additionalProperties:
            type: boolean
        authLabels:
          type: array
          items:
            type: string
          description: ''
        avatarUrl:
          type: string
        createdAt:
          type: string
          contentEncoding: date-time
        email:
          type: string
        id:
          type: integer
          contentEncoding: int64
        isDisabled:
          type: boolean
        isExternal:
          type: boolean
        isExternallySynced:
          type: boolean
        isGrafanaAdmin:
          type: boolean
        isGrafanaAdminExternallySynced:
          type: boolean
        isProvisioned:
          type: boolean
        login:
          type: string
        name:
          type: string
        orgId:
          type: integer
          contentEncoding: int64
        theme:
          type: string
        uid:
          type: string
        updatedAt:
          type: string
          contentEncoding: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Service account token or API key
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: Bearer <api-key>'