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.
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.
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 /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.
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 startjob.started: the agent began runningjob.completed: the agent finished and a PR was openedjob.failed: the agent stopped without opening a PRpr.review_requested: the PR is ready for human review
Payload structure
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.