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

# Commit changes

> Commit a project's saved changes with the `commit` GraphQL mutation.

Use the `commit` GraphQL mutation to commit a project's current changes to a branch. This is the API equivalent of saving to draft. For example, after you [create a pipeline](https://docs.prophecy.ai/api-reference/pipelines/create-pipeline.md), commit to record the new pipeline in the project's Git history.

```
POST /api/md/graphql
```

## Arguments

**projectUID** `string` *required*

ID of the project to commit, as returned in `data.addProject._id` when you [create the
project](https://docs.prophecy.ai/api-reference/projects/create-project.md).

**commitMsg** `string` *required*

Short description of the change.

**branch** `string` *required*

Branch to commit to. Use `dev` in a project that uses Simple Git.

## Response

**data.commit.commitHash** `string`

Hash of the new commit.

**data.commit.merged** `string`

Outcome of the commit, for example `Success`.

```bash cURL theme={null}
QUERY=$(tr '\n' ' ' <<'EOF'
mutation($p: String!, $msg: String!, $branch: String!) {
  commit(projectUID: $p, commitMsg: $msg, branch: $branch) { commitHash merged }
}
EOF
)
VARS='{"p": "<PROJECT_ID>", "msg": "<COMMIT_MESSAGE>", "branch": "dev"}'
curl -sS "$PROPHECY_URL/api/md/graphql" \
  -H "X-Auth-Token: $PROPHECY_TOKEN" -H "Content-Type: application/json" \
  -d "$(printf '{"query": "%s", "variables": %s}' "$QUERY" "$VARS")"
```

```json Response theme={null}
{
  "data": {
    "commit": {
      "commitHash": "<COMMIT_HASH>",
      "merged": "Success"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.