Skip to main content

Overview

The Sentry integration connects Potpie to your Sentry organization via OAuth. Once connected, Potpie receives error event webhooks from Sentry and can query issue data through the Sentry API.

Setup

1

Create a Sentry OAuth Application

Log into Sentry.io and go to Settings → Account → Developer Settings.Click New Public Integration and configure:
FieldValue
NamePotpie AI Integration
Webhook URLhttps://app.potpie.ai/integrations/sentry/webhook
Redirect URLhttps://app.potpie.ai/integrations/sentry/callback
Verify SSL
Select recommended scopes:
  • org:read — Read organization data
  • project:read — Read project configuration
  • event:read — Read error events
  • event:write — Update error status (optional)
Save and copy the Client ID and Client Secret.
2

Configure Environment Variables

Add your Sentry OAuth credentials:
SENTRY_CLIENT_ID=your_sentry_client_id
SENTRY_CLIENT_SECRET=your_sentry_client_secret
3

Connect via Potpie Dashboard

In the Potpie dashboard:
  1. Navigate to Settings → Integrations
  2. Click Connect on Sentry
  3. Select your organization
  4. Authorize Potpie access
  5. Name the integration
After authorization completes, the Sentry integration status shows as active.

Authorization Flow


Token Management

Potpie stores tokens encrypted at rest and refreshes them automatically.
TokenLifetimeBehavior
Access token1 hourAuto-refreshed before expiry
Refresh tokenLong-livedRotates on each refresh
OAuth endpoint URLs and token refresh details are available in the Sentry API reference.

Sentry API Reference

Base URL: https://sentry.io/api/0/
EndpointDescription
/organizations/List organizations
/organizations/{org}/projects/List projects
/projects/{org}/{project}/issues/List error issues
/projects/{org}/{project}/events/List events

Potpie API Reference

Base: /api/v2/integrations/sentry
MethodEndpointDescription
POST/initiateStart OAuth flow
GET/oauth/callbackHandle OAuth callback
POST/saveSave integration
GET/status/{user_id}Check status
DELETE/revoke/{user_id}Revoke access

Save Integration

POST /api/v2/integrations/sentry/save
{
  "code": "oauth_authorization_code",
  "redirect_uri": "https://app.potpie.ai/integrations/sentry/callback",
  "instance_name": "My Sentry Org",
  "integration_type": "sentry",
  "timestamp": "2024-02-17T10:00:00Z"
}
Response:
{
  "success": true,
  "data": {
    "integration_id": "int_abc123",
    "integration_type": "sentry",
    "status": "active",
    "scope_data": {
      "org_slug": "your-org",
      "installation_id": "install_123"
    }
  },
  "error": null
}

Check Status

GET /api/v2/integrations/sentry/status/{user_id}

Response:
{
  "user_id": "user_123",
  "is_connected": true,
  "connected_at": "2024-02-17T10:00:00Z",
  "scope": "org:read project:read event:read",
  "expires_at": "2024-02-17T11:00:00Z"
}