Projects

/api/v1 operations for projects. See HTTP API for authentication, the error envelope, and rate limits.

Operations

GET /api/v1/projects

List projects

Returns the organization's live projects with their current spec revision and member count. Never includes spec bodies.

Auth: API key required.

Operation ID: listProjects

Responses:

CLI: khotan projects list

POST /api/v1/projects

Create a project

Creates a project and its single root goal node. The slug is derived from the name when omitted and must be unique among the organization's live projects.

Auth: API key required.

Operation ID: createProject

Request body (application/json, required):

Responses:

CLI: khotan projects create

GET /api/v1/projects/linear-options

List Linear projects that can be bound

Returns Linear projects visible to this workspace. Use this to pick a project to bind; a new Khotan project mints its own Linear project on first push.

Auth: API key required.

Operation ID: listLinearProjectOptions

Query parameters:

Responses:

CLI: khotan projects linear options

GET /api/v1/projects/{projectId}

Get a project

Returns one project by id or slug. Cross-organization requests are answered as not found.

Auth: API key required.

Operation ID: getProject

Path parameters:

Responses:

CLI: khotan projects get

PATCH /api/v1/projects/{projectId}

Update a project

Updates a project's Khotan-owned attributes. An omitted field, including tags, stays unchanged; a sent tags list replaces the stored list. The slug is immutable, and execution state is never writable here — the tracker owns it.

Auth: API key required.

Operation ID: updateProject

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects update

DELETE /api/v1/projects/{projectId}

Delete a project

Soft-deletes a project and frees its slug for reuse. The linked tracker project is retained.

Auth: API key required.

Operation ID: deleteProject

Path parameters:

Responses:

CLI: khotan projects delete

GET /api/v1/projects/{projectId}/spec

Read a project spec

Returns the project's spec tree limited to the requested altitude: high renders the goal, medium adds phases, low adds items joined with their mirrored tracker issues. Defaults to high.

Auth: API key required.

Operation ID: getProjectSpec

Path parameters:

Query parameters:

Responses:

CLI: khotan projects spec

POST /api/v1/projects/{projectId}/spec

Commit a spec revision

Applies edits to one or more spec nodes as a single project spec revision. Each edit carries the document revision it was based on, and the request carries the project revision the author last saw; either being stale returns 409.

Auth: API key required.

Operation ID: commitProjectSpecRevision

Path parameters:

Request body (application/json, required):

Responses:

POST /api/v1/projects/{projectId}/spec/nodes

Create a spec node

Creates a child under an existing spec node. Use this to add a delivery phase under the Milestones section, or an item under a phase. The thirteen section headings are created with the project and cannot be added here.

Auth: API key required.

Operation ID: createProjectSpecNode

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects node create

PATCH /api/v1/projects/{projectId}/spec/nodes/{nodeId}

Update a spec node

Updates a node's title, sibling position, parent, or milestone plan. A move is applied first so a node that is becoming a phase can then accept dates. Each field is optional; omitted fields are left alone.

Auth: API key required.

Operation ID: updateProjectSpecNode

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects node update

DELETE /api/v1/projects/{projectId}/spec/nodes/{nodeId}

Delete a spec node

Soft-deletes the node and its descendants. The goal node cannot be deleted — delete the project instead.

Auth: API key required.

Operation ID: deleteProjectSpecNode

Path parameters:

Responses:

CLI: khotan projects node delete

GET /api/v1/projects/{projectId}/revisions

List spec revisions

Returns the project's committed spec revisions newest-first, with actor, timestamp, change summary, and the number of documents each revision bundled.

Auth: API key required.

Operation ID: listProjectSpecRevisions

Path parameters:

Query parameters:

Responses:

CLI: khotan projects revisions

GET /api/v1/projects/{projectId}/revisions/{revision}

Get a spec revision

Returns one committed spec revision: each bundled document's content alongside the previous revision's content, plus the cause and effect provenance edges attached to it.

Auth: API key required.

Operation ID: getProjectSpecRevision

Path parameters:

Responses:

CLI: khotan projects revision

GET /api/v1/projects/{projectId}/members

List project members

Returns the embedded apps, pipelines, and databases attached to this project.

Auth: API key required.

Operation ID: listProjectMembers

Path parameters:

Responses:

CLI: khotan projects members

POST /api/v1/projects/{projectId}/members

Attach a resource to a project

Attaches an embedded app, pipeline, or database. A resource already attached elsewhere returns 409 until it is detached.

Auth: API key required.

Operation ID: attachProjectMember

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects attach

DELETE /api/v1/projects/{projectId}/members

Detach a resource from a project

Removes the membership. The underlying app, pipeline, or database is untouched.

Auth: API key required.

Operation ID: detachProjectMember

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects detach

GET /api/v1/projects/{projectId}/metrics

List project metrics

Returns the project's metrics with their attributes, curation, and last-reported time, in curated order. Hidden metrics are included only for owner, admin, and developer keys.

Auth: API key required.

Operation ID: listProjectMetrics

Path parameters:

Responses:

CLI: khotan projects metrics list

POST /api/v1/projects/{projectId}/metrics

Report project metrics

Creates or updates metric definitions and sets their points. Idempotent: series and breakdown points are keyed by bucket (and category), scatter points by id, so a retried report never double-counts. The whole report is validated before anything is written. Curation made in Khotan — name, order, hidden, headline — is never overwritten.

Auth: API key required.

Operation ID: reportProjectMetrics

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects metrics report

GET /api/v1/projects/{projectId}/metrics/{metricKey}

Get a project metric

Returns one metric's points over a range, with the range value, the preceding range's value, and the change. An empty range has a null value, never 0.

Auth: API key required.

Operation ID: getProjectMetric

Path parameters:

Query parameters:

Responses:

CLI: khotan projects metrics get

PATCH /api/v1/projects/{projectId}/metrics/{metricKey}

Update a project metric's curation

Changes a metric's display name, position, hidden flag, or headline flag. Reports never overwrite these. Hiding a headline metric clears headline; a project has at most three headline metrics, and a scatter metric cannot be headline.

Auth: API key required.

Operation ID: updateProjectMetric

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects metrics update

DELETE /api/v1/projects/{projectId}/metrics/{metricKey}

Delete a project metric

Removes the metric, its curation, and all of its points. A later report naming the same key creates a new metric with default curation.

Auth: API key required.

Operation ID: deleteProjectMetric

Path parameters:

Responses:

CLI: khotan projects metrics delete

POST /api/v1/projects/{projectId}/changes

File a change as an issue

Creates or updates the issue tracking one OpenSpec change directory under this project. Khotan owns the issue's title and description; its state, assignee, priority, and dates stay with the tracker. Idempotent by change id.

Auth: API key required.

Operation ID: syncProjectChange

Path parameters:

Request body (application/json, required):

Responses:

POST /api/v1/projects/{projectId}/linear

Bind a project to Linear

Binds this project to an existing Linear project, or clears the binding when linearProjectId is null. Binding adopts that project's milestones read-only. To create a fresh empty Linear project instead, use the mint action.

Auth: API key required.

Operation ID: bindLinearProject

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan projects linear bind

GET /api/v1/linear/initiative

Get the workspace's Linear initiative link

Returns the Linear initiative currently linked to this workspace, or null when none is linked.

Auth: API key required.

Operation ID: getLinearInitiative

Responses:

POST /api/v1/linear/initiative

Link the workspace's Linear initiative

Links this workspace to an existing Linear initiative by id or URL. Minted Linear projects are created beneath it. Restricted to owner and admin.

Auth: API key required.

Operation ID: linkLinearInitiative

Request body (application/json, required):

Responses:

DELETE /api/v1/linear/initiative

Unlink the workspace's Linear initiative

Removes the Linear initiative link from this workspace. Restricted to owner and admin.

Auth: API key required.

Operation ID: unlinkLinearInitiative

Responses: