Dayli Docs

Edit a post

PATCH
/api/v1/posts/{postId}

Lets the author change the reflective answer, caption, rating, and audience of their post, before or after release. The request carries all four, and only values that differ are saved. Each saved edit keeps the previous version as a revision. Send the revisionCount you last read as expectedRevisionCount; a 409 means another edit was saved first. Repeating an edit that is already saved returns the post without adding a revision.

Authorization

AuthorizationBearer <token>

In: header

Path Parameters

postId*string
Length1 <= length <= 128

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Every editable field, as the post should read after the edit. Only values that differ are saved, and only then is a revision stored. The prompt, day, media and tomorrow note cannot be edited.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/api/v1/posts/post-1" \  -H "Content-Type: application/json" \  -d '{    "expectedRevisionCount": 0,    "reflectiveAnswer": "Walked to the harbour after class, then home along the beach.",    "caption": "Sunset at the wharf",    "rating": 8,    "audience": "solo"  }'
{  "id": "post_01K4Y6P8K2",  "author": {    "id": "post_01K4Y6P8K2",    "username": "string",    "displayName": "string"  },  "localDate": "2026-09-10",  "prompt": {    "id": "post_01K4Y6P8K2",    "text": "string"  },  "reflectiveAnswer": "string",  "caption": "string",  "rating": 0,  "audience": "solo",  "acceptedAt": "2026-09-09T12:00:00Z",  "releasedAt": "2026-09-09T12:00:00Z",  "edited": true,  "revisionCount": 0,  "likeCount": 0,  "viewerHasLiked": true,  "commentCount": 0,  "viewerIsAuthor": true,  "media": [    {      "id": "post_01K4Y6P8K2",      "contentType": "image/jpeg",      "order": 0,      "url": "http://example.com",      "expiresAt": "2026-09-09T12:00:00Z"    }  ],  "voiceMemo": {    "id": "post_01K4Y6P8K2",    "contentType": "audio/mp4",    "url": "http://example.com",    "expiresAt": "2026-09-09T12:00:00Z"  },  "weather": {    "condition": "clear",    "temperatureC": 18,    "placeName": "Auckland"  }}