Projects API

Create and manage projects to organize your scans and test results by app.

🎯 Not a Developer? Start Here

You don't need to write code yourself. Copy the prompts below and paste them into Claude, ChatGPT, Cursor, or any AI coding assistant. Your AI will read the docs and build what you need.

Step 1: Copy a prompt below
Step 2: Paste into your AI assistant
Step 3: AI builds it for you

💡 Why This Matters

If you're building multiple apps or have different environments (staging, production), projects keep everything organized. Each project tracks its own scan history, so you can see security trends over time.

  • Track each app separately: Your SaaS, mobile app, and marketing site each get their own security history
  • Environment-specific scanning: Create projects for staging and production to compare security posture
  • Team organization: Give different teams access to different projects

Quick Start Prompts

Common tasks for managing projects.

🚀 Auto-Create Project on First Deploy

Automatically create a Bugrit project if it doesn't exist when you deploy.

Read the Bugrit Projects API at https://bugrit.com/docs/api-reference/projects

Add logic to automatically create a Bugrit project if one doesn't exist:

1. On deploy, call GET /api/v1/projects to list existing projects
2. Search for project.name matching env.APP_NAME
3. If not found, POST /api/v1/projects with:
   - name: env.APP_NAME (required)
   - platforms: ["web"] (adjust for your app)
   - repositoryUrl: env.GITHUB_REPO_URL (optional)
4. Store the returned project.id in .bugrit-config.json
5. Use this project ID as applicationId when triggering scans

Use BUGRIT_API_KEY from environment. Handle errors gracefully.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)

Create Project Example

curl -X POST https://bugrit.com/api/v1/projects \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My App",
    "platforms": ["web", "ios"],
    "description": "Main web application",
    "repositoryUrl": "https://github.com/org/repo"
  }'

📊 Project Dashboard Component

Build a dashboard showing all your projects and their security status.

Read these Bugrit API docs:
- Projects: https://bugrit.com/docs/api-reference/projects
- Scans: https://bugrit.com/docs/api-reference/scans

Create a React component that lists all Bugrit projects:

1. Fetch GET /api/v1/projects
2. For each project, display a card showing:
   - project.name and project.description
   - Platform icons (web/ios/android from project.platforms)
   - Fetch latest scan: GET /api/v1/scans?applicationId={project.id}&limit=1
   - Show scan status and issue counts (summary.critical + summary.high)
3. On click, navigate to project detail page
4. "New Project" button opens modal with form:
   - name (required), platforms (checkbox), description, repositoryUrl
   - Submit: POST /api/v1/projects
5. Include loading, error, and empty states

Use my existing component library.
My stack: [YOUR_STACK]

🌍 Multi-Environment Setup

Create separate projects for staging and production environments.

Read the Bugrit Projects API at https://bugrit.com/docs/api-reference/projects

Set up multi-environment Bugrit projects:

1. Create three projects via POST /api/v1/projects:
   - "MyApp - Development" (platforms: ["web"])
   - "MyApp - Staging" (platforms: ["web"])
   - "MyApp - Production" (platforms: ["web"])
2. Store project IDs in environment variables:
   - BUGRIT_PROJECT_DEV, BUGRIT_PROJECT_STAGING, BUGRIT_PROJECT_PROD
3. In CI/CD, use the appropriate project ID based on branch:
   - develop → BUGRIT_PROJECT_DEV
   - staging → BUGRIT_PROJECT_STAGING
   - main → BUGRIT_PROJECT_PROD
4. Create a comparison dashboard showing security posture across environments

My stack: [YOUR_STACK]

List Projects

Get All Your Projects

Fetch a list of all projects in your organization.

Read the Bugrit Projects API at https://bugrit.com/docs/api-reference/projects

Create a function to list all projects:

1. Call GET /api/v1/projects
2. Response has data array with projects and pagination object
3. Each project has: id, name, description, platforms, repositoryUrl, createdAt
4. Return projects sorted by most recently updated
5. Handle pagination if needed (page, per_page params)

My stack: [YOUR_STACK]
👩‍💻 Technical Reference
GET/api/v1/projects

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (max: 100, default: 20)

Example Response

{
  "success": true,
  "data": [
    {
      "id": "prj-abc123",
      "name": "My App",
      "description": "Main web application",
      "platforms": ["web", "ios"],
      "repositoryUrl": "https://github.com/org/repo",
      "defaultBranch": "main",
      "organizationId": "org-xyz789",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 20,
    "total": 1
  }
}

Create Project

Create a New Project

Add a new project to your organization.

Read the Bugrit Projects API at https://bugrit.com/docs/api-reference/projects

Add a "Create Project" form to my app:

1. Form fields:
   - name (required): text input
   - platforms (required): checkbox group (web, ios, android, desktop)
   - description: textarea
   - repositoryUrl: URL input
   - defaultBranch: text input (default: "main")
2. On submit, POST /api/v1/projects with form data
3. Show success message with new project ID
4. Redirect to project detail page
5. Handle validation errors from API

Use my existing form components.
My stack: [YOUR_STACK]
👩‍💻 Technical Details (for developers)
POST/api/v1/projects

Request Body

FieldTypeRequiredDescription
namestringYesProject name
platformsstring[]YesArray of: web, ios, android, desktop
descriptionstringNoProject description
repositoryUrlstringNoGitHub repository URL
defaultBranchstringNoDefault branch name (default: main)

Project Operations

GET/api/v1/projects/:projectId

Returns details for a specific project.

PUT/api/v1/projects/:projectId

Updates an existing project. Only include fields you want to update.

DELETE/api/v1/projects/:projectId

Permanently deletes a project and all associated scans and test results.

Platform Restrictions

Platform access is restricted by subscription tier:

TierPlatforms
Freeweb only
Proweb, ios, android
Businessweb, ios, android, desktop