API Reference

The codrsync API lets you manage workspaces programmatically. All endpoints are at https://codrsync.dev/api/.

Authentication

API requests use one of two authentication methods:

Session Auth (Web)

Browser sessions use Supabase session cookies automatically. No extra headers needed.

Device Token (CLI)

CLI clients use a Bearer token in the Authorization header:

Authorization: Bearer <device-token>

Get a device token by running codrsync auth login.

Endpoints

POST /api/concierge/start

Start a new workspace session.

Request Body:

json
{ "projectUrl": "https://github.com/user/repo", "language": "en", "templateId": "landing-page" }
FieldTypeRequiredDescription
projectUrlstringNoGitHub repo URL to clone
languagestringNoResponse language: en, pt-br, es
templateIdstringNoTemplate ID (e.g. landing-page)
sourcestringNoClient source: web, cli
modestringNochat or init
projectContextobjectNoLocal project metadata for init mode

Response (200):

json
{ "success": true, "workspace": { "id": "uuid", "slug": "c-a1b2c3d4", "url": "https://c-a1b2c3d4.ws.codrsync.dev", "authToken": "hex-token", "conversationId": "uuid", "mode": "onboarding", "startedAt": "2025-01-01T00:00:00Z", "durationMinutes": 30, "tier": "free" } }

Error Codes:

CodeStatusDescription
auth_required401Not authenticated
trial_cooldown429Free trial used this month
capacity_full503Server at max capacity
pool_exhausted503No Claude accounts available
provision_failed503Container failed to start

GET /api/concierge/active

Check for an active workspace.

Query Params:

ParamTypeDescription
userIdstringUser ID to check

Response (200):

json
{ "workspace": { "id": "uuid", "slug": "c-a1b2c3d4", "status": "running", "url": "https://c-a1b2c3d4.ws.codrsync.dev", "authToken": "hex-token", "conversationId": "uuid" } }

POST /api/concierge/resume

Resume a paused workspace.

Request Body:

json
{ "workspaceSlug": "c-a1b2c3d4" }

POST /api/concierge/continue

Continue a session with a new container but same conversation.

Request Body:

json
{ "conversationId": "uuid" }

Rate Limits

  • Free users: 1 workspace per 30 days
  • Pro users: Unlimited workspaces
  • All users: 1 concurrent workspace

WebSocket API

The chat interface communicates via WebSocket at:

wss://<slug>.ws.codrsync.dev/ws?token=<authToken>&conversationId=<id>

Messages (Client to Server)

json
{ "type": "user_message", "content": "Hello, Claude!" }

Messages (Server to Client)

json
{ "type": "assistant_chunk", "content": "Here's what I can help with..." }

Message types: assistant_chunk, assistant_done, tool_use, tool_result, error, session_warning, session_expired.