---
title: "Save an entry -- creates a new commit, optimistic-locked on the head commit"
method: PATCH
path: "/entries/{entryId}"
tags: ["Entries"]
---

# Save an entry -- creates a new commit, optimistic-locked on the head commit

`PATCH /entries/{entryId}`

## Request

- Base URL: `https://whatareyoudo.ing/api/v1`
- URL: `https://whatareyoudo.ing/api/v1/entries/{entryId}`
- Auth: HTTP bearer

`content` REPLACES the entry's text and its header fields; it is not a partial patch. `GET /entries` does not return the body, so a caller that lists entries and sends back what it read erases the other person's writing (#1422) -- read the entry with `GET /entries/{entryId}` first, or set `appendBody` and send only the new text.

## Path parameters

- `entryId` string, uuid, required

## Request body

- UpdateEntryRequest
  - `content` object
    - `format` 'plain' | 'markdown'
    - `body` string, required
    - `title` string, nullable
    - `mood` string, nullable
    - `location` string, nullable
    - `locationLat` number, nullable
    - `locationLng` number, nullable
    - `tags` string[]
    - `coverMediaAssetId` string, uuid, nullable
  - `media` object[]
    - `mediaAssetId` string, uuid, required
    - `caption` string, nullable
  - `occurredAt` string, date-time
  - `commitMessage` string, nullable
  - `expectedHeadCommitId` string, uuid, nullable
  - `appendBody` boolean: Put `content.body` after the stored text instead of replacing it, separated by a blank line. The header fields (title, mood, location, tags, cover) are replaced either way.

## Response `200`

OK

- object
  - `data` object, required
    - `headCommitId` string, uuid, required
    - `parentCommitId` string, uuid, nullable, required
  - `meta` object, required
    - `requestId` string, required

## Other responses

- `409`: VERSION_CONFLICT -- expectedHeadCommitId didn't match the current head

---

[API](https://skmtc.dev/whatareyoudo/apis/whatcha-api.md) · [All operations](https://skmtc.dev/whatareyoudo/apis/whatcha-api/llms.txt) · [OpenAPI document](https://skmtc.dev/whatareyoudo/apis/whatcha-api/revisions/48dd8a54abea?raw)
