API update: error instances

| 4 min. (672 words)

We’ve added three new API endpoints to help you explore and triage individual error occurrences in your applications. These endpoints make it easy to:

Whether you’re automating incident workflows, enriching alerts, or powering custom dashboards, these endpoints give you direct access to the data you need.

Endpoints at a glance

GET /applications/{application-identifier}/error-groups/{error-group-identifier}/instances  

Returns a list of error instances

GET /applications/{application-identifier}/error-groups/{error-group-identifier}/instance/{error-instance}

Returns a specific error instance detail

GET /applications/{application-identifier}/error-groups/{error-group-identifier}/instance/latest 

Returns the latest error instance detail

Notes:

  • Replace path placeholders with your own identifiers.
  • Example payloads below are sanitized and include only relevant fields for triage.
  • Authentication examples use a generic Authorization header — adjust to your setup.

Listing error instances

Use this to quickly enumerate instances within an error group (for triage queues, count trends, or “what happened recently” views).

cURL

curl -X GET \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json" \
  "https://{BASE_URL}/applications/{application-identifier}/error-groups/{error-group-identifier}/instances"

Example response (sanitized)

[
  {
    "identifier": "abc12345",
    "occurredOn": "2025-08-28T20:33:31.175Z"
  },
  {
    "identifier": "def67890",
    "occurredOn": "2025-08-28T20:00:29.501Z"
  },
  {
    "identifier": "ghi13579",
    "occurredOn": "2025-08-28T19:33:28.240Z"
  }
]

What’s included:

  • identifier: The unique ID for the error instance
  • occurredOn: When the instance occurred (ISO 8601 UTC)

Tip: Combine this with your incident tooling to fetch details only when needed.

Getting a specific error instance

Fetch the full context for a single instance to power deep-dive investigations or automated enrichment for alerts.

cURL

curl -X GET \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json" \
  "https://{BASE_URL}/applications/{application-identifier}/error-groups/{error-group-identifier}/instance/{error-instance}"

Example response (sanitized and consolidated)

{
  "identifier": "abc12345",
  "occurredOn": "2025-07-25T05:00:32.383Z",
  "error": {
    "message": "Scheduled job failed - no plan found",
    "className": "ScheduledJobExecutionException",
    "stackTrace": [
      {
        "className": "MyApp.Scheduling.JobRunner",
        "methodName": "Execute",
        "fileName": "JobRunner.cs",
        "lineNumber": 42
      },
      {
        "className": "System.Threading.Tasks.Task",
        "methodName": "Run",
        "fileName": null,
        "lineNumber": 0
      }
    ]
  },
  "tags": ["Error", "backend"],
  "client": {
    "name": "RaygunSerilogSink",
    "version": "8.2.0"
  },
  "environment": {
    "osVersion": "Linux",
    "architecture": "Arm64"
  },
  "userCustomData": {
    "EnvironmentName": "Production"
  }
}

What’s included:

  • Core identifiers and timestamps for correlation
  • Error summary (message, className)
  • A concise, relevant portion of the stack trace
  • High-signal metadata (tags, client info, minimal environment)
  • Redacted/normalized environment and custom data to avoid exposing sensitive details

Getting the latest error instance

Quickly pull the most recent occurrence for an error group — perfect for alerts, on-call reviews, and “is it still happening?” checks.

cURL

curl -X GET \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json" \
  "https://{BASE_URL}/applications/{application-identifier}/error-groups/{error-group-identifier}/instance/latest"

Example response (sanitized and consolidated)

{
  "identifier": "latest9876",
  "occurredOn": "2025-08-28T20:33:31.175Z",
  "error": {
    "message": "Scheduled job failed - no plan found",
    "className": "ScheduledJobExecutionException",
    "stackTrace": [
      {
        "className": "MyApp.Scheduling.JobRunner",
        "methodName": "Execute",
        "fileName": "JobRunner.cs",
        "lineNumber": 42
      },
      {
        "className": "System.Threading.Tasks.Task",
        "methodName": "Run",
        "fileName": null,
        "lineNumber": 0
      }
    ]
  },
  "tags": ["Error", "backend"],
  "client": {
    "name": "RaygunSerilogSink",
    "version": "8.2.0"
  },
  "environment": {
    "osVersion": "Linux",
    "architecture": "Arm64"
  },
  "userCustomData": {
    "EnvironmentName": "Production"
  }
}

Ideas for how to use these endpoints

  • Alert enrichment: Attach the latest instance details to notifications for instant context
  • On-call dashboards: Show “most recent occurrence” and a quick stack snippet at a glance
  • Triage queues: List instances and fetch details only when an item is opened
  • CI/CD checks: Gate releases if a targeted error group has new occurrences within a time window

Give it a try

  • Use your existing API credentials and replace placeholders with real identifiers
  • Start with the instances list, then pull the specific instance you want to investigate
  • Keep responses lightweight in your workflows: request detail only when needed

If you have feedback or want to see additional fields exposed, let us know. We’d love to hear how you’re using these endpoints and what would make them even more useful.

Other helpful Raygun API endpoints to explore

Got an endpoint you’d like to see in the Raygun API? Submit your interest here.
See more details on the Raygun API in our documentation.

Not a Raygun customer? Try out the full Crash Reporting application free for 14 days!