API Reference

Complete reference for the NextCoder REST API

Introduction

The NextCoder API provides programmatic access to all platform features. You can use the API to automate workflows, integrate with external systems, and build custom applications on top of NextCoder.

Base URL

https://nextcoder.icu/api

Authentication

All API requests require authentication via Clerk session cookies. Authentication is handled automatically when making requests from the browser.

Rate Limits

The API is rate-limited to prevent abuse:

  • 100 requests per minute for authenticated users
  • 10 requests per minute for unauthenticated requests

Response Format

All API responses are returned in JSON format:

{
  "id": "workspace-123",
  "name": "My Workspace",
  "createdAt": "2023-01-01T00:00:00.000Z",
  "updatedAt": "2023-01-01T00:00:00.000Z"
}

Error Responses

Error responses follow a consistent format:

{
  "error": "Error message describing what went wrong"
}

API Endpoints

Authentication

EndpointMethodDescription
/auth/sessionGETGet current user session

Workspaces

EndpointMethodDescription
/workspacesGETList all workspaces
/workspacesPOSTCreate a new workspace
/workspaces/{id}GETGet workspace details
/workspaces/{id}PUTUpdate a workspace
/workspaces/{id}DELETEDelete a workspace
/workspaces/{id}/deployPOSTDeploy a workspace

AI Agents

EndpointMethodDescription
/agentsGETList all agents
/agentsPOSTCreate a new agent
/agents/{id}GETGet agent details
/agents/{id}PUTUpdate an agent
/agents/{id}DELETEDelete an agent

Integrations

EndpointMethodDescription
/integrationsGETList all integrations
/integrationsPOSTCreate a new integration
/integrations/{id}GETGet integration details
/integrations/{id}PUTUpdate an integration
/integrations/{id}DELETEDelete an integration

Payments

EndpointMethodDescription
/payments/checkoutPOSTCreate checkout session
/payments/webhookPOSTHandle webhook events