API Reference

The Codepylon REST API lets you trigger agent jobs, query job status, list connected repositories, and configure webhook event delivery. All responses are JSON. Base URL: https://api.codepylonai.com/v1

Authentication

All API requests require a bearer token in the Authorization header. Generate tokens from the dashboard under Settings > API Keys.

Authorization: Bearer cpk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Tokens are organization-scoped. A single token covers all repositories connected to your organization.

GET /agents

Returns the agent types available on your current plan. The plan_required field shows the minimum plan for each agent.

GET /v1/agents
{   "agents": [     {       "id": "pylon-test",       "name": "Pylon-Test",       "available": true,       "plan_required": "starter"     },     {       "id": "pylon-migrate",       "name": "Pylon-Migrate",       "available": true,       "plan_required": "team"     }   ] }

POST /jobs

Creates and queues a new agent job. Returns 202 Accepted with the job ID and estimated start time. Use GET /jobs/:id to poll status, or configure a webhook to receive job state events.

POST /v1/jobs
// request body {   "repo": "my-org/analytics-service",   "agent": "pylon-patch",   "ticket_id": "PROJ-1482",   "config_override": {     "auto_trigger_on_cve_severity": "high"   } }   // response 202 {   "job_id": "job_2a9f4c81d3e7",   "status": "queued",   "estimated_start_ms": 8000 }

GET /jobs/:id

Returns the current status, PR URL, and timing information for a specific job. Poll this endpoint or use webhook events to detect job completion.

GET /v1/jobs/job_2a9f4c81d3e7
{   "job_id": "job_2a9f4c81d3e7",   "status": "completed",   "agent": "pylon-patch",   "pr_url": "https://github.com/my-org/analytics-service/pull/849",   "pr_number": 849,   "started_at": "2026-06-04T14:22:10Z",   "completed_at": "2026-06-04T14:26:38Z" }

GET /repos

Returns connected repositories, their index status, and line count. A repo with index_status: "ready" is available for agent jobs. A repo with index_status: "indexing" is still building its dependency graph and cannot accept jobs yet.

GET /v1/repos
{   "repos": [     {       "id": "repo_c29a1",       "full_name": "my-org/analytics-service",       "platform": "github",       "index_status": "ready",       "line_count": 184230     }   ] }

Webhooks

Configure webhook endpoints at Settings > Webhooks. Codepylon will POST a signed payload to your endpoint whenever a job changes state. Each delivery includes a X-Pylon-Signature-256 header for HMAC-SHA256 payload verification using your webhook secret.

Event types

  • job.queued: a job was accepted and is waiting to start
  • job.started: the agent began running
  • job.completed: the agent finished and a PR was opened
  • job.failed: the agent stopped without opening a PR
  • pr.review_requested: the PR is ready for human review

Payload structure

POST your-endpoint.example.com/hooks
{   "event": "job.completed",   "job_id": "job_2a9f4c81d3e7",   "repo": "my-org/analytics-service",   "pr_url": "https://github.com/my-org/analytics-service/pull/849",   "timestamp": "2026-06-04T14:26:38Z" }

Retry behavior: Codepylon retries failed webhook deliveries up to 3 times with exponential backoff. Delivery attempts and response codes are visible under Settings > Webhooks > Delivery log.