API Reference

Actions

The Actions endpoint allows you to request Bugpilot reports from your end users.

This is where you show your users how to set it up. You can use code samples, like this:

curl \
  -X POST \
  -H "Content-Type: application/json" \
  -H "User-Agent: Bugpilot API Client/1.0" \
  -H "X-Bugpilot-Api-Key: <ID FROM BUGPILOT API SETTINGS>" \
  -d '{
    "workspaceId": "<WORKSPACE ID FROM BUGPILOT API SETTINGS>",
    "userId": "end-user-id",
    "action": "upload-session"
  }' \
  https://widget-api.bugpilot.io/api/v1/action
const result = await fetch("https://widget-api.bugpilot.io/api/v1/action", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "User-Agent": "Bugpilot API Client/1.0",
    "X-Bugpilot-Api-Key": "<ID FROM BUGPILOT API SETTINGS>",
  },
  body: JSON.stringify({
    workspaceId: "<WORKSPACE ID FROM BUGPILOT API SETTINGS>",
    userId: "end-user-id",
    action: "upload-session",
  }),
});

if (!result.ok) {
  throw new Error(`Bugpilot API error: ${result.status} ${result.statusText}`);
}

const body = await result.json();

// body.ok is true if the operation was successful
// body.error and body.error_message are strings if the operation failed

Try dragging a block from the right to see how easy it is to add more content!