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" }
| Field | Type | Required | Description |
|---|---|---|---|
projectUrl | string | No | GitHub repo URL to clone |
language | string | No | Response language: en, pt-br, es |
templateId | string | No | Template ID (e.g. landing-page) |
source | string | No | Client source: web, cli |
mode | string | No | chat or init |
projectContext | object | No | Local 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:
| Code | Status | Description |
|---|---|---|
auth_required | 401 | Not authenticated |
trial_cooldown | 429 | Free trial used this month |
capacity_full | 503 | Server at max capacity |
pool_exhausted | 503 | No Claude accounts available |
provision_failed | 503 | Container failed to start |
GET /api/concierge/active
Check for an active workspace.
Query Params:
| Param | Type | Description |
|---|---|---|
userId | string | User 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.