---
title: "File a change as an issue"
method: POST
path: "/api/v1/projects/{projectId}/changes"
tags: ["Projects"]
---

# File a change as an issue

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

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/projects/{projectId}/changes`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

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.

## Path parameters

- `projectId` string, required

## Request body

- object
  - `changeId` string, required: The change directory name. Stable identity for the issue, so renaming the directory files a second one.
  - `title` string, required
  - `body` string, required
  - `capabilities` string[]: Capabilities this change amends, applied as labels in one managed group. Labels outside that group are untouched.
  - `documents` object[]: Long parts of the change — design and requirements — attached as documents rather than inlined in the description.
    - `key` string, required: Stable key for this document, so a re-push updates it rather than adding another.
    - `title` string, required
    - `content` string, required
  - `source` object: Where the change came from. A url is attached to the issue as a link.
    - `ref` string, required
    - `url` string, uri, nullable
    - `label` string, nullable

## Response `200`

The issue tracking this change.

- object
  - `projectId` string, required
  - `changeId` string, required
  - `issueId` string, required
  - `issueUrl` string, nullable, required
  - `identifier` string, nullable, required: Linear's human key, e.g. ADE-12.
  - `created` boolean, required: False when an existing issue was updated.
  - `documentsWritten` number, required

## Other responses

- `401`: Authentication is missing or invalid.
- `403`: The caller is not permitted to perform this action.
- `404`: The resource was not found.
- `422`: Response.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
