Developer Documentation

Build with GreenCode.ai

Complete API documentation, SDKs, and integration guides to automate code scanning and security analysis in your CI/CD pipeline.

Quick Start

Step 1

Get API Key

Sign up and generate your API key from the dashboard.

Step 2

Connect Repository

Link your GitHub or Azure DevOps repository via API or OAuth.

Step 3

Run a Scan

Trigger an AI-powered security and quality scan on your codebase.

Quick Start Example
// Install the SDK
npm install @greencode/sdk

// Initialize the client
import { GreenCode } from '@greencode/sdk';

const client = new GreenCode({
  apiKey: 'your_api_key_here'
});

// Connect a repository
const repo = await client.repositories.connect({
  provider: 'github',
  owner: 'your-org',
  name: 'your-repo'
});

// Start an AI-powered scan
const scan = await client.scans.create({
  repositoryId: repo.id,
  type: 'full', // 'full' | 'security' | 'quality'
  branch: 'main'
});

console.log('Scan started:', scan.id);
console.log('Status:', scan.status);

Core API Endpoints

POST/v1/repositoriesConnect a new repository for scanning
GET/v1/repositories/:idRetrieve repository details and scan history
POST/v1/scansStart a new AI-powered code scan
GET/v1/scans/:idGet scan status and results
GET/v1/scans/:id/issuesList all issues found in a scan
POST/v1/issues/:id/fixApply AI-generated fix for an issue

Need Help?

Our developer support team is here to help you integrate GreenCode.ai into your CI/CD pipeline.