> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Enrich a stack trace

> Symbolicate or deobfuscate a browser, Android, iOS, Mini Program, or HarmonyOS stack trace.

## Restrictions

| Aspect      | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Rate limits | **1,000 requests/minute**; **50 requests/second** per account |
| Permissions | None — any valid `app_key` can call this operation            |

## Usage

* `type` defaults to `browser` when omitted for backward compatibility.
* Set `near` from 1 to 20 to include source-code snippets around converted frames.
* For Android NDK native crashes, provide `arch` and `source_type: ndk` so the backend routes to native symbolication.
* For iOS crash stacks, pass `binary_images` so addresses can be relocated against the uploaded dSYM files.
* `no_cache` is intended for debugging and bypasses cached enrich results.


## OpenAPI

````yaml /api-reference/rum.openapi.en.json post /sourcemap/stack/enrich
openapi: 3.1.0
info:
  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.
  title: Flashduty Open API
  version: 1.0.0
servers:
  - description: Flashduty Open API
    url: https://api.flashcat.cloud
security:
  - AppKeyAuth: []
tags:
  - description: Manage Real User Monitoring (RUM) applications.
    name: RUM/Applications
  - description: Run RUM analytics queries over event data.
    name: RUM/Data query
  - description: Query and manage RUM error tracking issues and preset severity rules.
    name: RUM/Issues
  - description: >-
      Query RUM facet fields and their value distributions for building
      analytics filters.
    name: RUM/Facets
  - description: >-
      Manage and query RUM sourcemap files for browser, Android, and iOS error
      symbolication.
    name: RUM/Sourcemaps
  - description: Retrieve session replay metadata and recorded segments for RUM sessions.
    name: RUM/Session replay
  - description: >-
      Configure and inspect the rules that decide which RUM errors get ingested
      and stored for an application, including their edit history.
    name: RUM/Error ingestion rules
  - description: >-
      Manage per-application rules that assign a severity to matching front-end
      errors, plus their evaluation order and change history.
    name: RUM/Issue preset severity rules
  - description: Query the RUM resource record and current usage for the account.
    name: RUM/Resources
paths:
  /sourcemap/stack/enrich:
    post:
      tags:
        - RUM/Sourcemaps
      summary: Enrich a stack trace
      description: >-
        Symbolicate or deobfuscate a browser, Android, iOS, Mini Program, or
        HarmonyOS stack trace.
      operationId: sourcemap-read-stack-enrich
      requestBody:
        content:
          application/json:
            example:
              near: 3
              service: my-web-app
              stack: |-
                TypeError: Cannot read properties of undefined
                    at render (https://cdn.example.com/app.min.js:1:2345)
              type: browser
              version: 1.0.0
            schema:
              $ref: '#/components/schemas/SourcemapStackEnrichRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  frames:
                    - code_snippets:
                        - code: const cart = props.cart;
                          line: 41
                        - code: return cart.items.map(renderItem);
                          line: 42
                      column: 17
                      converted: true
                      file: src/pages/checkout.tsx
                      function: renderCheckout
                      line: 42
                      original_frame:
                        column: 2345
                        file: https://cdn.example.com/app.min.js
                        function: render
                        line: 1
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - properties:
                      data:
                        $ref: '#/components/schemas/SourcemapStackEnrichResponse'
                    type: object
          description: Success
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    SourcemapStackEnrichRequest:
      description: Stack trace enrichment request.
      properties:
        arch:
          description: Android NDK architecture such as `arm`, `arm64`, `x86`, or `x64`.
          type: string
        binary_images:
          description: Loaded binary images from an iOS crash report.
          items:
            $ref: '#/components/schemas/SourcemapBinaryImage'
          type: array
        build_id:
          description: Android build ID for Gradle plugin 1.13.0 and later.
          type: string
        near:
          description: >-
            Number of nearby meaningful source lines to return around converted
            frames.
          maximum: 20
          minimum: 1
          type: integer
        no_cache:
          description: Skip cached enrich results. Intended for debugging.
          type: boolean
        platform:
          description: >-
            Narrows a `react-native` enrich to the app's native platform: `ios`
            for the iOS native layer, `android` for the Android native layer
            (the console derives it from the event's OS). Ignored for other
            `type` values.
          enum:
            - ios
            - android
          type: string
        service:
          description: Application or service name used when the sourcemap was uploaded.
          type: string
        source_type:
          description: >-
            Android error source type. Use `ndk` with `arch` for native
            symbolication.
          type: string
        stack:
          description: Raw stack trace to parse and enrich.
          type: string
        type:
          description: >-
            Source platform whose symbol store is used. Defaults to `browser`
            when omitted.


            | Value | Symbolication |

            |---|---|

            | `browser` | JavaScript stacks via sourcemaps |

            | `android` | Java/Kotlin stacks via ProGuard/R8 mappings; native
            stacks via NDK symbols (send `source_type=ndk` with `arch`) |

            | `ios` | iOS crash stacks via dSYM (send `binary_images`) |

            | `miniprogram` | WeChat mini program stacks via sourcemaps |

            | `harmony` | HarmonyOS stacks via ArkTS sourcemaps or native
            symbols |

            | `flutter` | Flutter/Dart stacks via Dart AOT symbols |

            | `electron` | Electron JavaScript stacks via sourcemaps; minidump
            native frames via Breakpad symbols (derived from `source_type`) |

            | `react-native` | React Native JS stacks via sourcemaps; narrow the
            lookup with `platform` |
          enum:
            - browser
            - android
            - ios
            - miniprogram
            - harmony
            - flutter
            - electron
            - react-native
          type: string
        variant:
          description: Android build variant used by older Gradle plugin versions.
          type: string
        version:
          description: Application version used when the sourcemap was uploaded.
          type: string
      required:
        - service
        - version
      type: object
    SuccessEnvelope:
      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:
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
        request_id:
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            response header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          type: string
      required:
        - request_id
        - data
      type: object
    SourcemapStackEnrichResponse:
      description: Enriched stack frames.
      properties:
        frames:
          description: >-
            Error stack frames after symbolication (via sourcemap, dSYM, NDK
            symbol tables, etc.).
          items:
            $ref: '#/components/schemas/SourcemapEnrichedFrame'
          type: array
      required:
        - frames
      type: object
    SourcemapBinaryImage:
      description: Loaded binary image from a crash report.
      properties:
        arch:
          description: CPU architecture for this binary image.
          type: string
        is_system:
          description: Whether this binary belongs to the operating system.
          type: boolean
        load_address:
          description: >-
            Runtime address. Accepts a hex string such as `0x100000000` or a
            decimal integer.
          oneOf:
            - type: string
            - format: int64
              type: integer
        max_address:
          description: >-
            Runtime address. Accepts a hex string such as `0x100000000` or a
            decimal integer.
          oneOf:
            - type: string
            - format: int64
              type: integer
        name:
          description: Binary image name.
          type: string
        uuid:
          description: Build UUID identifying the binary or dSYM.
          type: string
      required:
        - uuid
        - name
        - is_system
      type: object
    SourcemapEnrichedFrame:
      allOf:
        - $ref: '#/components/schemas/SourcemapStackFrame'
        - properties:
            code_snippets:
              description: >-
                Source-code snippets around this frame. Omitted when no snippet
                was extracted (for example the source content was unavailable or
                `near` was not requested).
              items:
                $ref: '#/components/schemas/SourcemapCodeSnippet'
              type: array
            converted:
              description: Whether the frame was successfully symbolicated or deobfuscated.
              type: boolean
            original_frame:
              $ref: '#/components/schemas/SourcemapStackFrame'
              description: >-
                The original minified/obfuscated frame before enrichment.
                Omitted when the processor did not retain one.
            third_party:
              description: >-
                Whether the frame is from third-party or system libraries
                (Android and native symbolication only). Omitted when `false`.
              type: boolean
          required:
            - converted
          type: object
    ErrorResponse:
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        error:
          $ref: '#/components/schemas/DutyError'
        request_id:
          description: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          type: string
      required:
        - request_id
        - error
      type: object
    SourcemapStackFrame:
      description: Parsed stack frame fields shared across platforms.
      properties:
        address:
          description: iOS or native memory address.
          type: string
        class_name:
          description: Android Java/Kotlin class name.
          type: string
        column:
          description: Column number for JavaScript or Flutter frames.
          type: integer
        file:
          description: Source file, URL, or module path.
          type: string
        function:
          description: Function or method name.
          type: string
        line:
          description: Line number.
          type: integer
        method_name:
          description: Android Java/Kotlin method name without class prefix.
          type: string
        module:
          description: iOS Swift/Objective-C module name.
          type: string
        native_address:
          description: Unity IL native address.
          type: string
        offset:
          description: Symbol offset from function start.
          type: integer
      type: object
    SourcemapCodeSnippet:
      description: One source-code line returned around an enriched frame.
      properties:
        code:
          description: Source code on that line.
          type: string
        line:
          description: Source line number.
          type: integer
      required:
        - line
        - code
      type: object
    DutyError:
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          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.
          type: string
      required:
        - code
        - message
      type: object
    ErrorCode:
      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
      example: InvalidParameter
      type: string
      x-enumDescriptions:
        AccessDenied: Authenticated but lacking the permission required for this operation.
        BadRequest: Generic 400 used when no more specific code fits.
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        DangerousOperation: High-risk operation requires MFA verification.
        EntityTooLarge: Request body exceeds the configured max size.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        InvalidParameter: A required parameter is missing or failed validation.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        NoLicense: The feature is license-gated and no active license was found.
        OK: Reserved — not returned on real errors.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        RequestLocked: Operation temporarily locked due to repeated failures.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        RouteNotFound: The request URL path is not a known route.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
  responses:
    BadRequest:
      content:
        application/json:
          examples:
            missingParameter:
              value:
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Invalid request — usually a missing or malformed parameter.
    Unauthorized:
      content:
        application/json:
          examples:
            missingAppKey:
              value:
                error:
                  code: Unauthorized
                  message: You are unauthorized.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Missing or invalid app_key.
    TooManyRequests:
      content:
        application/json:
          examples:
            rateLimited:
              value:
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: >-
        Rate limit hit. Either the global API limit, a per-account limit, or a
        per-integration limit.
    ServerError:
      content:
        application/json:
          examples:
            internal:
              value:
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      description: Unexpected server-side error. Include the request_id when reporting.
  securitySchemes:
    AppKeyAuth:
      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.
      in: query
      name: app_key
      type: apiKey

````