Grafana Correlation API

The Correlation API from Grafana — 3 operation(s) for correlation.

Operations 4

POST /datasources/uid/{sourceUID}/correlations Grafana Create Correlation #
GET /datasources/uid/{sourceUID}/correlations/{correlationUID} Grafana Get Correlation #
PATCH /datasources/uid/{sourceUID}/correlations/{correlationUID} Grafana Update Correlation #
DELETE /datasources/uid/{uid}/correlations/{correlationUID} Grafana Delete Correlation #

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-correlation-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-correlation-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Grafana Correlation API
  description: 'Grafana is an open-source analytics and visualization platform that helps you monitor and analyze data from various sources. It lets you create customizable dashboards with charts, graphs, and alerts to visualize metrics and logs in real-time. Commonly used for monitoring infrastructure, applications, and business metrics, Grafana connects to dozens of data sources like Prometheus, Elasticsearch, and cloud platforms, making it easier to understand system performance, troubleshoot issues, and track key indicators all in one place. '
  contact:
    name: Grafana Labs
    url: https://grafana.com
    email: hello@grafana.com
  version: 0.0.1
servers:
- url: http://{defaultHost}
  variables:
    defaultHost:
      default: www.example.com/api
- url: https://{defaultHost}
  variables:
    defaultHost:
      default: www.example.com/api
security:
- basic: []
- api_key: []
tags:
- name: Correlation
paths:
  /datasources/uid/{sourceUID}/correlations:
    parameters: []
    post:
      tags:
      - Correlation
      summary: Grafana Create Correlation
      description: Creates a new correlation in Grafana between two data sources, allowing users to establish relationships and navigate between different data sources using the specified source data source UID. This operation enables the creation of links that help connect related data across different monitoring or logging systems, facilitating easier investigation and analysis workflows by defining how data in one source relates to data in another source through correlation configurations.
      operationId: createCorrelation
      parameters:
      - name: sourceUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCorrelationCommand'
        required: true
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCorrelationResponseBody'
        '400':
          description: BadRequestError is returned when the request is invalid and it cannot be processed.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '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
  /datasources/uid/{sourceUID}/correlations/{correlationUID}:
    parameters: []
    get:
      tags:
      - Correlation
      summary: Grafana Get Correlation
      description: The Get Correlation API operation in Grafana retrieves a specific correlation configuration between data sources using their unique identifiers. By making a GET request to the endpoint `/datasources/uid/{sourceUID}/correlations/{correlationUID}`, users can fetch detailed information about an existing correlation, including its configuration settings, transformations, and the relationship between a source data source and a target data source. This operation requires both the unique identifier of the source data source (sourceUID) and the unique identifier of the specific correlation (correlationUID) to return the correlation object with all its associated metadata and configuration parameters.
      operationId: getCorrelation
      parameters:
      - name: sourceUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      - name: correlationUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Correlation'
        '401':
          description: UnauthorizedError is returned when the request is not authenticated.
          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
    patch:
      tags:
      - Correlation
      summary: Grafana Update Correlation
      description: Updates an existing correlation identified by its UID within a specific data source, also identified by UID. This PATCH operation allows you to modify the properties of a correlation, which defines relationships between queries or data across different data sources in Grafana. The correlation UID and source data source UID must be provided in the path parameters to target the specific correlation to update. The request typically includes fields such as the target data source, transformation expressions, or correlation description that need to be modified. This endpoint is useful for maintaining and refining data relationships as your monitoring infrastructure evolves, enabling more sophisticated cross-data-source queries and visualizations without recreating correlations from scratch.
      operationId: updateCorrelation
      parameters:
      - name: sourceUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      - name: correlationUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCorrelationCommand'
        required: false
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCorrelationResponseBody'
        '400':
          description: BadRequestError is returned when the request is invalid and it cannot be processed.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '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
  /datasources/uid/{uid}/correlations/{correlationUID}:
    parameters: []
    delete:
      tags:
      - Correlation
      summary: Grafana Delete Correlation
      description: 'This API operation deletes a specific correlation in Grafana by targeting both the data source and correlation identifiers. The endpoint requires two parameters: the UID of the data source that owns the correlation and the correlationUID which uniquely identifies the correlation to be removed. When executed with a DELETE HTTP method, it permanently removes the specified correlation configuration that links queries or data between different data sources, helping administrators clean up unused or outdated correlation rules within their Grafana instance.'
      operationId: deleteCorrelation
      parameters:
      - name: uid
        in: path
        description: ''
        required: true
        schema:
          type: string
      - name: correlationUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteCorrelationResponseBody'
        '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:
    CorrelationConfig:
      title: CorrelationConfig
      required:
      - field
      - target
      type: object
      properties:
        field:
          type: string
          description: Field used to attach the correlation link
          examples:
          - message
        target:
          type: object
          additionalProperties: {}
          description: Target data query
          examples:
          - prop1: value1
            prop2: value
        transformations:
          type: array
          items:
            $ref: '#/components/schemas/Transformation'
          description: ''
        type:
          type: string
          description: 'the type of correlation, either query for containing query information, or external for containing an external URL

            +enum'
    Type1:
      title: Type1
      enum:
      - regex
      - logfmt
      type: string
    Correlation:
      title: Correlation
      type: object
      properties:
        config:
          $ref: '#/components/schemas/CorrelationConfig'
        description:
          type: string
          description: Description of the correlation
          examples:
          - Logs to Traces
        label:
          type: string
          description: Label identifying the correlation
          examples:
          - My Label
        orgId:
          type: integer
          description: OrgID of the data source the correlation originates from
          contentEncoding: int64
          examples:
          - 1
        provisioned:
          type: boolean
          description: Provisioned True if the correlation was created during provisioning
        sourceUID:
          type: string
          description: UID of the data source the correlation originates from
          examples:
          - d0oxYRg4z
        targetUID:
          type: string
          description: UID of the data source the correlation points to
          examples:
          - PE1C5CBDA0504A6A3
        type:
          type: string
          description: 'the type of correlation, either query for containing query information, or external for containing an external URL

            +enum'
        uid:
          type: string
          description: Unique identifier of the correlation
          examples:
          - 50xhMlg9k
      description: Correlation is the model for correlations definitions
    CorrelationConfigUpdateDTO:
      title: CorrelationConfigUpdateDTO
      type: object
      properties:
        field:
          type: string
          description: Field used to attach the correlation link
          examples:
          - message
        target:
          type: object
          additionalProperties: {}
          description: Target data query
          examples:
          - prop1: value1
            prop2: value
        transformations:
          type: array
          items:
            $ref: '#/components/schemas/Transformation'
          description: Source data transformations
          examples:
          - - type: logfmt
            - expression: (Superman|Batman)
              type: regex
              variable: name
    Transformation:
      title: Transformation
      type: object
      properties:
        expression:
          type: string
        field:
          type: string
        mapValue:
          type: string
        type:
          $ref: '#/components/schemas/Type1'
    CreateCorrelationCommand:
      title: CreateCorrelationCommand
      type: object
      properties:
        config:
          $ref: '#/components/schemas/CorrelationConfig'
        description:
          type: string
          description: Optional description of the correlation
          examples:
          - Logs to Traces
        label:
          type: string
          description: Optional label identifying the correlation
          examples:
          - My label
        provisioned:
          type: boolean
          description: True if correlation was created with provisioning. This makes it read-only.
        targetUID:
          type: string
          description: Target data source UID to which the correlation is created. required if type = query
          examples:
          - PE1C5CBDA0504A6A3
        type:
          type: string
          description: 'the type of correlation, either query for containing query information, or external for containing an external URL

            +enum'
      description: CreateCorrelationCommand is the command for creating a correlation
    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.'
    DeleteCorrelationResponseBody:
      title: DeleteCorrelationResponseBody
      type: object
      properties:
        message:
          type: string
          examples:
          - Correlation deleted
    UpdateCorrelationResponseBody:
      title: UpdateCorrelationResponseBody
      type: object
      properties:
        message:
          type: string
          examples:
          - Correlation updated
        result:
          allOf:
          - $ref: '#/components/schemas/Correlation'
          - description: Correlation is the model for correlations definitions
    UpdateCorrelationCommand:
      title: UpdateCorrelationCommand
      type: object
      properties:
        config:
          $ref: '#/components/schemas/CorrelationConfigUpdateDTO'
        description:
          type: string
          description: Optional description of the correlation
          examples:
          - Logs to Traces
        label:
          type: string
          description: Optional label identifying the correlation
          examples:
          - My label
        type:
          type: string
          description: 'the type of correlation, either query for containing query information, or external for containing an external URL

            +enum'
      description: UpdateCorrelationCommand is the command for updating a correlation
    CreateCorrelationResponseBody:
      title: CreateCorrelationResponseBody
      type: object
      properties:
        message:
          type: string
          examples:
          - Correlation created
        result:
          allOf:
          - $ref: '#/components/schemas/Correlation'
          - description: Correlation is the model for correlations definitions
      description: CreateCorrelationResponse is the response struct for CreateCorrelationCommand
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
    basic:
      type: http
      scheme: basic