Automations API
Create, manage, and delete automations that trigger scans automatically based on events like git pushes, pull requests, schedules, or custom webhooks.
Base URL
https://bugrit.com/api/v1/automationsAuthentication
All endpoints require an API key with automations:read or automations:write permissions.
Authorization: Bearer YOUR_API_KEYList Automations
GET
/api/v1/automationsList all automations for your organization.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
project_id | string | Filter by project ID |
enabled | boolean | Filter by enabled status |
trigger_type | string | Filter by trigger type |
page | number | Page number (default: 1) |
per_page | number | Items per page (default: 20, max: 100) |
Example Request
curl https://bugrit.com/api/v1/automations?project_id=proj-abc123 \ -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
"automations": [
{
"id": "auto-xyz789",
"name": "Scan on push to main",
"projectId": "proj-abc123",
"organizationId": "org-def456",
"trigger": {
"type": "github_push",
"config": {
"repository": "yourorg/yourrepo",
"branches": ["main", "develop"]
}
},
"action": {
"type": "scan",
"config": {
"platform": "web",
"tools": "all",
"failOn": "critical"
}
},
"enabled": true,
"lastTriggeredAt": "2026-01-22T10:30:00Z",
"triggerCount": 47,
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-01-22T10:30:00Z"
}
],
"pagination": {
"page": 1,
"perPage": 20,
"total": 3
}
}Get Automation
GET
/api/v1/automations/:automationIdRetrieve a single automation by ID.
Example Request
curl https://bugrit.com/api/v1/automations/auto-xyz789 \ -H "Authorization: Bearer YOUR_API_KEY"
Create Automation
POST
/api/v1/automationsCreate a new automation.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the automation |
projectId | string | Yes | Project to run scans against |
trigger | object | Yes | Trigger configuration (see below) |
action | object | Yes | Action configuration (see below) |
enabled | boolean | No | Whether automation is active (default: true) |
Trigger Types
github_pushTriggers on push to GitHub repository
{
"type": "github_push",
"config": {
"repository": "owner/repo",
"branches": ["main", "develop"]
}
}github_prTriggers on pull request events
{
"type": "github_pr",
"config": {
"repository": "owner/repo",
"events": ["opened", "synchronize"],
"targetBranches": ["main"]
}
}gitlab_pushTriggers on push to GitLab repository
{
"type": "gitlab_push",
"config": {
"projectPath": "group/project",
"branches": ["main"]
}
}scheduleTriggers on a cron schedule
{
"type": "schedule",
"config": {
"cron": "0 2 * * *",
"timezone": "UTC"
}
}webhookTriggers when webhook URL is called
{
"type": "webhook",
"config": {}
}
// Returns a unique webhook URL after creationAction Configuration
{
"type": "scan",
"config": {
"platform": "web", // web, ios, android, desktop
"tools": "all", // all, security, quality, or array of tool IDs
"sourceOverride": { // Optional: override source from trigger
"type": "url",
"targetUrl": "https://staging.example.com"
},
"failOn": "critical", // critical, high, medium, low, or null
"notifications": {
"slack": "#security-alerts",
"email": ["team@example.com"]
}
}
}Example Request
curl -X POST https://bugrit.com/api/v1/automations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Scan PRs to main",
"projectId": "proj-abc123",
"trigger": {
"type": "github_pr",
"config": {
"repository": "yourorg/yourrepo",
"events": ["opened", "synchronize"],
"targetBranches": ["main"]
}
},
"action": {
"type": "scan",
"config": {
"platform": "web",
"tools": ["security", "quality"],
"failOn": "critical"
}
},
"enabled": true
}'Example Response
{
"automation": {
"id": "auto-new123",
"name": "Scan PRs to main",
"projectId": "proj-abc123",
"organizationId": "org-def456",
"trigger": {
"type": "github_pr",
"config": {
"repository": "yourorg/yourrepo",
"events": ["opened", "synchronize"],
"targetBranches": ["main"]
}
},
"action": {
"type": "scan",
"config": {
"platform": "web",
"tools": ["security", "quality"],
"failOn": "critical"
}
},
"webhookUrl": null,
"enabled": true,
"triggerCount": 0,
"createdAt": "2026-01-23T12:00:00Z",
"updatedAt": "2026-01-23T12:00:00Z"
}
}Update Automation
PATCH
/api/v1/automations/:automationIdUpdate an existing automation. All fields are optional.
Example Request
curl -X PATCH https://bugrit.com/api/v1/automations/auto-xyz789 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"action": {
"type": "scan",
"config": {
"platform": "web",
"tools": "all",
"failOn": "high"
}
}
}'Delete Automation
DELETE
/api/v1/automations/:automationIdPermanently delete an automation.
Example Request
curl -X DELETE https://bugrit.com/api/v1/automations/auto-xyz789 \ -H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
"success": true,
"message": "Automation deleted successfully"
}Get Trigger History
GET
/api/v1/automations/:automationId/historyView recent trigger events for an automation.
Example Response
{
"history": [
{
"id": "trig-abc123",
"automationId": "auto-xyz789",
"triggeredAt": "2026-01-22T10:30:00Z",
"triggerData": {
"commitSha": "abc123def456",
"branch": "main",
"author": "developer@example.com"
},
"scanId": "scn-created123",
"status": "completed",
"duration": 180000
}
],
"pagination": {
"page": 1,
"perPage": 20,
"total": 47
}
}AI Coding Assistant Prompt
Copy this to have your AI assistant work with the Automations API:
I need to create a Bugrit automation via the API. Here are the details: API Base: https://bugrit.com/api/v1/automations Auth: Bearer token in Authorization header Help me create an automation that: 1. Triggers on [push to main / PR to main / schedule / webhook] 2. Runs a [security / full / specific tools] scan 3. Fails the build if [critical / high / any] issues are found 4. Notifies [Slack channel / email] on completion Use curl commands and show me the expected response.
Error Codes
| Code | Message | Description |
|---|---|---|
400 | Invalid trigger type | Trigger type not supported |
400 | Invalid cron expression | Schedule trigger has invalid cron |
403 | Project access denied | No access to specified project |
404 | Automation not found | Automation ID doesn't exist |
429 | Automation limit reached | Max automations for tier reached |