v2.4.0

Zento API Reference — REST API v2

Build powerful integrations with Zento. Use our REST API to trigger reviews, manage repositories, generate reports, and listen for webhook events.

Base URL & Versioning

All API requests must be made to the production endpoint. We use a strict versioning policy to ensure backward compatibility. If you hit a deprecated endpoint, we will return a 410 Gone status code.

We recommend pinning your integration to a specific version (e.g., v2) in your configuration to prevent breaking changes.

Zento API Dashboard showing integration settings

Authentication

API Keys

Use a secret API key for server-to-server communication. Include the key in the Authorization header as a Bearer token.

curl https://api.zento.io/v2/reviews \
-H "Authorization: Bearer sk_live_51Mz..."

OAuth 2.0

For applications requiring user-level access, use the OAuth2 flow. Grant scopes for read:reviews or write:repos.

GET /oauth2/authorize?client_id=...&scope=read:reviews

Reviews Endpoints

Trigger, manage, and retrieve code review artifacts.

POST

Create Review

Initiates a new AI code review for a specific pull request or commit.

POST /v2/reviews
{ "repo_id": "repo_123", "pr_number": 42 }
GET

List Reviews

Paginated list of all reviews for a repository, sorted by creation date.

GET /v2/reviews?repo_id=repo_123
GET

Get Review Details

Retrieve the full analysis, findings, and suggested fixes for a specific review ID.

GET /v2/reviews/{review_id}
DELETE

Cancel Review

Stops an in-progress review. Only reviews with status processing can be cancelled.

DELETE /v2/reviews/{review_id}

Repositories Endpoints

Connect your source code repositories to Zento.

POST

Connect Repository

Syncs a new repository with Zento. Requires a valid GitHub/GitLab token.

POST /v2/repos
{ "provider": "github", "token": "ghp_..." }
GET

List Repositories

Returns all repositories connected to your API key.

GET /v2/repos
DELETE

Remove Repository

Disconnects a repository and deletes all associated review history.

DELETE /v2/repos/{repo_id}

Rules Endpoints

Define custom linting and security rules for your team.

GET

List Custom Rules

Retrieve all active custom rules configured for a specific repository.

GET /v2/rules?repo_id=repo_123
POST

Create Rule

Create a new rule to enforce specific coding standards or security policies.

POST /v2/rules
{ "name": "No SQL in JS", "severity": "error" }
PUT

Update Rule

Modify the configuration of an existing rule.

PUT /v2/rules/{rule_id}

Reports Endpoints

Generate and export comprehensive analysis reports.

POST

Generate Report

Creates a new report based on a specific time range or repository.

POST /v2/reports/generate
{ "repo_id": "repo_123", "start_date": "2023-10-01" }
GET

Export Report

Download a report in PDF or JSON format.

GET /v2/reports/{report_id}/export?format=json

Webhooks

Listen for real-time events from Zento.

Configure a webhook URL in your repository settings to receive events such as review.completed, repo.connected, or review.failed. We guarantee at least one delivery attempt.

Retry Policy: Failed deliveries are retried up to 3 times with exponential backoff (5s, 15s, 45s). If all retries fail, the event is permanently discarded.

// Example Payload
{
"event": "review.completed",
"data": {
"review_id": "rev_998",
"status": "passed",
"score": 98
},
"timestamp": "2023-10-27T10:00:00Z"
}

Rate Limits & Errors

1,000
Requests per minute (Free)
5,000
Requests per minute (Pro)
10,000
Requests per minute (Enterprise)

429 Too Many Requests

You have exceeded the rate limit for your plan. Wait a minute before retrying, or upgrade your plan for higher throughput.

401 Unauthorized

Invalid or missing API key. Ensure the Authorization header is set correctly.

404 Not Found

The requested resource or endpoint does not exist. Check your URL and version number.

500 Internal Server Error

An unexpected error occurred on our side. Please retry the request.

Official SDKs

Use our official libraries for a smoother development experience.

Changelog

v2.4.0 — Oct 15, 2023

Added support for DELETE /v2/reviews/{id} to cancel reviews. Improved rate limit headers for better client-side throttling.

v2.3.1 — Sep 28, 2023

Bug fix: Webhook payloads for repo.connected now include the full repository object.

v2.3.0 — Sep 10, 2023

New endpoint: POST /v2/reports/generate for custom date range reporting.