REST API

Events and Transactions via REST API

Free on every plan, including the free one
Requirements Any HTTP client
Where to get it No package
Pricing Free

What it is for

The DockRay REST API lets you send errors, exceptions, and HTTP transaction data directly to the DockRay platform from any application, service, or device.

This solution is designed primarily for technologies that do not yet have a dedicated DockRay library, module, or plugin.

Error and Exception Reporting

The error endpoint lets you send events containing the information needed to diagnose issues in your application.

An event can include:

  • the error or exception type and message,
  • the stack trace,
  • the environment and application version,
  • SDK, runtime, and operating system information,
  • HTTP request context,
  • optional user data.

HTTP Transaction Monitoring

A separate endpoint lets you report completed HTTP transactions, including the transaction name, method, URL, event timestamp, response status code, and environment information.

This data can be used to analyze traffic, request history, and the distribution of HTTP responses within the monitored project.

Any Technology

The REST API does not require a specific programming language or framework. All you need is the ability to make HTTP requests and send data in JSON format.

This makes it possible to integrate DockRay with custom backends, microservices, devices, scripts, and less common technologies.

Authentication

Each event is assigned to a project using its token, while the request is authenticated with the project's private key passed in the Authorization header.

The private key should be stored exclusively on the server and must never be exposed in public application code.

Data Format

The endpoints accept JSON data in a format compatible with the DockRay event model. The payload can be sent directly or compressed using gzip.

Installation

To integrate with DockRay, you need the project token and private key available in the DockRay dashboard.

The project token is part of the endpoint URL, while the private key must be passed as a Bearer Token in the Authorization header.

Error Reporting

Send a POST request to the following endpoint:

https://dockray.io/api/v1/PROJECT_TOKEN/project

Add the required headers:

Authorization: Bearer PROJECT_PRIVATE_KEY
Content-Type: application/json

HTTP Transaction Reporting

Transactions are sent to a separate endpoint:

https://dockray.io/api/v1/PROJECT_TOKEN/transaction

Each transaction can include the route name, HTTP method, response status code, event timestamp, environment, and runtime and application information.

The project's private key must not be included in browser-side code or exposed in any other publicly accessible location.

How to use it

The integration reports exceptions on its own. This is for the reports you send deliberately.

bash
curl -X POST https://dockray.io/api/v1/PROJECT_TOKEN/project \
  -H 'Authorization: Bearer PROJECT_PRIVATE_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "environment": "production",
    "sdk": {
      "name": "custom-http-client",
      "version": "1.0.0"
    },
    "exception": {
      "values": [
        {
          "type": "RuntimeException",
          "value": "Payment gateway returned an unexpected response",
          "stacktrace": {
            "frames": []
          }
        }
      ]
    },
    "request": {
      "url": "https://api.example.com/api/orders",
      "method": "POST"
    }
  }'

Knowledge base articles

Start Monitoring

Connect your first application and get full visibility into what’s happening in production.

DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.