> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# changes.create()

> Create a change on top of an existing base change.

Create a new change, optionally applying initial file operations atomically. File content must be base64-encoded.

**Required scope: `write`**

```ts theme={null}
import { Buffer } from 'node:buffer';

const change = await mesa.changes.create({
  repo: 'app',
  base_change_id: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
  message: 'Add README',
  author: { name: 'Docs Bot', email: 'docs@example.com' },
  files: [
    {
      path: 'README.md',
      content: Buffer.from('# App\n').toString('base64'),
    },
    { path: 'old.txt', action: 'delete' },
  ],
});
```

## Options

<ParamField path="repo" type="string" required>
  Repository name.
</ParamField>

<ParamField path="base_change_id" type="string" required>
  Change to create the new change on top of. Use Mesa's virtual root change ID for the first change in an empty repository.
</ParamField>

<ParamField path="org" type="string | undefined">
  Organization override.
</ParamField>

<ParamField path="message" type="string | undefined">
  Change description. Required when `files` is non-empty. When `files` is omitted, omit `message` to create the change with no description, or pass `""` explicitly.
</ParamField>

<ParamField path="author" type="object | undefined">
  Commit author identity. Required when `files` is non-empty.
</ParamField>

<ParamField path="committer" type="object | undefined">
  Committer identity. When omitted, the server falls back to `author`.
</ParamField>

<ParamField path="files" type="array | undefined">
  File operations to apply atomically. Upserts use `{ path, content, encoding?, action?, mode? }`; deletes use `{ path, action: 'delete' }`.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Change ID.
</ResponseField>

<ResponseField name="current_commit_oid" type="string">
  Current commit OID for the change.
</ResponseField>

<ResponseField name="is_conflicted" type="boolean">
  Whether the current commit still contains unresolved conflicts.
</ResponseField>

<ResponseField name="message" type="string">
  Current change description. Empty string means the change has no description.
</ResponseField>

<ResponseField name="author" type="CommitIdentity">
  Commit author identity.
</ResponseField>

<ResponseField name="committer" type="CommitIdentity">
  Committer identity.
</ResponseField>

<ResponseField name="parents" type="string[]">
  Parent change IDs for this change.
</ResponseField>

<ResponseField name="created_at" type="string">
  Creation time.
</ResponseField>

<ResponseField name="updated_at" type="string">
  Last update time.
</ResponseField>

### CommitIdentity

<ResponseField name="name" type="string">
  Author or committer display name.
</ResponseField>

<ResponseField name="email" type="string">
  Author or committer email address.
</ResponseField>

<ResponseField name="date" type="string | undefined">
  Timestamp for this identity when provided.
</ResponseField>
