Skip to main content
Docs Navigation

REST API Reference

Base URL: https://forgeos-api.synctek.io

All endpoints require authentication unless noted otherwise. Include one of:

  • Session cookie: forge_session (set by POST /auth/login)
  • API key header: X-ForgeOS-API-Key: fos_your_key_here

Responses are JSON. Errors follow the format {"detail": "error message"}.


Auth

Authentication, registration, and session management.

POST /auth/register

Create a new user account. No auth required.

Terminal window
curl -X POST https://forgeos-api.synctek.io/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "dev@company.com", "password": "secure-password-12"}'

Request body:

FieldTypeRequiredDescription
emailstringYesEmail address
passwordstringYes12-128 characters

Response 201:

{
"user_id": "usr_a1b2c3d4",
"email": "dev@company.com",
"role": "user",
"created_at": "2026-02-25T10:00:00Z",
"trial_activated": true,
"plan": "pro",
"plan_status": "trialing",
"plan_expires_at": "2026-03-11T10:00:00Z"
}

Errors: 409 email exists, 422 validation failed.


POST /auth/login

Authenticate and create a session. Sets forge_session and forge_csrf cookies. No auth required.

Terminal window
curl -X POST https://forgeos-api.synctek.io/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "dev@company.com", "password": "secure-password-12"}' \
-c cookies.txt

Request body:

FieldTypeRequiredDescription
emailstringYesEmail address
passwordstringYesPassword

Response 200:

{
"user_id": "usr_a1b2c3d4",
"email": "dev@company.com",
"role": "user"
}

Errors: 401 invalid credentials (identical error for wrong password and unknown email — no enumeration).


POST /auth/logout

Invalidate the current session and clear cookies.

Response 204: No content.

Errors: 401 no valid session.


GET /auth/me

Get the current authenticated user’s info.

Response 200:

{
"user_id": "usr_a1b2c3d4",
"email": "dev@company.com",
"role": "user",
"created_at": "2026-02-25T10:00:00Z"
}

POST /auth/register-agent

Register an autonomous agent identity. No auth required. Returns an API key scoped to the agent.

Terminal window
curl -X POST https://forgeos-api.synctek.io/auth/register-agent \
-H "Content-Type: application/json" \
-d '{
"email": "ci-agent@company.com",
"password": "secure-agent-password"
}'

Request body:

FieldTypeRequiredDescription
emailstringYesAgent’s email address
passwordstringYes12-128 characters
org_namestringNoOrganization name

Projects

CRUD operations for projects. All endpoints require auth.

POST /api/projects

Create a new project. Optionally import an existing codebase by providing source_directory.

Terminal window
curl -X POST https://forgeos-api.synctek.io/api/projects \
-H "Content-Type: application/json" \
-H "X-ForgeOS-API-Key: fos_your_key" \
-d '{
"name": "my-app",
"description": "Web application",
"platform": "web"
}'

Request body:

FieldTypeRequiredDescription
namestringYesProject name
descriptionstringYesProject description
platformstringYesPlatform (e.g., web, mobile, api)
constraintsobjectNoProject constraints
source_directorystringNoPath to existing codebase (triggers auto-scan)

Response 201: Full project object with generated id (e.g., proj_a1b2c3d4).


GET /api/projects

List all projects (lightweight summaries). Filtered by the requesting user’s organization.

Response 200: Array of project summaries.

[
{
"id": "proj_a1b2c3d4",
"name": "my-app",
"platform": "web",
"status": "created",
"created_at": "2026-02-25T10:00:00Z"
}
]

GET /api/projects/{project_id}

Retrieve a single project by ID.

Response 200: Full project object.

Errors: 403 access denied, 404 not found.


DELETE /api/projects/{project_id}

Delete a project. The governance ledger is preserved for audit trail.

Response 204: No content.


Initiatives

Track units of work within a project.

POST /api/projects/{project_id}/initiatives

Create a new initiative.

Terminal window
curl -X POST https://forgeos-api.synctek.io/api/projects/proj_abc/initiatives \
-H "Content-Type: application/json" \
-H "X-ForgeOS-API-Key: fos_your_key" \
-d '{
"title": "Add user authentication",
"description": "Implement login, registration, and session management",
"priority": "high"
}'

Request body:

FieldTypeRequiredDescription
titlestringYesInitiative title
descriptionstringYesWhat this initiative accomplishes
prioritystringNolow, medium, high, or critical (default: medium)

Response 201: Full initiative object with generated id (e.g., init_a1b2c3d4).


GET /api/projects/{project_id}/initiatives

List all initiatives for a project, optionally filtered by status.

Query params: status (optional) — filter by active, completed, or abandoned.

Response 200: Array of initiative summaries.


GET /api/projects/{project_id}/initiatives/{init_id}

Retrieve a single initiative.


PATCH /api/projects/{project_id}/initiatives/{init_id}

Update an initiative’s status or priority.

Request body:

FieldTypeRequiredDescription
statusstringNoactive, completed, or abandoned
prioritystringNolow, medium, high, or critical

Changesets

Propose and track code changes with auto-computed risk profiles.

POST /api/projects/{project_id}/changesets

Propose a new changeset. Automatically computes risk score and creates a gate pipeline.

Terminal window
curl -X POST https://forgeos-api.synctek.io/api/projects/proj_abc/changesets \
-H "Content-Type: application/json" \
-H "X-ForgeOS-API-Key: fos_your_key" \
-d '{
"initiative_id": "init_a1b2c3d4",
"description": "Add JWT token validation middleware",
"files_changed": ["src/middleware/auth.ts", "src/config.ts"],
"modules_affected": ["auth", "config"]
}'

Request body:

FieldTypeRequiredDescription
initiative_idstringYesParent initiative
descriptionstringYesWhat changed and why
files_changedstring[]YesFile paths that changed
modules_affectedstring[]YesModule/area names affected
branchstringNoGit branch name

Response 201: Changeset with embedded risk_profile (score, required gates, roles, evidence).


GET /api/projects/{project_id}/changesets

List all changesets for a project. Optional status filter.


GET /api/projects/{project_id}/changesets/{cs_id}

Retrieve a changeset with its risk profile and gate pipeline.


PATCH /api/projects/{project_id}/changesets/{cs_id}

Update a changeset’s status.


Evidence

Attach artifacts (test results, scans, etc.) to changesets to satisfy gate requirements.

POST /api/projects/{project_id}/changesets/{cs_id}/evidence

Attach evidence to a changeset. Auto-populates gate evidence requirements.

Terminal window
curl -X POST https://forgeos-api.synctek.io/api/projects/proj_abc/changesets/cs_def/evidence \
-H "Content-Type: application/json" \
-H "X-ForgeOS-API-Key: fos_your_key" \
-d '{
"type": "unit_test",
"summary": "47 tests passed, 0 failed, 92% coverage"
}'

Request body:

FieldTypeRequiredDescription
typestringYesunit_test, coverage, lint, security_scan, benchmark, migration_plan, ux_snapshot, a11y_audit, or ai_review
summarystringYesSummary of the evidence
file_refsstring[]NoFile references

Response 201: Evidence object.


GET /api/projects/{project_id}/changesets/{cs_id}/evidence

List all evidence for a changeset.


Reviews

Request and submit quality reviews on changesets. Reviews gate progression.

POST /api/projects/{project_id}/changesets/{cs_id}/reviews

Request a human review for a changeset.

Request body:

FieldTypeRequiredDescription
rolestringYesarchitect, qa_test, security, performance, reliability, accessibility, or docs_release

POST /api/projects/{project_id}/changesets/{cs_id}/reviews/ai

Request an AI-powered review. Uses Claude to analyze the changeset against the role’s quality criteria. If approved, auto-satisfies the gate role requirement.

Request body: Same as human review request (role field).

Errors: 402 AI spend cap exceeded, 503 AI service unavailable.


POST /api/projects/{project_id}/changesets/{cs_id}/reviews/complete

Combined create and submit review in one call. Designed for MCP convenience.

Request body:

FieldTypeRequiredDescription
rolestringYesReview role
statusstringYesapproved, blocked, or pending
notesstringYesReview summary (minimum 20 chars for approvals)
findingsobject[]YesStructured findings
reviewer_idstringNoReviewer identifier
reviewer_typestringNohuman or ai_agent
evidence_refsstring[]NoEvidence IDs referenced

Anti-gaming: All changesets require at least one approval from a reviewer different from the changeset creator.


GET /api/projects/{project_id}/changesets/{cs_id}/reviews

List all reviews for a changeset.


PATCH /api/projects/{project_id}/changesets/{cs_id}/reviews/{rev_id}

Submit a decision on an existing review.


Gates

Inspect and advance the governance gate pipeline for changesets.

GET /api/projects/{project_id}/changesets/{cs_id}/gates

Get the full gate pipeline. Shows all gates, their requirements, completion status, and the current active gate.

Response 200:

{
"changeset_id": "cs_def",
"current_gate": "design",
"gates": [
{
"id": "intent",
"status": "passed",
"promoted_by": "local_agent",
"promoted_at": "2026-02-25T10:05:00Z"
},
{
"id": "design",
"status": "pending",
"required_evidence": ["ai_review"],
"required_roles": ["architect"],
"satisfied_evidence": [],
"satisfied_roles": []
}
]
}

POST /api/projects/{project_id}/changesets/{cs_id}/gates/{gate_id}/promote

Promote a gate to passed. All required evidence and role reviews must be satisfied.

Gate IDs: intent, design, implementation, verification, hardening, release.

Request body (optional):

FieldTypeDescription
promoted_bystringWho is promoting (default: "local" via API, "local_agent" via MCP)

Errors: 400 requirements not met.


POST /api/projects/{project_id}/changesets/{cs_id}/gates/{gate_id}/reject

Reject a gate with a reason.

Request body:

FieldTypeDescription
reasonstringRejection reason
rejected_bystringWho is rejecting

POST /api/projects/{project_id}/changesets/{cs_id}/gates/{gate_id}/skip

Skip a gate with a waiver. Only allowed for low-risk changesets (risk score 50 or below).


GET /api/projects/{project_id}/changesets/{cs_id}/release-check

Check if a changeset is ready for release.

Response 200:

{
"can_release": true,
"blockers": []
}

Billing

Subscription management, trials, and AI spend monitoring.

POST /api/billing/trial/start

Start a 14-day free Pro trial. Available to free-plan users who have not previously trialed.

Response 200:

{
"plan": "pro",
"plan_status": "trialing",
"plan_expires_at": "2026-03-11T10:00:00Z"
}

GET /api/billing/status

Get current plan and subscription state.


POST /api/billing/checkout

Create a Stripe Checkout session for plan upgrade. Returns a checkout_url for browser redirect.

Request body:

FieldTypeRequiredDescription
plan_idstringYespro or enterprise

POST /api/billing/portal

Create a Stripe Customer Portal session for subscription management. Returns a portal_url for browser redirect.

Terminal window
curl -X POST https://forgeos-api.synctek.io/api/billing/portal \
-H "Content-Type: application/json" \
-H "X-ForgeOS-API-Key: fos_your_key" \
-d '{"return_url": "https://your-app.com/billing"}'

Request body:

FieldTypeRequiredDescription
return_urlstringYesURL to redirect back to after the portal session

GET /api/billing/spend

Get current month AI spend summary.

Response 200:

{
"org_id": "org_abc",
"spend_usd": 12.34,
"cap_usd": 50.00,
"pct": 24.68,
"period": "2026-02",
"reset_at": "2026-03-01T00:00:00Z"
}

GET /api/billing/spend/history

Get daily AI spend breakdown. Query param: days (default 30, max 90).


Shared Mind

Federated institutional knowledge — patterns, anti-patterns, and lessons shared across the team.

POST /api/shared-mind/{team_id}/observe

Record an observation.

Request body:

FieldTypeRequiredDescription
domainstringYesKnowledge domain
observation_typestringYespattern, anti-pattern, fix-recipe, architecture-decision, or lesson
contentstringYesWhat was observed
confidencenumberNo0.0-1.0 (default: 0.8)
tagsstring[]NoTags

GET /api/shared-mind/{team_id}/query

Query relevant knowledge for a context.

Query params:

ParamTypeRequiredDescription
contextstringYesFree-text context (keywords extracted automatically)
domainstringNoDomain filter

POST /api/shared-mind/{team_id}/consolidate

Trigger consolidation of raw observations into structured knowledge nodes.

Request body:

FieldTypeRequiredDescription
domainstringYesKnowledge domain to consolidate

GET /api/shared-mind/{team_id}/stats

Get aggregate statistics for a team’s Shared Mind.


GET /api/shared-mind/{team_id}/domains

List all knowledge domains.


GET /api/shared-mind/{team_id}/domain/{domain}

Get consolidated knowledge for a specific domain. Returns patterns, anti-patterns, fix recipes, and architecture decisions.


Sessions

Developer work sessions link a period of active work to a project and initiative. Sessions help attribute governance events (evidence submissions, reviews, gate promotions) to a specific developer context.

Sessions API documentation is being expanded. The endpoints below are available; full parameter and response schemas will be added in an upcoming documentation update.

POST /api/sessions

Start a new work session.

Request body:

FieldTypeRequiredDescription
project_idstringYesProject this session belongs to
developer_idstringNoDeveloper identifier (default: local)
initiative_idstringNoActive initiative for this session

Response 201: Session object with generated session_id.


GET /api/sessions/{session_id}

Get session details, including associated tasks and duration.


PATCH /api/sessions/{session_id}

Update a session record, for example to set its status to ended and finalize its duration.

Request body:

FieldTypeRequiredDescription
statusstringNoSession status (e.g., ended)

POST /api/sessions/{session_id}/tasks

Add a task log entry to a session. Useful for tracking granular steps within a work session.


Workflow

GET /api/workflow/{initiative_id}

Get current workflow state for an initiative. Returns current step, next actions, blockers, and progress percentage.

Note: This endpoint path may change in a future release. Confirm the current path against the MCP forge_get_workflow tool if you encounter routing issues.