Request Body
| Parameter | Type | Description |
|---|---|---|
sha | Required | Commit SHA to attach the note to |
action | Optional | Set to "add" to create a new note (default) |
note | Required | The note content |
author | Optional | Object with name and email for the notes commit |
expected_ref_sha | Optional | Expected notes ref SHA for optimistic concurrency control |
JWT Requirements
- The JWT must include the repository in the
repoclaim - Requires
git:writescope
Response
Response Fields
| Field | Type | Description |
|---|---|---|
sha | String | The commit SHA the note is attached to |
target_ref | String | The notes reference (refs/notes/commits) |
base_commit | Optional | Previous notes ref commit SHA |
new_ref_sha | String | New notes ref SHA after the operation |
result | Object | Operation result with success, status, and optional message |
Notes
- Use
action: "add"to create a new note (fails if note already exists) - Use the Append note endpoint to add to an existing note
- The
expected_ref_shaparameter enables optimistic concurrency control
Error Responses
| Status | Description |
|---|---|
409 Conflict | Note already exists for this commit, or expected_ref_sha doesn’t match |
401 Unauthorized | Invalid JWT or missing git:write scope |
400 Bad Request | Missing required fields |