REST API Reference

v1 · Last updated: 2026-03-24

The Open Code Review Cloud API lets you manage licenses, submit code scans, and retrieve reports programmatically. All responses are JSON.

#Authentication

Most endpoints require a Bearer token. Obtain one via /api/auth/login, then include it in your request headers:

http
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Security Note

Never expose tokens in client-side code. Use environment variables or a secret manager. Tokens expire after 24 hours.

#Base URL

text
https://cloud.opencodereview.com

All endpoint paths are relative to this base URL.

#Rate Limits

API requests are rate-limited. Exceeding the limit returns HTTP 429 with a Retry-After header.

PlanRateDailyScans
Free60 requests/min1,000/day10 scans/day
Team300 requests/min10,000/day100 scans/day
EnterpriseCustomCustomUnlimited
Responses include X-RateLimit-Remaining and X-RateLimit-Reset headers.

#Authentication

#Licenses

#Scans

#Reports

#Users

#Usage

#Error Codes

All error responses follow a consistent format:

json
{
  "error": {
    "code": 401,
    "message": "Invalid or expired access token",
    "details": null
  }
}
CodeNameDescription
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid access token
403ForbiddenInsufficient permissions for this action
404Not FoundResource not found
409ConflictResource already exists (e.g., duplicate email)
429Too Many RequestsRate limit exceeded. Retry after the Retry-After header value.
500Internal ErrorUnexpected server error

#SDK Quick Start

Quick examples in popular languages to get you started.

JSNode.js / TypeScript

typescript
const res = await fetch('https://cloud.opencodereview.com/api/scans', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.OCR_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    repositoryUrl: 'https://github.com/your/repo',
    level: 'l3',
  }),
});

const scan = await res.json();
console.log('Scan ID:', scan.id);

PyPython

python
import requests, os

resp = requests.post(
    "https://cloud.opencodereview.com/api/scans",
    headers={"Authorization": f"Bearer {os.environ['OCR_TOKEN']}"},
    json={
        "repositoryUrl": "https://github.com/your/repo",
        "level": "l3",
    },
)

scan = resp.json()
print(f"Scan ID: {scan['id']}")

$cURL

shell
# Submit a scan
curl -X POST https://cloud.opencodereview.com/api/scans \
  -H "Authorization: Bearer $OCR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"repositoryUrl":"https://github.com/your/repo","level":"l3"}'

# Poll for results
curl https://cloud.opencodereview.com/api/scans/scan_abc123 \
  -H "Authorization: Bearer $OCR_TOKEN"

Ready to get started?

Sign up for a free account, grab your API token, and start integrating.