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
Create a Sentry OAuth Application
Log into Sentry.io and go to Settings → Account → Developer Settings.Click New Public Integration and configure:
Select recommended scopes:
| Field | Value |
|---|---|
| Name | Potpie AI Integration |
| Webhook URL | https://app.potpie.ai/integrations/sentry/webhook |
| Redirect URL | https://app.potpie.ai/integrations/sentry/callback |
| Verify SSL | ✓ |
org:read— Read organization dataproject:read— Read project configurationevent:read— Read error eventsevent:write— Update error status (optional)
Authorization Flow
Token Management
Potpie stores tokens encrypted at rest and refreshes them automatically.| Token | Lifetime | Behavior |
|---|---|---|
| Access token | 1 hour | Auto-refreshed before expiry |
| Refresh token | Long-lived | Rotates on each refresh |
Sentry API Reference
Base URL:https://sentry.io/api/0/
| Endpoint | Description |
|---|---|
/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
| Method | Endpoint | Description |
|---|---|---|
| POST | /initiate | Start OAuth flow |
| GET | /oauth/callback | Handle OAuth callback |
| POST | /save | Save integration |
| GET | /status/{user_id} | Check status |
| DELETE | /revoke/{user_id} | Revoke access |

