> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Get enrichment rules

> Return the enrichment rule set configured for a specific integration.

## Restrictions

| Aspect      | Value                                                                                                                                        |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account                                                                                |
| Permissions | **Channels Read** (`on-call`) or **Channels Manage** (`on-call`) or **Integrations Read** (`on-call`) or **Integrations Manage** (`on-call`) |

## Usage

* Returns `null` if no enrichment rules have been configured for the integration.


## OpenAPI

````yaml /api-reference/on-call.openapi.en.json post /enrichment/info
openapi: 3.1.0
info:
  title: Flashduty Open API
  description: >-
    Public HTTP API for the Flashduty incident management platform — incidents,
    notification templates, channels, schedules, monitors, RUM, and platform
    administration. Every operation is authenticated with an `app_key` query
    parameter issued from the Flashduty console under Account → APP Keys.
    Responses follow a uniform envelope: `{ request_id, data }` on success, `{
    request_id, error }` on failure.
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: On-call/Incidents
    description: ''
  - name: On-call/Channels
    description: ''
  - name: On-call/Alerts
    description: >-
      Search, inspect, and act on alerts. Manage card views and alert processing
      pipelines.
  - name: On-call/Integrations
    description: ''
  - name: On-call/IM integrations
    description: IM integration queries, such as which integrations have war room enabled.
  - name: On-call/Schedules
    description: ''
  - name: On-call/Calendars
    description: ''
  - name: On-call/Notification templates
    description: ''
  - name: On-call/Alert enrichment
    description: Custom fields, enrichment rules, and data mapping (schema, data, API).
  - name: On-call/Analytics
    description: ''
  - name: On-call/Status pages
    description: ''
  - name: On-call/Changes
    description: ''
paths:
  /enrichment/info:
    post:
      tags:
        - On-call/Alert enrichment
      summary: Get enrichment rules
      description: Return the enrichment rule set configured for a specific integration.
      operationId: enrichment-read-info
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnrichmentInfoRequest'
            example:
              integration_id: 5001
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/EnrichmentItem'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  integration_id: 5001
                  rules:
                    - kind: extraction
                      settings:
                        source_field: labels.env
                        result_label: environment
                        pattern: ^(prod|staging|dev).*$
                        override: true
                  status: enabled
                  updated_by: 80011
                  creator_id: 80011
                  created_at: 1710000000
                  updated_at: 1710000000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    EnrichmentInfoRequest:
      type: object
      required:
        - integration_id
      properties:
        integration_id:
          type: integer
          format: int64
          minimum: 1
          description: >-
            Integration ID to query enrichment rules for. Must be greater than
            0.
    SuccessEnvelope:
      type: object
      description: >-
        Success response envelope. On every 2xx response, `request_id`
        identifies the call (also mirrored in the `Flashcat-Request-Id` header)
        and `data` holds the endpoint-specific payload. Failure responses use a
        different shape — see `ErrorResponse`.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            response header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
        - data
    EnrichmentItem:
      type: object
      description: Enrichment rule set for an integration.
      properties:
        integration_id:
          type: integer
          format: int64
          description: Integration ID.
        rules:
          type: array
          items:
            $ref: '#/components/schemas/EnrichRule'
          description: Ordered enrichment rules.
        status:
          type: string
          description: Rule set status.
        updated_by:
          type: integer
          format: int64
          description: Last updater member ID.
        creator_id:
          type: integer
          format: int64
          description: Creator member ID.
        created_at:
          type: integer
          format: int64
          description: Creation timestamp, Unix seconds.
        updated_at:
          type: integer
          format: int64
          description: Last update timestamp, Unix seconds.
      required:
        - integration_id
        - rules
        - status
        - updated_by
        - creator_id
        - created_at
        - updated_at
    EnrichRule:
      type: object
      required:
        - kind
        - settings
      description: >-
        An enrichment rule with an optional condition and type-specific
        settings.
      properties:
        kind:
          type: string
          enum:
            - extraction
            - composition
            - mapping
            - drop
          description: >-
            Rule type. `extraction` extracts a label via regex or GJson.
            `composition` builds a label from a template. `mapping` looks up
            values from a schema or API. `drop` removes labels.
        if:
          type: array
          items:
            $ref: '#/components/schemas/EnrichFilter'
          description: >-
            Optional AND-filter list. The rule is skipped if the condition does
            not match.
        settings:
          description: Rule-kind–specific settings. The shape depends on `kind`.
          discriminator:
            propertyName: kind
            mapping:
              extraction:
                $ref: '#/components/schemas/ErsExtraction'
              composition:
                $ref: '#/components/schemas/ErsComposition'
              mapping:
                $ref: '#/components/schemas/ErsMapping'
              drop:
                $ref: '#/components/schemas/ErsDrop'
          oneOf:
            - $ref: '#/components/schemas/ErsExtraction'
            - $ref: '#/components/schemas/ErsComposition'
            - $ref: '#/components/schemas/ErsMapping'
            - $ref: '#/components/schemas/ErsDrop'
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    EnrichFilter:
      type: object
      required:
        - key
        - oper
        - vals
      description: A single label filter condition.
      properties:
        key:
          type: string
          description: Alert label key.
        oper:
          type: string
          enum:
            - IN
            - NOTIN
          description: >-
            Match operator. `IN` matches when any value matches; `NOTIN` matches
            when none of the values match.
        vals:
          type: array
          items:
            type: string
          description: Values to match against.
    ErsExtraction:
      type: object
      title: extraction
      required:
        - source_field
        - result_label
      properties:
        source_field:
          type: string
          description: >-
            Source field to extract from. Must be `title`, `description`, or a
            label key prefixed with `labels.` (e.g. `labels.env`).
        result_label:
          type: string
          description: >-
            Destination label key to write the extracted value into. Must match
            `^[a-z][a-z0-9_]{0,62}$`.
        pattern:
          type: string
          description: >-
            RE2 regular expression. Use a named capture group `(?P<result>...)`
            to extract a sub-match; without a named group the full match is
            used. Mutually exclusive with `g_json`.
        g_json:
          type: string
          description: >-
            GJson path expression used to extract a value from a JSON-encoded
            field. Mutually exclusive with `pattern`.
        override:
          type: boolean
          description: >-
            When `true`, overwrite the label if it already exists. Defaults to
            `false`.
    ErsComposition:
      type: object
      title: composition
      required:
        - result_label
        - template
      properties:
        result_label:
          type: string
          description: >-
            Destination label key to write the composed value into. Must match
            `^[a-z][a-z0-9_]{0,62}$`.
        template:
          type: string
          maxLength: 500
          description: >-
            Go `text/template` string. Alert fields are available as
            `{{.title}}`, `{{.description}}`, and `{{.labels.key}}`. Example:
            `{{.labels.region}}-{{.labels.env}}`.
        override:
          type: boolean
          description: >-
            When `true`, overwrite the label if it already exists. Defaults to
            `false`.
    ErsMapping:
      type: object
      title: mapping
      required:
        - result_labels
      properties:
        result_labels:
          type: array
          items:
            type: string
          description: Label keys to populate from the mapping lookup result.
        mapping_type:
          type: string
          enum:
            - schema
            - api
          default: schema
          description: >-
            Mapping source type. `schema` uses a mapping schema table; `api`
            calls an external HTTP API.
        schema_id:
          type: string
          description: >-
            Mapping schema ID (MongoDB ObjectID hex). Required when
            `mapping_type` is `schema`.
        api_id:
          type: string
          description: >-
            Mapping API ID (MongoDB ObjectID hex). Required when `mapping_type`
            is `api`.
        override:
          type: boolean
          description: >-
            When `true`, overwrite labels that already exist. Defaults to
            `false`.
    ErsDrop:
      type: object
      title: drop
      required:
        - drop_labels
      properties:
        drop_labels:
          type: array
          items:
            type: string
          description: List of label keys to remove from the alert.
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
          example: The specified parameter template_id is not valid.
      required:
        - code
        - message
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these stable wire strings. HTTP status is informational — the
        authoritative signal is the enum value.


        | Code | HTTP | Meaning |

        |---|---|---|

        | `OK` | 200 | Reserved — not returned on real errors. |

        | `InvalidParameter` | 400 | A required parameter is missing or failed
        validation. |

        | `BadRequest` | 400 | Generic 400 used when no more specific code fits.
        |

        | `InvalidContentType` | 400 | The `Content-Type` header is not
        `application/json`. |

        | `ResourceNotFound` | 400 | The referenced resource does not exist.
        Note: returned as HTTP 400, not 404 (historical choice). |

        | `NoLicense` | 400 | The feature is license-gated and no active license
        was found. |

        | `ReferenceExist` | 400 | Deletion blocked — other entities still
        reference this resource. |

        | `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |

        | `BalanceNotEnough` | 402 | Billing-gated operation with insufficient
        account balance. |

        | `AccessDenied` | 403 | Authenticated but lacking the permission
        required for this operation. |

        | `RouteNotFound` | 404 | The request URL path is not a known route. |

        | `MethodNotAllowed` | 405 | The HTTP method is not allowed on this
        otherwise-known path. |

        | `UndonedOrderExist` | 409 | An outstanding billing order blocks this
        new one. Wait and retry. |

        | `RequestLocked` | 423 | Operation temporarily locked due to repeated
        failures. |

        | `EntityTooLarge` | 413 | Request body exceeds the configured max size.
        |

        | `RequestTooFrequently` | 429 | Rate limit hit — API-global,
        per-account, or per-integration. |

        | `RequestVerifyRequired` | 428 | Second-factor verification required
        but not supplied. |

        | `DangerousOperation` | 428 | High-risk operation requires MFA
        verification. |

        | `InternalError` | 500 | Unhandled server-side error. Include
        `request_id` in the bug report. |

        | `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try
        again later. |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: Reserved — not returned on real errors.
        InvalidParameter: A required parameter is missing or failed validation.
        BadRequest: Generic 400 used when no more specific code fits.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        NoLicense: The feature is license-gated and no active license was found.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        AccessDenied: Authenticated but lacking the permission required for this operation.
        RouteNotFound: The request URL path is not a known route.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
        RequestLocked: Operation temporarily locked due to repeated failures.
        EntityTooLarge: Request body exceeds the configured max size.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        DangerousOperation: High-risk operation requires MFA verification.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
      example: InvalidParameter
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
    Unauthorized:
      description: Missing or invalid app_key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    TooManyRequests:
      description: >-
        Rate limit hit. Either the global API limit, a per-account limit, or a
        per-integration limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        App key issued from the Flashduty console under Account → APP Keys.
        Required on every public API call. Keep it secret — it grants the same
        access as the owning account.

````